There are multiple elements with the same div. By clicking a button, these elements get number values. If the text in those elements reaches a certain pattern, I'm done and I should end the test.
For example, there are 5 elements with the div "someelement", these elements have numbers in them. If there are three numbers of 5 in those elements altogether, it should log out "you win" or something. if there are four numbers of 2 in those elements, it should log out "you win2". And it should loop through all of those options for validation. How to continue this into loop?
I found an easy solution for counting those values in elements, but how to continue the test until one of those expect conditions is reached?
var els = element.all(by.cssContainingText('.thediv', '5'));
expect(els.count()).toBe(3);
var els2 = element.all(by.cssContainingText('.thediv', '4'));
expect(els.count()).toBe(2);