Reputation: 11317
I am writing protractor end-to-end tests and I have to reset the database before each test. In order to do that, I need to call a shell script. Is that possible? If yes, how?
Upvotes: 2
Views: 2242
Reputation: 78
This is not exactly a protractor related issue , but with jasmine. I am assuming you are jasmine bdd + protractor . You need to invoke a method , which executes the cmd or shell script file , in the beforeEach block .
one can use the unix-cmd
nodejs package. OR One can take it a step further , by saving the commands to b executed in a utilities method and invoking the speific utilities method in the before each block. You can check the jasmine documentation for it.
Hope this helps.
Upvotes: 2