Skip to main content

Playwright Interceptor

The Playwright interceptor is used to mock page requests with the same syntax as for server requests. It works only with the Playwright test runner. Use it for client-side interception of in-browser requests:

import { setupPlaywrightInterceptor } from 'request-mocking-protocol/playwright';

await setupPlaywrightInterceptor(page, mockClient);

See Playwright — Setup a custom fixture for an example of usage.