/** * action-engine.ts * * Translates locator expression strings into concrete Playwright interactions: * click, fill, and expect-visible. * * Throughout the codebase, locators are stored and passed around as expression * strings like "page.getByRole('button', { name: /Login/i })". Before these * strings can be used to actually interact with the browser, they need to be * parsed back into live Playwright Locator objects. That parsing is the core * responsibility of this class. * * The ActionEngine is used by the Executor when running TestIntent steps and * is also used during healing when a repaired locator is retried. * * Role in the overall flow: * Executor.executeStep() → ActionEngine.click() / .fill() / .expectVisible() */ import { Page, Locator } from 'playwright'; /** * Converts locator expression strings into live Playwright actions. * Supports the same locator strategies used by the skill layer: * getByRole, getByLabel, getByPlaceholder, getByText, getByTestId, locator(). */ export declare class ActionEngine { /** * Click the element matched by the given locator expression. * * @param page - The active Playwright page. * @param locatorExpr - A locator expression string, e.g. "page.getByRole('button', { name: /Login/i })". * @throws If no matching element is found or if the click fails. */ click(page: Page, locatorExpr: string): Promise; /** * Type a value into the element matched by the given locator expression. * * @param page - The active Playwright page. * @param locatorExpr - A locator expression string, e.g. "page.getByLabel(/Email/i)". * @param value - The text to type into the field. * @throws If no matching element is found or if the fill fails. */ fill(page: Page, locatorExpr: string, value: string): Promise; /** * Assert that the element matched by the locator expression is visible on the page. * * @param page - The active Playwright page. * @param locatorExpr - A locator expression string. * @throws If the element is not visible within the default Playwright timeout. */ expectVisible(page: Page, locatorExpr: string): Promise; /** * Parse a locator expression string and return the corresponding Playwright Locator. * * Supported patterns (the "page." prefix is optional): * - getByRole('role', { name: /regex/i }) * - getByLabel(/regex/i) * - getByPlaceholder(/regex/i) * - getByText(/regex/i) * - getByTestId('id') * - locator('css-selector') * * @param page - The Playwright page to build the locator on. * @param expr - The locator expression string to parse. * @returns A live Playwright Locator. * @throws Error if the expression format is not recognised. */ resolve(page: Page, expr: string): Locator; } //# sourceMappingURL=action-engine.d.ts.map