这是我的设置。是否有正确的平行角度/非角度应用测试设置?有时,我的 firefox 或 chrome 在另一个运行时挂起。是否假设将ignoreSynchronization设置为true而waitForAngular设置为false?我觉得有太多时间同步问题导致其中一个浏览器挂起?
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
getPageTimeout: 600000,
allScriptsTimeout: 500000,
defaultTimeoutInterval: 30000,
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
multiCapabilities:
[{
'browserName': 'firefox',
specs: 'features/firefox/*.feature',
},
{
'browserName': 'chrome',
specs: 'features/chrome/*.feature',
}],
maxSessions: 2,
baseUrl: 'https://localhost:8080',
cucumberOpts: {
strict: true,
require: [
'hooks/hooks.js',
'specs/*Spec.js'
],
tags: [
"@runThis",
"~@ignoreThis"
],
profile: false,
format: 'json:./e2e/reports/cucumber-report.json',
resultJsonOutputFile: './e2e/reports/cucumber-report.json'
},
beforeLaunch: function() {
const fs = require('fs');
const path = require('path');
const directory = './e2e/reports';
//cleans up the json results from the previous build when using node flake
fs.readdir(directory, (err, files) => {
if (err) throw err;
for (const file of files) {
fs.unlink(path.join(directory, file), err => {
if (err) throw err;
});
}
});
},
onPrepare: function() {
var chai = require('chai');
chai.use(require('chai-as-promised'));
global.expect = chai.expect;
browser.ignoreSynchronization = true;
browser.manage().window().maximize();
browser.waitForAngular(false);
browser.manage().timeouts().implicitlyWait(30000);
},
ghostMode:false
}