/** * Budget for the `context.close()` we issue after the test body. Closing is * normally fast, but on a hard test timeout the page is often unresponsive and * an unbounded close would consume this fixture's teardown budget. We bound it * and move on; Playwright's built-in `context` teardown runs afterwards and * awaits the real close within its own budget, so native video/trace * persistence is never gated behind our close. */ export declare const CONTEXT_CLOSE_TIMEOUT_MS = 10000; /** * Dedicated per-fixture teardown budget for the `context` override (see the tuple * passed to `base.extend` below). Without it, this override's teardown draws from * the single teardown budget shared with Playwright's built-in `context` teardown — * so a slow close could starve native video/trace persistence. Giving the override * its own budget decouples the two. It comfortably exceeds the bounded close; the * unit test asserts that invariant. */ export declare const HAR_CONTEXT_FIXTURE_TIMEOUT_MS = 25000; /** Minimal structural view of the browser context teardown needs. */ interface ClosableContext { close(): Promise; } /** * Closes the context (bounded, best-effort). * * Extracted from the fixture so the teardown bounding can be unit tested without a * browser. The bounded close guarantees we return control even if the page is hung, * so Playwright's native context teardown (which persists video/trace) is never * starved. The HAR is **not** handled here — `LogsReporter.onTestEnd` reads the raw * HAR from `harRecordingPath` after all teardown, which is the only point that * reliably runs after a late close flushes the HAR on the hard-timeout path. */ export declare const closeContextWithinBudget: (context: ClosableContext, options?: { closeTimeoutMs?: number; }) => Promise; /** * Records a per-test HAR without leaking it into stored artifacts. * * `recordHar` (configured via `contextOptions`) only flushes the HAR to disk when * the browser context closes. We record it to a temp path outside `outputDir` * (see `harRecordingPath`) so a close that flushes late — e.g. during native * teardown on a hard timeout — can never leak an unredacted HAR into uploaded * artifacts. `LogsReporter.onTestEnd` is the single owner of that file: it runs * after all teardown, redacts + retains it on failure, and always deletes the raw * source. Persisting the HAR there (rather than via `testInfo.attach` during this * fixture's teardown) is what makes a hard-timeout HAR survive — the attach seam * ran before the late close flushed the file and lost it. * * The `context` override exists only to bound the close so a hung page can't starve * native video/trace persistence; it carries its own `timeout` * (`HAR_CONTEXT_FIXTURE_TIMEOUT_MS`) so its teardown draws from a dedicated budget * rather than the one shared with the built-in `context` teardown. */ export declare const test: import("@playwright/test").TestType; export {};