我binding
在 e2e 测试中测试 a 时遇到问题。这是我的代码:
HTML:
<select ng-model="salutation" ng-options="s.value for s in salutations">
<option value="">Please choose</option>
</select>
控制器:
function MainCtrl($scope) {
$scope.salutations = [{
key: "male",
value: "Mr."
}, {
key: "female",
value: "Mrs."
}];
$scope.salutation = salutations[0];
}
端到端测试:
...
describe('Form', function() {
it('should initialize from model', function() {
expect(binding('salutation')).toMatch('Mr.');
});
});
...
运行 e2e 测试时,我收到以下错误消息:
select binding 'salutation'
Binding selector 'salutation' did not match.
<span>{{salutation}}</span>
谢谢!
更新:关闭以支持新问题为什么 binding() 在 e2e 测试中找不到双向绑定?