feat(test): M5.3 — Playwright e2e harness for the dev stack #8
Reference in New Issue
Block a user
Delete Branch "feat/m5.3-playwright"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
M5.3 Playwright e2e harness, scoped to the local dev stack. The CI e2e job is gated behind a
RUN_E2Erepo variable so it stays off until stage exists.playwright.config.ts— chromium project; baseURL defaults tohttp://acme.localhost:3000.tests/e2e/apex.spec.ts— landing page renders.tests/e2e/tenant.spec.ts— signed-out dashboard shows the Sign-in button; unknown slug returns 404.tests/e2e/health.spec.ts— every dev-stack endpoint reachable (portal Auth.js, tenant-registry/healthz, KC realm metadata).Why
After M5.2 the portal has 10 surfaces. A harness now catches the obvious regressions (auth broken, KC misconfigured, tenant-registry down) before they reach stage. Doesn't replace unit tests — fills the integration-shape gap.
Linked milestone: M5.3
How
@needs-stacktag in titles). We don't run them headless against a fully wrapped fixture because Keycloak click-throughs in headless mode are flaky enough that they generate more red herrings than real signal.vars.RUN_E2Emust equal'true'on the repo for it to fire.make e2eworks locally regardless.Test plan
pnpm lintcleanpnpm typecheckclean (tsconfig excludestests/e2eso Playwright + tsc don't fight)pnpm test(vitest) — unaffected, 24 cases still green, 100%src/libcoveragepnpm build— unchangedmake e2eend-to-end against the live dev stack — to be run locally; the testing-session for this is what comes next on Sharang's endRisk
Blast radius: none until
RUN_E2E=trueis set. The test suite is local-only by default.What could break:
pnpm typecheck.http://acme.localhost:3000requires that *.localhost resolves to 127.0.0.1 — true on macOS and most modern Linux out of the box. If a tester is on a network that does weird things to .localhost, overridePLAYWRIGHT_BASE_URL=http://localhost:3000and Next's middleware will still handle the slug via the path (modulo subdomain rewrite assertions).Rollback plan: revert. CI is unaffected by the revert since the e2e job is gated off.
Checklist
Adds the M5.3 deliverable scoped to local-dev (stage doesn't exist yet, so the CI e2e job is gated behind the repo variable RUN_E2E='true' — defaults off). Layout: playwright.config.ts chromium project; baseURL defaults to http://acme.localhost:3000 (subdomain routing fires). PLAYWRIGHT_BASE_URL / APEX_URL / etc. env vars override for stage. tests/e2e/apex.spec.ts landing page renders tests/e2e/tenant.spec.ts signed-out dashboard shows Sign in button; unknown slug returns 404 tests/e2e/health.spec.ts every dev-stack endpoint reachable (portal /api/auth/providers, tenant- registry /healthz, KC realm metadata) Run locally with the full dev stack up: cd platform/orca-platform && make dev-up cd platform/tenant-registry && make dev cd platform/portal && make dev cd platform/portal && make e2e OIDC click-through not asserted yet — Keycloak in headless mode is flaky and depends on a stable test-user password. The current gate (Sign-in button visible) catches the more common 'auth completely broken' regression; the deeper smoke lands when stage has its own test fixture. tsconfig now excludes tests/e2e so vitest + tsc don't fight over Playwright type imports. Refs: M5.3