Skip to content

Instantly share code, notes, and snippets.

@laurentperroteau
Last active January 18, 2017 10:27
Show Gist options
  • Save laurentperroteau/5c05302fbb88eb6c2a475971764726d1 to your computer and use it in GitHub Desktop.
Save laurentperroteau/5c05302fbb88eb6c2a475971764726d1 to your computer and use it in GitHub Desktop.
Protractor exemple
/**
* Get 2 level of selector using ".each"
*/
return element
.all(
by.css('.selector')
) // return array of element
.each(function(parentElement, rowIndex) {
return parentElement
.all(
by.css('.sub-selector')
)
// ...
return element
.all(
by.css('selector')
)
.each(function(elem, index) {
// ...
}).then(function () {
return element(by.css('selector')).click().then(function () {
return element(by.css('selector')).click();
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment