Angularjs 为什么';t binding()在e2e测试中找到双向绑定吗?

Angularjs 为什么';t binding()在e2e测试中找到双向绑定吗?,angularjs,Angularjs,binding()函数在e2e测试中似乎找不到双向绑定。假设以下绑定: <input ng-model="username"> <p>{{email}}</p> <input ng-bind="password"> 以下e2e测试成功: ... expect(binding('email')).toMatch('alice@ab.com'); expect(binding('password')).toMatch('abc123'); ...

binding()
函数在e2e测试中似乎找不到双向绑定。假设以下绑定:

<input ng-model="username">
<p>{{email}}</p>
<input ng-bind="password">
以下e2e测试成功:

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

请这样试试

<input ng-model="username">

你说得对,那会有用的。但是我想知道为什么不能直接检查绑定。您是否尝试将ng model=“username”更改为ng bind=“username”这使绑定成为“正常”绑定<代码>ng绑定不是双向绑定。
<input ng-model="username">
expect(input('username').val()).toMatch('alice');