我是量角器的新手,现在我的工作需求是为angularjs应用程序创建测试项目。 我已经开始与指导方针和开始面临着错误:量角器。在页面上执行一个动作后浏览器出错
Error: Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []
http://errors.angularjs.org/1.4.0/$rootScope/infdig?p0=10&p1=%5B%5D
http://localhost/main-f3fbd0c72e8415cd0a449214b66bdacc-cached.js:2140
at window.onerror (http://localhost/main-f3fbd0c72e8415cd0a449214b66bdacc-cached.js:1277:52)
配置文件
exports.config = {
directConnect: true,
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
specs: ['specs/spec.js'],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
测试文件:
"use strict";
describe('WEB test project', function() {
var wl5StartPage = require('../pages/startPage.js');
it('Its start login page', function() {
wl5StartPage.get();
wl5StartPage.wl5Login();
});
});
startPage.js:
var WL5LoginPage = function() {
this.userName = element(by.model('loginInfo.userId'));
this.loginButton = element(by.css('[ng-click="login()"]'));
this.get = function() {
browser.get('http://localhost/login');
};
this.wl5Login = function() {
this.userName.sendKeys("user1");
this.loginButton.click();
};
}
module.exports = new WL5LoginPage();
它非常简单的测试,但不幸的是,当我输入用户名并点击“登录”时它崩溃了。 有没有办法忽略这种浏览器错误?或者以某种方式解决问题?
预先感谢您。
发布您的登录代码的规范里面,这样我们就知道是怎么回事... –
当然可以,登录码添加到帖子。 –