我想在Protractor的新chrome实例中使用每个测试套件

时间:2017-10-05 07:06:31

标签: protractor

我正在用量角器测试我的非角度应用程序。 我有40个测试套件,包括登录测试。这些所有测试套件都有不同的文件。

    export.config :{
    spec:[
    'testSuite1.js',
    'testSuite2.js',
    'testSuite3.js',
    'testSuite4.js',
    ...
    ...
    'testSuite38.js',
    'testSuite39.js',
    'testSuite40.js',
    ]
}

我想在新的Chrome浏览器窗口中启动每个10个测试套件。 就像我在commandLine中运行protractor conf.js一样,它应该开始打开4个窗口,所有40个测试套件都从那些开始。

每个实例10个。

我有一些想法 -

capabilities: {
    browserName: 'chrome',
    shardTestFiles: 'true',
    maxInstances: 4
  },

但无法做到。

更新 我试过Ernst描述但没有成功 -

 Started Selenium server: 127.0.0.1:4444
 Running "protractor:start" (protractor)
 task [17:04:00] W/launcher - You have specified both capabilities and multiCapabilities. This will result in capabilities being ignored [17:04:00] I/launcher - Running 0 instances of WebDriver
 E:\Work\test>

1 个答案:

答案 0 :(得分:1)

我认为这样的事情对你有用。

您可以为每项功能添加特定的spec,也可以排除某些功能。 而你可能会重复相同的能力"在multiCapabilities内,我建议这样的内容:

multiCapabilities: [{
    browserName: 'chrome',
    shardTestFiles: 'true',
    maxInstances: 4
    spec: ['spec_1.js', ... , 'spec_10.js'] //evtl. specify a path with them and do ../path/*.js
},{
    browserName: 'chrome',
    shardTestFiles: 'true',
    maxInstances: 4
    spec: ['spec_11.js', ... , 'spec_20.js'] //evtl. specify a path with them and do ../path/*.js
}, { 
    //same for the other test suites.
}],

查看official lib/config.tscapabilities部分了解详情。

由于我自己没有这些选项的经验,你需要尝试一下。

请告诉我,如果它为您提供了解决方案。

相关问题