End-to-end test suite using Playwright. It contains feature specs for auth, clients, templates, settings, and session notes, along with page controllers, org/seed/DB fixtures, and Supabase local test wiring. This package is test-only and is not consumed by any app at runtime.
graph TD
e2e_web["@repo/e2e-web"]
auth["@repo/auth"]
db["@repo/db"]
errors["@repo/errors"]
logger["@repo/logger"]
safe["@repo/safe"]
typescript_config["@repo/typescript-config"]
e2e_web -.-> auth
e2e_web -.-> db
e2e_web -.-> errors
e2e_web -.-> logger
e2e_web -.-> safe
e2e_web -.-> typescript_configFrom the repo root:
# Start the E2E Supabase instance
pnpm --filter @repo/e2e-web test:supabase-start
# Run all Playwright tests
START_WEB_SERVER=true pnpm --filter @repo/e2e-web test:e2e
# Run with Playwright UI
pnpm --filter @repo/e2e-web test:e2e:ui
Import test and expect from e2e-tests (src/fixtures/e2e.tests.ts). Every spec gets:
| Fixture | Scope | What it gives you |
|---|---|---|
org |
worker | An isolated organization with one logged-in user per role (admin, org_supervisor, supervisor, individual). Workers never share data, so specs run fully parallel with no mode: "serial". |
authenticatedAs |
option | Which role the default page is logged in as (default admin). test.use({ authenticatedAs: null }) for logged-out specs such as login. |
currentUser |
test | Credentials and profile of the logged-in user. |
seed |
test | Creates patients, session notes, templates, teams and contact types through the real repos, scoped to the worker's org, and deletes them when the test ends. |
db + *Repo |
test | Raw Kysely access and the @repo/db repos for assertions. |
| console guard | auto | Fails the test on any console.error or uncaught page error not in src/lib/consoleErrorAllowlist.ts. Set E2E_CONSOLE_ERRORS=warn to attach instead of fail while triaging. |
Page controllers live in src/fixtures/controllers/ and hold no assertions.
Auth emails (password reset codes) land in the local Supabase mail sink; src/lib/mailbox.ts reads them through the Mailpit API at MAILPIT_URL.
Tests tagged { tag: "@smoke" } run on every pull request (--grep @smoke, HTML report artifact only). The full suite runs on every push to main and records to Currents. To run the full suite on a pull request, add the run-e2e:full label: it runs immediately and again on every later push to that PR, draft or not, and records to Currents like a main run. Tag a test @smoke only when it is fast, broad and stable: one login, one list page, one detail page.
| Script | Description |
|---|---|
test:e2e |
Run Playwright tests |
test:e2e:ui |
Run Playwright tests with UI |
test:e2e:full |
Dump schema, start Supabase, run E2E with web server, stop Supabase |
test:supabase-start |
Start local Supabase for tests |
test:supabase-stop |
Stop local Supabase |
test:dump-schema |
Copy DB public schema SQL into this package for Supabase |
check-types |
Typecheck with tsc --noEmit |