UNPKG

playwright-fluent

Version:
17 lines (16 loc) 673 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getHandlesWithPlaceholder = void 0; const get_attribute_of_handle_1 = require("../get-attribute-of-handle"); async function getHandlesWithPlaceholder(text, handles) { const result = []; for (let index = 0; index < handles.length; index++) { const handle = handles[index]; const placeholder = await (0, get_attribute_of_handle_1.getAttributeOfHandle)('placeholder', handle); if (placeholder && placeholder.includes(text)) { result.push(handle); } } return result; } exports.getHandlesWithPlaceholder = getHandlesWithPlaceholder;