I'm struggling with this:
- Click a button to get a set of data
- Check the number of rows returned is what I'm expecting
- I need to run this 10 times, each time, I'm expecting a different number of rows
The code snippet below doesn't work because 'i' isn't what I'm expecting. How can I make this work?
for (var i = 0; i < subElements.length; ++i) {
element(by.id('get-data')).click();
// Check users returned
element.all(by.id('users')).map(function (elm) {
return elm;
}).then(function (users) {
expect(users.length).toBe(expectedRecords[i]);
// Some more checks to be added later
});
}