e2e: test-infra hardening (per-test DB reset + logged-in storageState fixture) #326

Closed
opened 2026-06-28 19:36:07 +00:00 by james · 0 comments
Owner

Refs #150

The smoke foundation (#150) boots one fresh in-memory SQLite per run and registers a fresh uniqueEmail() admin inline. That is fine for a single ordered smoke flow but doesn't scale to many specs.

Harden the harness:

  • Per-test (or per-file) DB reset so specs are independent and order-free — e.g. a test-only reset endpoint gated to non-production, or a fresh DB/process per worker.
  • A logged-in storageState fixture: register/log in once in global setup, persist the authenticated storage state, and have authenticated specs reuse it instead of re-registering. Cuts redundant auth flows and speeds the suite.
  • Playwright fixtures/projects wiring so a spec declares "I need an authenticated session" and gets one.
  • Admin e2e spec + a second app boot under REGISTRATION_POLICY=admin-approval/invite (a separate Playwright project + serve script). Deferred here from #325: invite-only registration and the admin-approval pending flow are gated by the process-wide REGISTRATION_POLICY env var set at boot, so they need a second policy-configured app boot to exercise. The admin spec lands with that infra.
Refs #150 The smoke foundation (#150) boots one fresh in-memory SQLite per run and registers a fresh `uniqueEmail()` admin inline. That is fine for a single ordered smoke flow but doesn't scale to many specs. Harden the harness: - Per-test (or per-file) DB reset so specs are independent and order-free — e.g. a test-only reset endpoint gated to non-production, or a fresh DB/process per worker. - A logged-in `storageState` fixture: register/log in once in global setup, persist the authenticated storage state, and have authenticated specs reuse it instead of re-registering. Cuts redundant auth flows and speeds the suite. - Playwright fixtures/projects wiring so a spec declares "I need an authenticated session" and gets one. - **Admin e2e spec + a second app boot under `REGISTRATION_POLICY=admin-approval`/`invite`** (a separate Playwright project + serve script). Deferred here from #325: invite-only registration and the admin-approval pending flow are gated by the process-wide `REGISTRATION_POLICY` env var set at boot, so they need a second policy-configured app boot to exercise. The admin spec lands with that infra.
james closed this issue 2026-06-29 16:45:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#326
No description provided.