我正在尝试使用量角器测试 ui-select。在这个 ui-select 中,我有一个国家列表。我的 html 看起来像:
<ui-select ng-model="datiAnagrafici.countryOfBirth" name="countryOfBirth" theme="bootstrap" reset-search-input="true" append-to-body="true" required blur>
<ui-select-match placeholder="paese di nascita">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="country.code as country in countries | filter: {name:$select.search}">
<span ng-bind-html="country.name"></span>
</ui-select-choices>
</ui-select>
我的页面对象如下所示:
this.country = element(by.model('datiAnagrafici.countryOfBirth'));
this.fillForm = function(){
this.country.sendKeys('IT');
}
在我的规范文件中,我有:
it('should fill the form', function() {
form.fillForm();
})
但是当我运行我的测试时,ng-model 没有填充发送的数据。你有什么建议吗?谢谢