webdriverio
Version:
Next-gen browser and mobile automation test framework for Node.js
14 lines (13 loc) • 453 B
JavaScript
// src/scripts/checkVisibility.ts
function checkVisibility(elem, params) {
if (typeof elem.isConnected === "boolean" && !elem.isConnected || elem.ownerDocument && elem.ownerDocument !== document) {
throw new Error("stale element reference: element is not attached to the page document");
}
if (typeof elem.checkVisibility === "function") {
return elem.checkVisibility(params);
}
return null;
}
export {
checkVisibility as default
};