glance-webdriver
Version:
Automation at a glance
22 lines (17 loc) • 540 B
JavaScript
let nextClosestSibling = {
"next-closest-sibling": {
browser: true,
filter: function(elements, config) {
var scope = config.scope;
if (!scope) return [];
var sibling = scope.nextElementSibling;
while (sibling) {
if (elements.filter(e => e == sibling).length > 0)
return [sibling];
sibling = sibling.nextElementSibling;
}
return [];
}
}
};
export {nextClosestSibling};