playwright-pom-materials
Version:
Playwright POM materials
31 lines (30 loc) • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isLocator = exports.isPage = exports.isFrame = void 0;
const isFrame = (x) => {
if (typeof x !== 'object' || x === null)
return false;
const o = x; // eslint-disable-line @typescript-eslint/no-explicit-any
return (typeof o.childFrames === 'function' &&
typeof o.parentFrame === 'function' &&
typeof o.waitForTimeout === 'function');
};
exports.isFrame = isFrame;
const isPage = (x) => {
if (typeof x !== 'object' || x === null)
return false;
const o = x; // eslint-disable-line @typescript-eslint/no-explicit-any
return (typeof o.frames === 'function' &&
typeof o.mainFrame === 'function' &&
typeof o.waitForTimeout === 'function');
};
exports.isPage = isPage;
const isLocator = (x) => {
if (typeof x !== 'object' || x === null)
return false;
const o = x; // eslint-disable-line @typescript-eslint/no-explicit-any
return (typeof o.filter === 'function' &&
typeof o.page === 'function' &&
typeof o.waitFor === 'function');
};
exports.isLocator = isLocator;