Protractor E2E Test Seed Database

烂漫一生 提交于 2019-12-02 23:53:04
Delian Mitankin

Being in a NodeJs environment, you can connect to the database directly from Protractor, but I wouldn't go down that route. You'll have to update your SQL-setup-script along with your changes to your back-end.

There are other ways:

  1. Use your existing REST facade to populate your database - register a user, connect with another user, etc. If you set-up each of your tests with unique data you would be able to run them simultaneously that way.
  2. Expose to your test environment a special REST point that does all the clearing/setting-up for you between tests.

You can fire REST calls directly from the Protractor environment or use your browser for that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!