I got an array of promises from this code: element.all(by.repeater(\'unit in units\'))
, and I am finding it really difficult to get the data into another array:
Fixed using Q
var Q = require('q');
element.all(by.repeater('unit in units')).then(function (arr) {
var promises = [];
for (var i = 0; i < arr.length; i++) {
promises.push(arr[i].getText());
}
Q.all(promises).done(function (result) {
// print the results when the lookups and processing are done
console.log(result.length);
console.log(result);
});
});