So I am reading in a list of elements line by line. They are logged to console like this:
one
two
three
What I would like is my array hard coded with the text to compare line by line so the expect would look like:
one = one
two = two
three = three
roomsAsc = ['one', 'two', 'three'];
for (var i = 0; i < count; i++) {
//scrolls down the list element by element
browser.executeScript("arguments[0].scrollIntoView();", MyLists.get(i).getWebElement());
myLists.get(i).getText().then(function(text) {
//trying to get my array line be line like as java would
expect(text).toEqual(roomsAsc[i]);
//this says undefined in output
console.log(roomsAsc + 'array');
console.log(text);
});
}
//expect(myLists).toEqual(roomsAsc);
});
The code above scrolls until the list of all the elements are viewable. There are 28 in the list. I have them all printing to the console, however, only the non-viewable elements are being stored, the first 13 are blank in the array which is odd, so now I'm attempting to expects line by line.