1

I start to use Protractor from few days. But by.repeater function seems to show pass test for every ng-repeat element even though that binding name is wrong. here is the examples gives in protractor tutorial page http://angular.github.io/protractor/#/tutorial

 // spec.js describe('angularjs homepage', function() { var firstNumber = element(by.model('first')); var secondNumber = element(by.model('second')); var goButton = element(by.id('gobutton')); var latestResult = element(by.binding('latest')); 

var history = element.all(by.repeater('result in memory'));

 function add(a, b) { firstNumber.sendKeys(a); secondNumber.sendKeys(b); goButton.click(); } beforeEach(function() { browser.get('http://juliemr.github.io/protractor-demo/'); }); it('should have a history', function() { add(1, 2); add(3, 4); expect(history.count()).toEqual(2); add(5, 6); expect(history.count()).toEqual(3); // This is wrong! }); }); 

but even though I change the code it gives test pass

 // spec.js describe('angularjs homepage', function() { var firstNumber = element(by.model('first')); var secondNumber = element(by.model('second')); var goButton = element(by.id('gobutton')); var latestResult = element(by.binding('latest')); 

var history = element.all(by.repeater('result in me'));

 function add(a, b) { firstNumber.sendKeys(a); secondNumber.sendKeys(b); goButton.click(); } beforeEach(function() { browser.get('http://juliemr.github.io/protractor-demo/'); }); it('should have a history', function() { add(1, 2); add(3, 4); expect(history.count()).toEqual(2); add(5, 6); expect(history.count()).toEqual(3); // This is wrong! }); }); 

I don't know whether I am trying to use it

1 Answer 1

0

I found the answer. it is a bug in Protractor. The problem is Protractor check whether

result in me

is in (with indexOf command) a string with ng-repeat but not check whether it is equal to it.

So it pass the test cases with "result in me" , "result in memory" but not "result in memorys"

I think it has to be fixed

Sign up to request clarification or add additional context in comments.

1 Comment

If such is the case, then you can report the bugs on github(github.com/angular/protractor)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.