Add browser e2e for the online companion, and PR checks #43

Merged
forgejo-admin merged 2 commits from feature/live-e2e-harness into main 2026-09-28 06:46:26 +00:00

Problem

Nothing exercises the guest site and the console together in a real browser, and PRs run no checks.

Solution

  • Fake Spotify: src/playback/fakeSpotify.ts implements the Spotify type on a clock. SPOTIFY=fake makes the console use it.
  • Playwright: pinned to 1.63.0. There are two projects: a Pixel 7 phone (Chromium only) and desktop.
    • It starts the app server in test mode on port 3400, and the console with fake Spotify on 3300.
    • e2e/seed.ts stores a self-signed DJ token and fake-catalog tracks in the console's database, so the tests skip OIDC.
  • Guest specs: sign-in, wrong passcode, taken handle, plays showing live in Now, History and Charts, and a request plus "me too" showing "Ana, Ben".
  • Console spec: the DJ goes online and queues a track, and a phone guest sees it playing.
  • Not yet enabled:
    • The full request → panel → queue → play → credit flow is a test.fixme until the requests panel (Slice 6) lands.
    • The reconnecting-notice test is skipped: it needs the shared app server stopped.
  • .forgejo/workflows/pr-validate.yml:
    • validate on native: bun run test, bun run check and the module's hook tests.
    • e2e on docker in mcr.microsoft.com/playwright:v1.63.0-noble, mirroring lunacycle.
  • Flaky test fixed: the fake-Spotify play order is now checked by row id, because recordPlay stamps real time and two plays could land in the same millisecond.

This is Slice 7 (harness) of projects/2026-09-27-dj-online-companion/plan.md.

Testing

  • bun run test: 195 pass, over three runs in a row.
  • bun run check: clean.
  • bun run e2e: 6 passed and 2 skipped, locally and on a rerun.
  • CI is unverified: this PR is the first run of the workflow, including whether the Playwright image and the docker runner are available.

🤖 Generated with Claude Code

## Problem Nothing exercises the guest site and the console together in a real browser, and PRs run no checks. ## Solution - **Fake Spotify:** `src/playback/fakeSpotify.ts` implements the `Spotify` type on a clock. `SPOTIFY=fake` makes the console use it. - **Playwright:** pinned to 1.63.0. There are two projects: a Pixel 7 phone (Chromium only) and desktop. - It starts the app server in test mode on port 3400, and the console with fake Spotify on 3300. - `e2e/seed.ts` stores a self-signed DJ token and fake-catalog tracks in the console's database, so the tests skip OIDC. - **Guest specs:** sign-in, wrong passcode, taken handle, plays showing live in Now, History and Charts, and a request plus "me too" showing "Ana, Ben". - **Console spec:** the DJ goes online and queues a track, and a phone guest sees it playing. - **Not yet enabled:** - The full request → panel → queue → play → credit flow is a `test.fixme` until the requests panel (Slice 6) lands. - The reconnecting-notice test is skipped: it needs the shared app server stopped. - **`.forgejo/workflows/pr-validate.yml`:** - `validate` on `native`: `bun run test`, `bun run check` and the module's hook tests. - `e2e` on `docker` in `mcr.microsoft.com/playwright:v1.63.0-noble`, mirroring lunacycle. - **Flaky test fixed:** the fake-Spotify play order is now checked by row id, because `recordPlay` stamps real time and two plays could land in the same millisecond. This is Slice 7 (harness) of `projects/2026-09-27-dj-online-companion/plan.md`. ## Testing - `bun run test`: 195 pass, over three runs in a row. - `bun run check`: clean. - `bun run e2e`: 6 passed and 2 skipped, locally and on a rerun. - **CI is unverified:** this PR is the first run of the workflow, including whether the Playwright image and the `docker` runner are available. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SPOTIFY=fake runs the console with a stand-in player. Playwright drives the
app server (test auth, fake search) and the console (seeded library and DJ
token) on phone and desktop viewports: guest sign-in, live plays, requests
with me too, and the DJ going online. pr-validate runs unit tests, check and
hook tests on the native runner, and Playwright in the Playwright image on
the docker runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check fake-Spotify play order by row id, not playedAt
All checks were successful
pr-validate / validate (pull_request) Successful in 9s
pr-validate / e2e (pull_request) Successful in 1m43s
200eb2b100
recordPlay stamps real time, so two plays in one millisecond tie and the
newest-first order flaked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forgejo-admin deleted branch feature/live-e2e-harness 2026-09-28 06:46:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
celilo/tango-dj!43
No description provided.