Skip to content

FE-M0-24 · The specs on the local stack, then merge pack E

ID FE-M0-24 · Level L0 · Run order row 29 · Why D19, D37 · Issue #19

pnpm --filter web e2e passes on your Mac against the local stack, twice in a row: 27 tests, the six app shell rules, the landing page and the menu for each of the 11 roles, and an access change that sends the next request to /login. Then pack E is merged, and TL-M0-19 (#20) can run.

  • FE-M0-23 is Done, on web/playwright.
  • Docker Desktop is running, the local stack is running (pnpm supabase start), and apps/web/.env.local points at it (FE-M0-06).
  • Nothing runs on port 3100: Playwright starts the built app there.
  • echo $NEXT_PUBLIC_DESIGN_PREVIEW prints an empty line. The preview is compiled into the build, and R-APP-06 proves it is off.

1 · The local database from main's migrations, and the E2E logins

Section titled “1 · The local database from main's migrations, and the E2E logins”
Terminal window
pnpm supabase db reset
pnpm db:e2e-users
Terminal window
pnpm --filter web build

3 · Chromium for Playwright, once per Mac

Section titled “3 · Chromium for Playwright, once per Mac”
Terminal window
pnpm --filter web exec playwright install chromium

Playwright starts the built app on port 3100, signs each E2E login in, and stops the app at the end.

Terminal window
pnpm --filter web e2e

5 · The specs again, on the same database

Section titled “5 · The specs again, on the same database”

The session spec gives the viewer an override and removes it, so a second run finds the database as the first one did.

Terminal window
pnpm --filter web e2e
Terminal window
git push -u origin web/playwright
gh pr create --title "test(web): playwright smoke specs and the per-role menu check (d19)" --body "FE pack E (FE-M0-23 and FE-M0-24), timeline row 29. Refs #19. Rules built: R-APP-01 to R-APP-06. Also cites R-ACC-48 (D37)."
gh pr checks --watch
gh pr merge --squash --delete-branch
git switch main
git pull
  • Block 1: “Finished supabase db reset”, then “11 logins in the E2E organization, all pools. .env.e2e updated (password not shown).”
  • Block 2: the build lists ƒ /, ƒ /[...slug], ƒ /design-preview, ƒ /login and ƒ /no-access, then “ƒ Proxy (Middleware)”.
  • Block 3: Chromium downloads, or nothing when it is already there.
  • Block 4: “Running 27 tests using 1 worker”, then 27 lines with ✓: R-APP-01, R-APP-02, R-APP-03 and R-APP-06; R-APP-04 and R-APP-05 for each of the 11 roles (finance lands on /collection, background_check on /screening, satpam on /gate, the rest on /dashboard); and R-ACC-48. It ends with “27 passed”, in about a minute.
  • Block 5: the same, “27 passed”.
  • Block 6: checks, changes, database and pr-title pass (database runs because pnpm-lock.yaml changed; CI has no e2e job until TL-M0-19), then “✓ Squashed and merged pull request #…”.
Terminal window
git log --oneline -1
ls apps/web/playwright-report/index.html
git status --short

Expect: “test(web): playwright smoke specs and the per-role menu check (d19) (#…)”; the report from the last run; and nothing from git status, because the report and test-results are ignored.

  • A spec fails: run pnpm --filter web exec playwright show-report and open the failing test. Paste its name, its error and the last screenshot's page address into #19, and stop before block 6. FE fixes it in a new zip.
  • Every spec fails with “E2E_PASSWORD is not set”: .env.e2e is missing at the repository root. Run block 1's second line.
  • The run stops with “http://localhost:3100 is already used”: something else holds port 3100. Stop it, or stop a dev server left running, and run block 4 again.
  • R-APP-06 fails with 200 instead of 404: the build was made with NEXT_PUBLIC_DESIGN_PREVIEW=1. Run unset NEXT_PUBLIC_DESIGN_PREVIEW, then blocks 2 and 4.
  • R-ACC-48 fails at “the super_admin's access change”: the database refused the override. Paste the error's lines. It names the code: 42501 means the E2E super_admin can't manage users at pool E2A, which is the seed's and the logins script's to answer (BE).
  • R-ACC-48 fails at toHaveURL(/\/login\?signed_out=access$/): the reload opened the page, so a stale session got through. Stop and paste the error; that is a D37 bug, not a flaky test.
  • Block 5 fails where block 4 passed: a test left something behind. Paste the error; pnpm supabase db reset and pnpm db:e2e-users give a clean database again.
Terminal window
gh pr close --delete-branch
git switch main
git branch -D web/playwright

Before merging. After merging: revert it with a new pull request. pnpm supabase db reset and pnpm db:e2e-users give the local database back; nothing in this step touches staging or production.

Not run yet. Log each run as a comment on #19. #19 closes when a clean run of FE-M0-23 and FE-M0-24 is logged; then TL-M0-19 (#20) can run.