javascript - how to test angularjs app with angularjs e2e with multiple inputs with same ng-model -
in our program have directive occurs multiple times input field. our code looks
<li> <label>ami</label> <div class="searchbox" searchbox="" filter="search.ami"> <form ng-submit="dofilter()" class="ng-pristine ng-valid"> <input class="span12 ng-pristine ng-valid" type="text" placeholder="" ng-model="filter"> </form> </div> </li> <li> <label>username</label> <div class="searchbox" searchbox="" filter="search.username"> <form ng-submit="dofilter()" class="ng-pristine ng-valid"> <input class="span12 ng-pristine ng-valid" type="text" placeholder="" ng-model="filter"> </form> </div> </li>
now using angular e2e test says use "input(name).enter(value)" input, name ng-model. if , "input('filter').enter('foo')" both input fields inputted. can't figure out how input 1 field @ time. how so.
i figured out. need use using focus scope. example
using('div[filter="search.username"]').input("filter").enter("foo"); using('div[filter="search.ami"]').input("filter").enter("bar")
Comments
Post a Comment