Ir al contenido

playwrightProxy

Esta página aún no está disponible en tu idioma.

const playwrightProxy: object

Defined in: playwright/index.ts:390

before(page, testInfo, mode, options?): Promise<void>

Setup before test - sets the proxy mode and configures page with custom header Automatically sets up page.on(‘close’) handler for cleanup

Page

Playwright page object

PlaywrightTestInfo

Playwright test info object

Mode

The proxy mode to use for this test

number | ClientSideRecordingOptions & object

Optional configuration including timeout and client-side recording patterns

Promise<void>

teardown(): Promise<void>

Global teardown — switches the proxy to transparent mode and redacts the .har files Playwright wrote during the run.

HAR redaction happens here, not per-test, on purpose: Playwright flushes a HAR when its context closes but does not await context.on('close') listeners, so redacting there races the process exit and can truncate the file. globalTeardown runs once, after every context has flushed, and IS awaited — so it’s the only reliable place to scrub HARs.

Promise<void>