的绑定()
功能似乎并没有找到双向绑定的端到端测试。假设下面的绑定:
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');