UNPKG

playwright-fluent

Version:
15 lines (14 loc) 656 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasSelectorFocus = void 0; const get_handle_of_1 = require("../get-handle-of"); const has_handle_focus_1 = require("../../handle-actions/has-handle-focus"); async function hasSelectorFocus(selector, page, options) { if (!page) { throw new Error(`Cannot get the focus state of '${selector}' because no browser has been launched`); } const handle = await (0, get_handle_of_1.getHandleOf)(selector, page, options); const result = await (0, has_handle_focus_1.hasHandleFocus)(handle); return result; } exports.hasSelectorFocus = hasSelectorFocus;