Praveesh P
Praveesh P

Reputation: 1449

Open each spec in a new window - Protractor

I have few specs like :

specs: ['spec1.js','spec2.js','spec3.js],

I think all these specs run one by one in the same window that was opened.

How can I do like :

Open a new window > Run a spec > Close the window > Open a new Window > Run the next spec > Close the window .... and so on ...

Thanks in advance.

Upvotes: 0

Views: 1343

Answers (2)

Xotabu4
Xotabu4

Reputation: 3091

You can also try to add to capabilities this options:

shardTestFiles: true
maxInstances: 1

https://github.com/angular/protractor/blob/master/docs/referenceConf.js#L158

So each spec will be executed in own browser instance.

But you might get errors with reporting - since Jasmine will be re-initialized between each spec file. I solved this with producing separate junit XML and combining them together after execution.

Upvotes: 1

Ram Pasala
Ram Pasala

Reputation: 5231

You can use new feature of protractor in your config file:

restartBrowserBetweenTests: true

you can find detailed discussions on this feature here : How to, so to speak, restart or close browser after every protractor -spec test

Upvotes: 1

Related Questions