UNPKG

playwright-fluent

Version:
15 lines (14 loc) 793 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasSelectorAttribute = void 0; const get_handle_of_1 = require("../get-handle-of"); const handle_actions_1 = require("../../handle-actions"); async function hasSelectorAttribute(selector, attributeName, expectedAttributeValue, page, options) { if (!page) { throw new Error(`Cannot check that '${selector}' has attribute '${attributeName}' with value '${expectedAttributeValue}' because no browser has been launched`); } const handle = await (0, get_handle_of_1.getHandleOf)(selector, page, options); const result = await (0, handle_actions_1.hasHandleAttribute)(handle, attributeName, expectedAttributeValue); return result; } exports.hasSelectorAttribute = hasSelectorAttribute;