/** * Wait Strategies * * P1 - Advanced wait conditions for E2E tests * * Supports: * - Network idle (no active network requests) * - Element stable (position/size not changing) * - DOM content loaded * - Custom condition polling * - Multiple wait strategies with timeout * * @see https://playwright.dev/docs/actionability */ export interface WaitConfig { /** Timeout in milliseconds */ timeout?: number; /** Poll interval in milliseconds */ interval?: number; } export interface NetworkIdleConfig extends WaitConfig { /** Minimum idle time (ms) before considering network idle */ idleTime?: number; /** Ignore certain URLs */ ignoreUrls?: (string | RegExp)[]; } export interface StabilityConfig extends WaitConfig { /** Minimum stable time (ms) */ stableTime?: number; /** Check tolerance for position/size changes (pixels) */ tolerance?: number; } export interface WaitResult { success: boolean; duration?: number; error?: string; } /** * Wait Strategies class */ export declare class WaitStrategies { private defaultTimeout; private defaultInterval; constructor(config?: WaitConfig); /** * Wait for network to be idle */ waitForNetworkIdle(page: any, config?: NetworkIdleConfig): Promise; /** * Wait for element to be stable (position/size not changing) */ waitForStable(page: any, selector: string, config?: StabilityConfig): Promise; /** * Wait for DOM content to be loaded */ waitForDOMContent(page: any, config?: WaitConfig): Promise; /** * Wait for network to be mostly idle (allows some background requests) */ waitForNetworkMostlyIdle(page: any, config?: NetworkIdleConfig): Promise; /** * Wait for element to be visible and stable */ waitForVisibleAndStable(page: any, selector: string, config?: StabilityConfig): Promise; /** * Wait for custom condition */ waitForCondition(page: any, condition: () => boolean | Promise, config?: WaitConfig): Promise; /** * Wait for any element in a list to be visible */ waitForAnyElement(page: any, selectors: string[], config?: WaitConfig): Promise; /** * Wait for text to appear in element */ waitForText(page: any, selector: string, text: string | RegExp, config?: WaitConfig): Promise; /** * Wait for element count to match expected */ waitForElementCount(page: any, selector: string, count: number, config?: WaitConfig): Promise; /** * Wait for URL to match pattern */ waitForURL(page: any, pattern: string | RegExp, config?: WaitConfig): Promise; /** * Wait for console message matching pattern */ waitForConsoleMessage(page: any, pattern: string | RegExp, config?: WaitConfig & { type?: 'log' | 'error' | 'warning' | 'info'; }): Promise; /** * Wait for page title */ waitForTitle(page: any, title: string | RegExp, config?: WaitConfig): Promise; /** * Wait for multiple conditions (all must be true) */ waitForAll(page: any, conditions: Array<() => boolean | Promise>, config?: WaitConfig): Promise; /** * Wait for multiple conditions (any can be true) */ waitForAny(page: any, conditions: Array<() => boolean | Promise>, config?: WaitConfig): Promise; } /** * Factory function to create Wait Strategies */ export declare function createWaitStrategies(config?: WaitConfig): WaitStrategies; export default WaitStrategies;