Josh Stevens
Josh Stevens

Reputation: 1

How can multiple protractor tests be automatically run from different spec files

I want to run multiple tests using protractor, however, I have not been able to find a good way to do it. If I have multiple spec files (e.g. testA-spec.js, testB-spec.js, testC-spec.js) and I have my protractor configuration file setup to run all files that end in -spec.js:

exports.config = {

specs: [ '*-spec.js' ]

};

protractor will run all three tests but it hangs on the last test until it fails due to timing out. If I run each test individually, then there is no hang. What I want is a way to automatically run each test sequentially in a batch process as if I manually ran each one. I would also like the browser to close after each test and reopen on the next one as if the previous test(s) were never run. I'm using the Jasmine framework with selenium-webdriver in case that matters.

Upvotes: 0

Views: 803

Answers (1)

Ben Mohorc
Ben Mohorc

Reputation: 694

Use shardTestFiles: true in capabilities to me each spec file run in its own browser instance.

Upvotes: 0

Related Questions