【发布时间】:2018-03-13 15:59:19
【问题描述】:
我是 Protractor 的新手,我正在尝试运行我的脚本。
describe('Navigator homepage', function() {
it('should proceed to login', function() {
browser.get('url');
})
it('Clicks the proceed button',function() {
const proceedButton = element(by.id('auth-login-page-button'));
proceedButton.click();
});
});
但每当我运行它时,浏览器就会打开并进入网站,然后等待 20 秒,然后我得到错误:ScriptTimeoutError: asynchronous script timeout: result was not received in 20 seconds。该元素显然存在并且可以单击,但不能用于量角器。难道我做错了什么?
配置文件如下所示:
// An example configuration file.
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: ['login_spec.js'],
allScriptsTimeout: 20000,
getPageTimeout: 15000,
framework: 'jasmine',
jasmineNodeOpts: {
isVerbose: false,
showColors: true,
includeStackTrace: false,
defaultTimeoutInterval: 40000
}
};
【问题讨论】:
标签: javascript automation jasmine protractor