playwright-fluent
Version:
Fluent API around playwright
19 lines (18 loc) • 848 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.switchFromSelectorToIframe = void 0;
const handle_actions_1 = require("../../handle-actions");
const get_handle_of_1 = require("../get-handle-of");
const utils_1 = require("../../../utils");
async function switchFromSelectorToIframe(selector, pageOrFrame, options) {
if (!pageOrFrame) {
throw new Error(`Cannot switch to iframe from '${selector}' because no browser has been launched`);
}
const waitOptions = {
...utils_1.defaultWaitUntilOptions,
...options,
};
const handle = await (0, get_handle_of_1.getHandleOf)(selector, pageOrFrame, waitOptions);
return (0, handle_actions_1.switchFromHandleToIframe)(handle, selector, pageOrFrame, options);
}
exports.switchFromSelectorToIframe = switchFromSelectorToIframe;
;