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:
element.all(by.repeater('unit in units')).then(function (arr) {
var items = [];
for (var i = 0; i < arr.length; i++) {
arr[i].getText().then(function(text) {
items.push(text);
});
}
//PROBLEM ITEMS is Empty
console.log(items);
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…