我试图在三个单独的实例中运行我的三个规范但是当我运行配置文件时,打开一个实例然后关闭。其他两个规格成功运行。
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
var reporter = new HtmlScreenshotReporter({
dest: 'C:/Users/bill/report/report/screenshots',
filename: 'my-report.html'
});
exports.config = {
directConnect: true,
framework: 'jasmine',
// seleniumAddress: 'http://localhost:4444/wd/hub',
jasmineNodeOpts: {
defaultTimeoutInterval: 640000000
},
specs: ['00-test.js',
'01-test.js',
'02-test.js'],
multiCapabilities: [
{
browserName: 'chrome',
shardTestFiles: true,
maxInstances: 3,
}
],
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
// Assign the test reporter to each running instance
onPrepare: function() {
jasmine.getEnv().addReporter(reporter);
},
// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
}
}
答案 0 :(得分:0)
您在这里不需要multiCapabilities,因为您在单个浏览器中运行chrome.Try Capabilities only。