playwright-fluent
Version:
Fluent API around playwright
17 lines (16 loc) • 831 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSelectorDisabled = void 0;
const get_handle_of_1 = require("../get-handle-of");
const handle_actions_1 = require("../../handle-actions");
async function isSelectorDisabled(selector, page, options) {
if (!page) {
throw new Error(`Cannot get disabled status of '${selector}' because no browser has been launched`);
}
const handle = await (0, get_handle_of_1.getHandleOf)(selector, page, options);
const isDisabled = await (0, handle_actions_1.isHandleDisabled)(handle, { verbose: options.verbose });
const isReadOnly = await (0, handle_actions_1.isHandleReadOnly)(handle, { verbose: options.verbose });
const result = isDisabled || isReadOnly;
return result;
}
exports.isSelectorDisabled = isSelectorDisabled;
;