有没有办法过滤by.repeater的结果?我需要它,因为我在另一个ngRepeat中有一个ngRepeat,我想看看元素是否在正确的组中。 例如:
<div ng-repeat="group in itemsGrouped">
<div ng-repeat="item in group.values">
</div>
</div>
我们需要这样的东西:
describe('group1', function(){
group = ptor.findElements(protractor.By.repeater('group in itemsGrouped').filter('group.name == "group1"'));
it('should have one item', function(){
expect(group.count()).toBe(1);
});
});
// or
describe('group1', function(){
groupCount = ptor.findElements(protractor.By.repeater('group in itemsGrouped')).count();
it('should have one item', function(){
groupCount.then(function(count){
for(var i = 0;i < count; i++) {
ptor.findElements(protractor.By.repeater('item in group.values').filter('group.name == "group1"'));
...
}
});
});
});