量角器同步-超时
Protractor synchrozation - timeout
我正在为我们的应用程序编写简单的量角器测试:
- 登录页面没有angularhs -工作正常
- 所有其他页面都使用angularjs
当我想写angularhs测试-我得到了这个错误(以下安装):
Timed out waiting for Protractor to synchronize with the page after 40002ms. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
配置:exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['login-spec.js'],
baseUrl: 'https:/xyz/',
allScriptsTimeout: 40000,
capabilities: {
'browserName': 'firefox'
}
}
And my spec:
describe('Login #1', function() {
// BEFORE LOGIN
it('should pass to next login step', function() {
browser.driver.get('https://xyz/login');
browser.driver.findElement(by.css(".factorFirst > [name='username']:first-child")).sendKeys('123456');
.... other login stuff
}, 90000);
// AFTER LOGIN TEST
it('Simple Angular Test', function() {
browser.get('/page');
element(by.model('payment.userSpecified.message')).sendKeys(1);
}, 45000);
});
我们的body
元素属性中没有ng-app
。这会是个问题吗?
你需要让protractor
知道登录页面是非angular的,它不需要等待angular"安定下来"。登录前将ignoreSynchronization
设置为true
,登录后将其设置为false
:
describe('Login #1', function() {
afterEach(function () {
browser.ignoreSynchronization = false;
});
it('should pass to next login step', function() {
browser.ignoreSynchronization = true;
browser.driver.get('https://xyz/login');
browser.driver.findElement(by.css(".factorFirst > [name='username']:first-child")).sendKeys('123456');
}, 90000);
it('Simple Angular Test', function() {
browser.get('/page');
element(by.model('payment.userSpecified.message')).sendKeys(1);
}, 45000);
});
相关文章:
- 在控制器和数据对象之间同步数据
- 同步调用,直到用户通过angular验证为访问者
- javascript函数同步
- 与运行长作业(javascript,node.js)的第三方API同步的最佳实践
- 使用优化器在慢速连接上加载main.js时需要js超时
- 显示具有服务器端自动时间注销的同步倒计时计时器
- 同步 Javascript 承诺超时以加班 Google 地理编码查询限制
- window.set同步处理异步调用的超时
- 使用$resource时,量角器等待与页面同步超时
- while循环中的Javascript同步超时
- 同步窗口.设置超时回调
- 量角器在忽略同步期间等待,浏览器隐式超时与浏览器.等待超时
- Web 视图中的同步 Ajax 超时
- 如何为JQuery$.ajax同步请求设置超时并执行某些操作
- 在长轮询时避免在Protractor中出现测试同步超时
- 相当于同步JS中的XMLHttpRequest超时
- 在不支持javascript同步xmlhttprequest时,如何实现超时
- jQuery带超时的同步表单提交
- 量角器同步-超时
- 错误:在11001ms后,量角器与页面同步的等待超时.当用户browser.getCurrentUrl()时