/** * page-observer.ts * * Provides utility methods for reading information from a live Playwright page * without interacting with it — no clicks, no fills, just observation. * * These helpers are used in two main scenarios: * 1. Before DOM analysis — wait for network activity to settle so the page * is in a stable state before element extraction begins. * 2. After a step failure — capture the full HTML snapshot and visible text * so the healing engine and AI prompt have accurate page context. * * Role in the overall flow: * analyze_page → PageObserver.waitForStable() → DOMAnalyzer.analyze() * FailureHandler → PageObserver.getOuterHTML() → HealingEngine / healTest */ import { Page } from 'playwright'; /** * Reads page state (network readiness, HTML, text, URL) without interacting * with any elements. */ export declare class PageObserver { /** * Wait for the page's network activity to become idle (no ongoing requests). * This helps ensure all dynamic content has loaded before analysis begins. * * The wait is best-effort — if the page never reaches a fully idle state within * the timeout (e.g. long-polling requests), the method logs a warning and * continues rather than throwing. * * @param page - The Playwright page to observe. * @param timeout - Maximum milliseconds to wait for network idle. Defaults to 3000. */ waitForStable(page: Page, timeout?: number): Promise; /** * Return the full outer HTML of the page's root element as a string. * This is used to capture a DOM snapshot for healing prompts. * * @param page - The Playwright page to read. * @returns The complete HTML of the page as a string. */ getOuterHTML(page: Page): Promise; /** * Return the visible text content of the page body. * Useful for quick content checks without parsing HTML. * * @param page - The Playwright page to read. * @returns The plain text visible on the page (innerText of document.body). */ getVisibleText(page: Page): Promise; /** * Return the current URL of the page. * * @param page - The Playwright page to read. * @returns The current page URL as a string. */ getCurrentUrl(page: Page): Promise; } //# sourceMappingURL=page-observer.d.ts.map