【发布时间】:2016-03-25 05:25:13
【问题描述】:
我为我的 Angular 应用创建了一个简单的量角器测试。当我单击一个按钮时,会设置一个输入值:
$scope.fillForm=function(){
console.log('fillform');
$scope.myText='hoera';
};
e2e 测试期望输入填充“hoera”:
describe('fill in form e2e test', function () {
it('should test form', function () {
browser.get('http://localhost:63342/protractor_new/index.html');
element(by.buttonText('go')).click().then(function () {
var el = element(by.model('myText')).getText();
expect(el).toEqual('hoera');
});
});
});
当我使用“protractor conf”运行测试时,我得到:
Expected '' to equal 'hoera'.
我希望类似:预期的 'hoera' 等于 'hoera'?我怎样才能让它通过也许在角度设置值之前有延迟?这是代码的链接:https://github.com/dimitri-a/protractor_new
【问题讨论】:
标签: angularjs protractor