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 coordinator connection. The session API (insert, awaitSyncOrFail, assertSample, sessionId) is the same as Vitest’s.

Endpoint

Set the coordinator endpoint explicitly — via VARIANZ_COORDINATOR_ENDPOINT in the test environment. The fixture passes no endpoint of its own, and its fallback is http://127.0.0.1:18051 rather than the usual 50051, so an unset value silently points at the wrong port:
It shares @varianz/client’s resolution chain with the Vitest fixture, so the deprecated VARIANZ_TEST_ENDPOINT, VARIANZ_COORDINATOR_ADDR and VARIANZ_ENDPOINT spellings still work, each with a one-time warning. See deprecated spellings.

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.