为什么不绑定()找到一个双向绑定在一个端到端的测试? [英] Why doesn't binding() find a two-way-binding in an e2e test?

查看:118
本文介绍了为什么不绑定()找到一个双向绑定在一个端到端的测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

绑定()功能似乎并没有找到双向绑定的端到端测试。假设下面的绑定:

The binding() function doesn't seem to find two-way-bindings in e2e tests. Assuming the following bindings:

<input ng-model="username">
<p>{{email}}</p>
<input ng-bind="password">

下面的端到端测试失败:

The following e2e test fails:

...
expect(binding('username')).toMatch('alice');
...
>> Binding selector 'username' did not match.

下面的端到端测试成功:

The following e2e tests succeeds:

...
expect(binding('email')).toMatch('alice@ab.com');
expect(binding('password')).toMatch('abc123');
...

THX!

推荐答案

请尝试这种方式;

<input ng-model="username">

而在你的E2E的测试;

And in your E2E test;

expect(input('username').val()).toMatch('alice');

这篇关于为什么不绑定()找到一个双向绑定在一个端到端的测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆