javascript - Testing with protractor using ui-select -


i trying test ui-select protractor. in ui-select have list of countries. html looks like:

<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 country in countries | filter: {name:$select.search}">                     <span ng-bind-html="country.name"></span>                 </ui-select-choices> </ui-select> 

my page object looks like:

this.country = element(by.model('datianagrafici.countryofbirth')); this.fillform = function(){    this.country.sendkeys('it'); } 

in spec file have:

it('should fill form', function() {   form.fillform(); }) 

but when run test ng-model not filled sent data. have tips? thanks

i have found solution here

this.country = element(by.model('datianagrafici.countryofbirth')); this.selectcountry = this.country.element(by.css('.ui-select-search')); 

then in fill form method alecxe said:

this.country.click(); this.selectcountry.sendkeys('italy'); 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -