UNPKG

playwright-fluent

Version:
17 lines (16 loc) 887 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.invokeMethodOnSelectorObject = void 0; const utils_1 = require("../../../utils"); const handle_actions_1 = require("../../handle-actions"); async function invokeMethodOnSelectorObject(methodName, selector, options) { (0, utils_1.report)('waiting for the selector to appear in DOM ...', options.verbose); await (0, utils_1.waitUntil)(() => selector.exists(), `Cannot invoke method '${methodName}' on '${selector.toString()}' because this selector was not found in DOM`, { ...options, throwOnTimeout: true, wrapPredicateExecutionInsideTryCatch: true, }); const handle = await selector.getHandle(); await (0, handle_actions_1.invokeMethodOnHandle)(methodName, handle, selector.toString()); } exports.invokeMethodOnSelectorObject = invokeMethodOnSelectorObject;