lundi 12 mai 2014

Protractor testing angular ng-options


Vote count:

0




I four <select> with ng-options used in my page that will retrieve different information. All of them are like this, except with different data binding, names and ids:



<div class="col-sm-3">
<label class="control-label" for="lawyer">Lawyer</label>
<select class="form-control" id="lawyer" name="lawyer" ng-model="model.lawyerUuid" required
ng-options="lawyer.uuid as lawyer.name for lawyer in model.lawyers">
</select>
</div>


How can I test this in protractor so I can make sure there are only x (e.g. 2) lawyers returned ?


Since I use ng-options, finding by ng-repeat won't work and if I search with the following, I will get all four <selects> in my page and not only the one above (so if all of them would return 2 elements I would have a count() of 8):



element.all(by.css('select option'))


Is there a way to retrieve all the elements that have a parent with some specified id?



asked 19 secs ago

amb

780





Aucun commentaire:

Enregistrer un commentaire