import type { Page } from '@playwright/test'; import { retryOnConnectionLost } from './retry-on-connection-lost.mts'; import { installTurnstileStub } from './turnstile-stub.mts'; /** * Navigate to a URL and wait for network idle (or a custom wait state). * Always use this instead of raw page.goto() to avoid flaky tests * caused by interacting with pages before they've fully loaded. * * Installs the Turnstile stub once per page (see turnstile-stub.mts) so the * widget script does not keep third-party traffic alive past the navigation * timeout. Pass `dependencies.installTurnstileStub` to replace that install. * * Retries transient connection errors (ERR_CONNECTION_REFUSED / RESET) using * bounded retries and 5s backoff to absorb cold starts. * * Pass `waitUntil: 'load'` for pages with a connection that stays open and * never reaches networkidle. * * Safe for URLs that redirect on the client — the readiness wait restarts against * whichever document the redirect lands on (see wait-for-hydration.mts). */ export declare function navigateTo(page: Page, url: string, { waitUntil }?: { waitUntil?: "load" | "networkidle" | undefined; }, dependencies?: Partial<{ installTurnstileStub: typeof installTurnstileStub; retryOnConnectionLost: typeof retryOnConnectionLost; }>): Promise;