【发布时间】:2018-02-07 17:51:32
【问题描述】:
今天我醒来并尝试像往常一样使用量角器运行E2E 测试并显示错误消息:
'茉莉花规格超时。正在重置 WebDriver 控制流'。
我想指出,在使用与往常相同的规格之前从未发生过这种情况。这对我来说没有任何意义。 有什么想法吗?让我分享我的配置:
var HtmlReporter = require('protractor-html-screenshot-reporter');
var today = new Date(),
timeStamp = today.getMonth() + 1 + '-' + today.getDate() + '-' + today.getFullYear() + '-' + today.getHours() + 'h-' + today.getMinutes() + 'm';
var reporter = new HtmlReporter({
baseDirectory: '../test_out/e2e',
docTitle: 'Protractor Reporter',
docName: 'protractor-tests-report-' + timeStamp + '.html',
takeScreenShotsOnlyForFailedSpecs: false
});
exports.config = {
"allScriptsTimeout": 15000,
seleniumPort: 4444,
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
chromeOptions: {
args: [
'--disable-extensions'
]
}
},
//A base URL for your application under test.
//Calls to protractor.get() with relative paths will be prepended with this.
//baseUrl: 'http://localhost/',
baseUrl: 'https://federation-sts-stage.accenture.com/adfs/ls?wa=wsignin1.0&wtrealm=https%3a%2f%2frecruitmentdocuments.ciostage.accenture.com%2f&wctx=rm%3d1%26id%3dpassive%26ru%3d%252f&wct=2016-03-09T13%3a48%3a44Z&RedirectToIdentityProvider=urn%3afederation%3aaccenture%3astage',
frameworks: [
'jasmine',
'jasmine-matchers'
],
//An array of file patterns that point to your spec files.
//Patterns are relative to the current working directory when Protractor is started up.
specs: [
//"../../../../../ng-app/test/javascript/e2e/**/*.scenario.js"
"../../../../../ng-app/test/javascript/e2e/**/login.scenario.js",
"../../../../../ng-app/test/javascript/e2e/**/assignTask.scenario.js"
//"../../../../../ng-app/test/javascript/e2e/**/cancelTask.scenario.js",
//"../../../../../ng-app/test/javascript/e2e/**/search.scenario.js",
//"../../../../../ng-app/test/javascript/e2e/**/uploadDocument.scenario.js",
//"../../../../../ng-app/test/javascript/e2e/**/openDocument.scenario.js"
//"../../../../../ng-app/test/javascript/e2e/**/createOffer.scenario.js",
//"../../../../../ng-app/test/javascript/e2e/**/shareLink.scenario.js"
//"../../../../../ng-app/test/javascript/e2e/**/createOPR.scenario.js"
],
//Separate your tests in various test suites:
//protractor protractor.conf.js --suite homepage
suites: {
login: '../../../../../ng-app/test/javascript/e2e/**/login.scenario.js',
assignTask: '../../../../../ng-app/test/javascript/e2e/**/assignTask.scenario.js'
//cancelTask: '../../../../../ng-app/test/javascript/e2e/**/cancelTask.scenario.js',
//search: '../../../../../ng-app/test/javascript/e2e/**/search.scenario.js',
//uploadDocument: '../../../../../ng-app/test/javascript/e2e/**/uploadDocument.scenario.js',
//openDocument: '../../../../../ng-app/test/javascript/e2e/**/openDocument.scenario.js'
//createOffer: '../../../../../ng-app/test/javascript/e2e/**/createOffer.scenario.js',
//shareLink: '../../../../../ng-app/test/javascript/e2e/**/shareLink.scenario.js'
//createOPR: '../../../../../ng-app/test/javascript/e2e/**/createOPR.scenario.js'
},
onPrepare: function () {
//Set window size before starting the tests
//browser.driver.manage().window().setSize(320, 568);
browser.driver.manage().window().maximize();
var SpecReporter = require('jasmine-spec-reporter');
jasmine.getEnv().addReporter(new SpecReporter({
displayStacktrace: 'all', // display stacktrace for each failed assertion, values: (all|specs|summary|none)
displayFailuresSummary: true, // display summary of all failures after execution
displayPendingSummary: true, // display summary of all pending specs after execution
displaySuccessfulSpec: true, // display each successful spec
displayFailedSpec: true, // display each failed spec
displayPendingSpec: false, // display each pending spec
displaySpecDuration: true, // display each spec duration
displaySuiteNumber: false, // display each suite number (hierarchical)
colors: {
success: 'green',
failure: 'red',
pending: 'yellow'
},
prefixes: {
success: '✓ ',
failure: '✗ ',
pending: '* '
},
customProcessors: []
}));
//// Add a screenshot reporter and store screenshots to `/tmp/screnshots`:
jasmine.getEnv().addReporter(reporter);
},
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
onComplete: null, //function to call before the driver quits
showColors: true, //provide colored output during spec runs
defaultTimeoutInterval: 60000,
isVerbose: true, //provide verbose output during spec runs
includeStackTrace: true //include a stack trace on errors
},
};
【问题讨论】:
-
尝试增加你的 jasmine defaultTimeoutInterval: 2*60*1000,开发端可能会有所改变。当它阻塞需要时间来执行并且超出定义的时间(在您的情况下为 60 秒)时,就会出现此错误。
标签: selenium jasmine protractor