1
我試圖實現通過by.repeater和與UI網端到端評估行屬性的搜索。量角器按行物業搜索使用by.repeater和評估
這個想法是將來自by.repeater的結果映射到一個新的對象,其中包含從評估和行獲得的底層對象ID,以便我可以在新的對象數組上使用id進行過濾。類似這樣的:
return this.getGrid(gridId).all(by.repeater('(rowRenderIndex, row) in rowContainer.renderedRows track by $index')).map(function(row, index){
return {
index: index,
row: row,
id: row.evaluate('row.entity.id')
};
}).then(function(maps){
return maps.find(function(e){
return e.id === rowId;
});
});
當我使用或返回行對象時,map函數似乎掛起。根據這https://github.com/angular/protractor/issues/392: Add map() function to element.all它應該工作,但它不。任何想法?
謝謝, David。