I want to add two counts in the protractor testcase from ng-repeat .But I am unable to fetch the count object via repeater.

html:

<div ng-repeat="act in actives">
 <div>
  <input id="checkbox-active" ng-model="act.checked" 
    ng-change="chooseActive(actInact)"/> {{actInact.name}} 
 </div>
 <div><span id="active-count">{{actInact.count}}</span></div>
</div> 

test.spec

this.getStateCount = function () {
    var item = element.all(by.repeater('activeInactive in activeInactives'));
        console.log("item"+item[0].count);
        console.log("item"+item[0]);

    item.getText().then(function(text){
    console.log("text1+txt2"+text[0]+text[1]);
    })
    };

gives active 1 inactive 2 in console. when I tried

console.log("item"+item[0].count); gives undefined 

and exception is thrown. and item is coming as object object.

0 Answers