/** * selector-engine.ts * * Provides live page scanning strategies used during self-healing: * searching for a working element by matching the step description against * ARIA roles, visible text, placeholder text, and accessibility labels. * * Unlike the static locator generation done at test-creation time, the * SelectorEngine operates against the live DOM at the moment a step fails. * It is called by HealingEngine as strategies 2 (semantic-text) and 3 (accessibility). * * Role in the overall flow: * HealingEngine.heal() → SelectorEngine.findSemanticMatch() * → SelectorEngine.findByAccessibility() */ import { Page } from 'playwright'; /** * Scans a live page to find an element that semantically matches a step description, * returning a ready-to-use locator expression string if found. */ export declare class SelectorEngine { /** * Search the page for an element whose ARIA role + name, visible text, or * placeholder text matches the given step description. * * Tries roles in this order: button, link, textbox, checkbox, radio, combobox. * Falls back to text match, then placeholder match. * * @param page - The live Playwright page to search. * @param description - The natural-language step description to match against * (e.g. "click the login button"). * @returns A locator expression string if a match is found, or null if no * element matches the description. */ findSemanticMatch(page: Page, description: string): Promise; /** * Search the page for an element whose aria-label matches the given description. * * @param page - The live Playwright page to search. * @param description - The step description to match against aria-label attributes. * @returns A locator expression string using getByLabel if a match is found, or null. */ findByAccessibility(page: Page, description: string): Promise; } //# sourceMappingURL=selector-engine.d.ts.map