We were evaluating Sauce labs for our application. We were trying to get protractor tests run on multiple browsers at same time in Sauce labs. Will there be a new instance of VM created to run tests on each browser? We have configured protractor for multicapablities. When would the new instance of VM be created? and if possible how would we configure to run tests on single VM or multiple VM?
Thanks.
It is possible to have protractor start multiple capabilities at the same time as well as run multiple tests in parallel. ( i do it in a work project )
By default i believe that each capability will run in parallel, to have the tests run in parallel also you need to set the shardTestFiles: true
option.
https://github.com/angular/protractor/blob/master/docs/referenceConf.js#L114-L117
note this will be limited to the max instances limit of your saucelabs account (normally 10)
you can see in the following code snippet that we have set our protractor to give precedence to IE8 as its is the slowest, then the other browsers will start a maximum of 3 test scripts in parallel with the rest queuing up
maxSessions: 10,
multiCapabilities: [
{
browserName: 'internet explorer',
version: '10',
shardTestFiles: true,
maxInstances: 3,
'screen-resolution': '1024x768',
build: process.env.CI_BUILD_NUMBER
},
{
browserName: 'internet explorer',
version: '8',
platform: 'Windows XP',
shardTestFiles: true,
maxInstances: 10,
'screen-resolution': '1024x768',
build: process.env.CI_BUILD_NUMBER
},
{
browserName: 'firefox',
platform: 'Windows 8',
shardTestFiles: true,
maxInstances: 3,
'screen-resolution': '1024x768',
build: process.env.CI_BUILD_NUMBER
},
{
browserName: 'safari',
version: '7',
platform: 'OS X 10.9',
shardTestFiles: true,
maxInstances: 3,
'screen-resolution': '1024x768',
build: process.env.CI_BUILD_NUMBER
},
{
browserName: 'chrome',
platform: 'Windows 8.1',
shardTestFiles: true,
maxInstances: 3,
'screen-resolution': '1024x768'
}
]