angularjs - How to acess to a var in a test script AngularJS_e2e -
angularjs - How to acess to a var in a test script AngularJS_e2e -
i utilize variable "fructs".
var fructs = [ { name: "banna", color: "yellow"}, { name: "lemon", color: "yellow"}, { name: "strawberry", color: "red"} ];
i have application in angularjs
<div class="fructlist"> {{ fruct.name }}: <input type="checkbox" ng-repeat="fruct in fructs" ng-model="fruct.checked ng-checked="fruct.checked"> </div>
so, want utilize property "color" in test.i utilize protractor, selenium web-driver
it('should click on fructs yellow', function() { element.all(by.repeater('fruct in fructs')).then(function(arr) { var size = arr.length; (var = 0; < size; i++) { if(arr[i].color=='yellow') {//not possible acces color property arr[i].click();/*click possible when don't set condition..*/ } } }); });
i want know instance, if "arr[0]" object equals [{name : "banna", color: "yellow"}] (it looks not possible), , if possible access of current fruct (object) in the ng-repeat: want click on element (checkbox) if know color (wich not display in browser)
thanks,
angularjs selenium-webdriver jasmine angularjs-e2e
Comments
Post a Comment