可以让量角器同时启动多个功能以及并行运行多个测试。 (我在一个工作项目中这样做)
默认情况下,我相信每个功能都会并行运行,要让测试并行运行,您还需要设置shardTestFiles: true 选项。
https://github.com/angular/protractor/blob/master/docs/referenceConf.js#L114-L117
注意这将限制在您的 saucelabs 帐户的最大实例数限制(通常为 10)
你可以在下面的代码sn-p中看到我们已经将量角器设置为优先考虑IE8,因为它是最慢的,然后其他浏览器将启动最多3个测试脚本并行,其余的排队
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'
}
]