This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Add map() function to element.all #392
Closed
Description
Some of my tests have to collect the values of multiple elements inside a parent element.
For example, I want to know the labels inside a menu:
Menu
one
two
three
It would be nice to have a map function in element.all
:
element.all(by.css('.menu .item')).map(function(item) {
return item.getText();
}).then(function(labels) {
expect(labels).toEqual(['one', 'two', 'three']);
});
Map would iterate through each element found with the locator. Then map would resolve all the promises and return a promise with an array of values.