Reputation: 3950
Writing e2e tests for an Angular App, but I don't seem to be able to get my head around async programming and promises. I'm attempting to get the value from each row, from the first column and add that to an array to eventually sort it from high to low to have the highest value. I'm having some trouble resolving the promise of my rows.each, the errormsg is: 'TypeError: undefined is not a function'
//This function will fetch the highest ID from the columns
this.getHighestScheduleId = (function(){
//Array to collect the ID's in
var idArray = [];
//Collects all the rows in our table
var rows = $$('#schedulesData');
//Goes through each row
rows.each(function(row){
//Collect all the row's elements in rowElems
var rowElems = row.$$('td');
console.log(rowElems[0].getText());
});
});
Upvotes: 1
Views: 690