Skip to content

e2e: Playwright browser tests against the fixture instance - #7

Merged
meltforce merged 1 commit into
mainfrom
claude/playwright-e2e
Nov 13, 2026
Merged

meltforce merged 1 commit into
mainfrom
claude/playwright-e2e

Conversation

@meltforce

Copy link
Copy Markdown
Owner

Adds Playwright browser tests in e2e/, as the pipeline's repo contract prescribes. UI changes can now be proven with a checked-in test (REVIEW.md rule 1); until now web/ had only vitest over pure helpers (decision of 2026-08-07 in archive/DECISIONS.md, which left a browser to a separate decision — this PR is that decision). The app is unchanged.

Acceptance criteria

  1. scripts/e2e runs the Playwright tests in e2e/ after the HTTP checks: against the new image in the upgrade test, and against E2E_BASE_URL when that is set.
  2. The tests cover the fixture library (videos only), opening a video's summary, keyword search, the Inbox, Channels, Stats and Settings pages, and the absent sign-out button without application login (web: sign-out button in the nav #5, criterion 2). An uncaught page exception fails any test.
  3. A failed run leaves traces and screenshots in e2e/test-results/; CI uploads them as an artifact.
  4. scripts/setup installs e2e/'s dependencies and Chromium; a failed browser install is logged and does not fail the setup. Browsers go to Playwright's default cache, independent of a preset PLAYWRIGHT_BROWSERS_PATH / PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD (cloud session).

Test per criterion

  1. scripts/e2e locally (output below); the CI e2e job of this PR.
  2. e2e/tests/library.spec.ts (8 tests), e2e/tests/fixtures.ts (pageErrors, auto fixture).
  3. A run against an unreachable instance (below); the upload step in ci.yml runs only on failure, so this PR's green run does not exercise it.
  4. scripts/setup locally (exit 0); playwright() in scripts/lib/common.sh unsets both variables. Not run in a cloud session yet.

Test output

$ scripts/e2e
...
==> 2. new image
ok   /version on the published port reports d49fbece95ab
ok   / serves the frontend
==> browser tests (e2e/)
Running 8 tests using 1 worker
  ✓  1 [chromium] › tests/library.spec.ts:11:1 › the library lists the fixture videos and no podcast episodes (429ms)
  ✓  2 [chromium] › tests/library.spec.ts:19:1 › opening a video shows its summary (272ms)
  ✓  3 [chromium] › tests/library.spec.ts:29:1 › search narrows the library to the matching video (191ms)
  ✓  4 [chromium] › tests/library.spec.ts:46:3 › /inbox renders (136ms)
  ✓  5 [chromium] › tests/library.spec.ts:46:3 › /channels renders (121ms)
  ✓  6 [chromium] › tests/library.spec.ts:46:3 › /stats renders (133ms)
  ✓  7 [chromium] › tests/library.spec.ts:46:3 › /settings renders (133ms)
  ✓  8 [chromium] › tests/library.spec.ts:52:1 › without application login the nav offers no sign-out (160ms)
  8 passed (2.3s)
==> 3. base image on the migrated schema
ok   base image lists the rows
e2e ok: d49fbece95ab132d956e97b0d79ab0dec6d45363, upgrade from and rollback to origin/main

$ E2E_BASE_URL=http://127.0.0.1:9 npx playwright test -g /inbox   # in e2e/
  1 failed
$ find e2e/test-results -type f
test-results/.last-run.json
test-results/library--inbox-renders-chromium/test-failed-1.png
test-results/library--inbox-renders-chromium/trace.zip
test-results/library--inbox-renders-chromium/error-context.md

$ scripts/lint
lint ok

Notes

  • Not covered: the sign-out click with a real session. It needs a second instance with password login and a fixed base_url (Origin check); follow-up.
  • A Renovate PR that bumps e2e/package*.json gets the normal review: scripts/renovate-only.sh is unchanged.

Production changes

None

🤖 Generated with Claude Code

The pipeline's repo contract puts browser tests in e2e/ (Playwright,
against E2E_BASE_URL). vimmary had none: the 2026-08-07 decision
(archive/DECISIONS.md) limited web/ to vitest over pure helpers and left a
browser to a separate decision. This is that decision. A PR that changes UI
behaviour can now prove it with a checked-in test, which REVIEW.md rule 1
asks for.

- e2e/ is its own npm package with @playwright/test pinned, so web/'s
  dependencies stay as they are.
- scripts/e2e runs the tests after the HTTP checks: against the new image
  in the upgrade test, and against E2E_BASE_URL in a session.
- Browsers go to Playwright's default cache: a cloud session presets
  PLAYWRIGHT_BROWSERS_PATH to a build of another Playwright version and
  PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD. scripts/setup installs them (a failure
  is logged, not fatal), scripts/e2e ensures them.
- CI keeps traces and screenshots of a failed run as an artifact.
- The tests cover the library, a video's summary, keyword search, the
  inbox, channels, stats and settings pages, and the absent sign-out
  button without application login. An uncaught page exception fails any
  test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Review: approve

Commit 4819c0a

The PR adds browser tests, run by scripts/e2e, that check the fixture library, opening a video, search, the Inbox, Channels, Stats and Settings pages, and that the nav has no sign-out button without login. The app itself is unchanged. The tests fail on any uncaught page exception, failed runs leave traces and screenshots, and CI uploads them as an artifact. scripts/setup now also installs the Playwright dependencies and Chromium, and a failed install is only logged. I found no blockers: no migration, no startup, version or health-check change, no secrets, and no check was weakened (the CI and script changes only add steps). The shown test output matches the named tests. Two gaps are minor and not blockers. The setup tolerance for a failed browser install, and the cloud-session environment handling, were not run, as the PR says. The artifact upload step is also unexercised by a green run. Nothing is needed outside this repo.

@github-actions

Copy link
Copy Markdown

preview: 4819c0a is live at https://knox.coydog-fence.ts.net:8091/

@meltforce
meltforce merged commit d12fa19 into main Nov 13, 2026
6 checks passed
@meltforce
meltforce deleted the claude/playwright-e2e branch November 13, 2026 16:40
@github-actions

Copy link
Copy Markdown

live: d12fa19 is deployed to production (run).

This branch was previously deployed

1 inactive deployment
preview — 4819c0af Deployed Nov 13, 2026 by meltforce via deploy #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant