angularjs - How to test angular-ui-Selectize using Protractor? -


i want test simple user creation form contains few dropdown controls (each 1 angular-ui-select)

i didn't find doc on how select 1 of items..

this html:

<ui-select ng-model="user.assignedgroup" theme="selectize" class="dropdown">                             <ui-select-match placeholder="{{::strings('userdetails.assigntogroupplaceholder')}}">{{$select.selected.name}}</ui-select-match>                             <ui-select-choices repeat="group.name group in groups">                                 <span ng-bind-html="group.name | highlight: $select.search"></span>                             </ui-select-choices>                         </ui-select> 

i able dropdown list open by:

element(by.model('user.assignedgroup')).click();

what's next??

edit

the current solution found using typing , searching specific element , "hit" enter key, it's not way want test control. have dropdown control not searchable well....

var selectgroupbutton = element(by.model('user.assignedgroup'));         var selectinput = selectgroupbutton.element(by.css('.ui-select-search'));          // click open select         selectgroupbutton.click().then(function(){             // type text             selectinput.sendkeys('group1\n');         }); 

you can access child elements using different css selectors, example:

$('.dropdown ui-select-match:first-child'); 

and after can achieve behaviour want.

i recommend here: http://www.w3schools.com/cssref/css_selectors.asp


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -