webdriverio-automation
Version:
WebdriverIO-Automation android ios project
21 lines (18 loc) • 590 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shadowFnFactory = void 0;
const shadowFnFactory = function (elementSelector, qsAll) {
const strFn = `
(function() {
// element has a shadowRoot property
if (this.shadowRoot) {
return this.shadowRoot.querySelector${qsAll ? 'All' : ''}('${elementSelector}')
}
// fall back to querying the element directly if not
return this.querySelector${qsAll ? 'All' : ''}('${elementSelector}')
})`;
return eval(strFn);
};
exports.shadowFnFactory = shadowFnFactory;
;