问题
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