How to restore database before executing test in protractor

元气小坏坏 提交于 2020-01-04 02:48:08

问题


I have written E2E tests in Protractor which uses node to run through webdriver.

Now I have some inserts tests which will insert the data and create user.

Now if I run the case for the first time it will pass but when I will rerun the test it will fail as it will already present.

Expected : I need to restore my MSSQL DB when ever the tests in protractor start.

Present : I am doing manually by restoring the test.

Is there any way that I can restore the DB through protractor or Node ?


回答1:


This is really out of scope for protractor.

Make your grunt or gulp task manager to execute the database restore script before running protractor end-to-end tests. For example, you can use grunt-shell package.

See also:

  • Angular Protractor e2e Testing


来源:https://stackoverflow.com/questions/28740837/how-to-restore-database-before-executing-test-in-protractor

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