Skip to main content
@varianz/playwright drives a real browser against an instrumented backend: the fixture creates a session per test and automatically sets the x-varianz-id header on the page, so every request the browser makes carries your session — while you override and probe VPoints anywhere in the backend graph. Install it (instructions) and import test from the package instead of @playwright/test:
The varianz fixture is test-scoped; a worker-scoped VarianzClient handles the registry connection. The session API (insert, awaitSyncOrFail, assertSample, sessionId) is the same as Vitest’s.

Endpoint

Set the registry endpoint explicitly — via VARIANZ_ENDPOINT in the test environment:

What Playwright tests can and can’t reach

The browser only talks to your frontend, but the session header propagates from the frontend through the backend graph — so stages on any downstream VPoint (payments, email, fraud) apply to the browser’s requests. The backend services can be written in any supported language; the frontend itself only needs to forward the header.