playwright-fluent
Version:
Fluent API around playwright
18 lines (17 loc) • 576 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getParentsOf = void 0;
async function getParentsOf(handles) {
const result = [];
for (let index = 0; index < handles.length; index++) {
const element = handles[index];
const jsHandle = await element.evaluateHandle((node) => node.parentElement);
const parentElement = jsHandle.asElement();
if (parentElement === null) {
continue;
}
result.push(parentElement);
}
return result;
}
exports.getParentsOf = getParentsOf;
;