Search code examples
protractorend-to-end

Cleanup for running spec files in series in Protractor


I am running multiple specs using a Protractor configuration file as follows:

...
specs: [abc.js , xyz.js]
...

After abc.js is finished I want to reset my App to an initial state from where the next spec xyz.js can kick off.

Is there a well defined way of doing so in Protractor? I'm using Jasmine as a test framework.


Solution

  • I used a different approach and it worked for me. Inside my first spec I am adding Logout testcase which logouts from the app and on reaching the log in page, just clear the cookie before login again using following:

    browser.driver.manage().deleteAllCookies();