1
votes

We have a bunch of e2e protractor tests on jasmine2 framework and recently we started to run them on SauceLabs.

SauceLabs has a restriction that one WebDriver session can not run longer than 30 mins. This makes perfect sense to me, however causes our tests to fail as protractor runs all our tests in a single WebDriver session.

So I'm wondering how can I initiate new WebDriver session, say for each spec file or for each 'describe'? Or there is a solution that protractor can offer out of the box?

Timeout increase is not an option for me.

Many thanks.

1
Oh, I was just looking at Sauce Labs yesterday, we might use it. Did not know about this limit though... good question. I know there is the restartBrowserBetweenTests config option, but I think that restarts between each itGunderson
Yeah, that option restarts browser in between each it which is not quite suitable for us.Sergii
@Gunderson, have a look at Common Error Message. Was quite useful to me.Sergii
How about shardingTestFiles ?Barney

1 Answers

0
votes

I believe that's what you are looking for:

{
        browserName: 'chrome',
        shardTestFiles: true,
        maxInstances: 5
    },

Use this in your config.js file and make sure to divide the tests among multiple spec files. I am using this in my tests (an example here), and it is working fine for me.

{
        'name': 'Window10 -Chrome-tests',
        'browserName': 'chrome',
        shardTestFiles: true,
        platform: 'Windows 10',
        screenResolution: '1376x1032',
        maxInstances: 5
    },