e2e: harness — create a Room and join it from a second browser #192

Closed
opened 2026-09-01 13:44:30 +00:00 by root · 9 comments
root commented 2026-09-01 13:44:30 +00:00 (Migrated from gitlab.core-project.space)

Imported from GitHub amaurycoudr/chess-project#192, opened by @amaurycoudr on 2026-09-01 13:44 UTC.
Closed on GitHub on 2026-09-01 14:23 UTC as completed.


Parent

#191

What to build

The first crossing of the browser seam, end to end: a Player creates a Room in one browser, a second Player opens the invite link in another browser, and both see the Room's two Seats filled.

This is the tracer bullet for the whole suite, so it carries the harness the later tickets build on. The suite lives in its own workspace package, @chess/e2e, which declares no dependency on the front-end package — that is the mechanism enforcing the seam, not a convention to be remembered.

The suite drives the real front-end and the real API over real SSE Connections. In CI the servers serve built artifacts, so a pass speaks about the bundle a Player actually receives; locally they are the dev servers, for speed, selected by environment variable. Playwright's own web-server support starts both.

Port derivation is mandatory. Dev ports are assigned per worktree in blocks, and the API's configuration loader throws when its port is absent, so the Playwright configuration must load the worktree's environment (or run the repo's port-sync script) and derive its base URL from the assigned front-end port. A hardcoded port would silently drive another worktree's servers and the failure would be baffling.

Each Player is a separate browser context, which gives each its own storage and therefore its own Seat token with no extra machinery. A shared fixture provides a seated pair in a fresh Room.

Two repo prerequisites ride along, both needed before this ticket can be committed at all: the allowed commit scopes must gain e2e, and the Playwright MCP project configuration is committed if it is to be shared (it is an authoring aid only — no committed test may require an MCP server).

Acceptance criteria

  • A new workspace package @chess/e2e exists and its manifest declares no dependency on the front-end package
  • The package implements the Turbo pipeline's existing test:slow task, and does not implement test
  • pnpm test and the pre-commit hook do not run any browser; the five-command gate is unchanged locally
  • A separate CI job runs the suite on pull requests, including a Chromium install step
  • The Playwright base URL is derived from the worktree's assigned front-end port; no port is hardcoded
  • Both the front-end and the API are started by the test run; CI runs against built artifacts, local runs against dev servers, chosen by environment variable
  • Chromium only; no retries; a per-test timeout; focused subsets refused; traces kept on failure
  • A shared fixture yields two independent browser contexts, each with its own storage
  • Green test: Player A creates a Room from the home page, the invite link is taken from A's browser, Player B opens it, and both Players observe two filled Seats
  • The Room used by the test is created through the user interface, not by calling a procedure
  • The package records the selector law: role plus accessible name first; the domain-anchored hooks (board and its orientation, squares by algebraic name, the move list, the captured trays, the per-square selection / legal-target / last-move / check attributes) where no accessible name exists; and the layout-anchored hooks (the rail and its four sub-regions, the room layout wrapper) banned outright
  • No new test hooks are added to the front-end package
  • No test-only procedure is added to the API
  • The allowed commit scopes include e2e
  • All five gate commands pass
> _Imported from GitHub [amaurycoudr/chess-project#192](https://github.com/amaurycoudr/chess-project/issues/192), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-09-01 13:44 UTC._ > _Closed on GitHub on 2026-09-01 14:23 UTC as completed._ <!-- github-issue:192 --> --- ## Parent #191 ## What to build The first crossing of the browser seam, end to end: a Player creates a Room in one browser, a second Player opens the invite link in another browser, and both see the Room's two Seats filled. This is the tracer bullet for the whole suite, so it carries the harness the later tickets build on. The suite lives in its own workspace package, `@chess/e2e`, which declares **no dependency on the front-end package** — that is the mechanism enforcing the seam, not a convention to be remembered. The suite drives the real front-end and the real API over real SSE Connections. In CI the servers serve built artifacts, so a pass speaks about the bundle a Player actually receives; locally they are the dev servers, for speed, selected by environment variable. Playwright's own web-server support starts both. Port derivation is mandatory. Dev ports are assigned per worktree in blocks, and the API's configuration loader throws when its port is absent, so the Playwright configuration must load the worktree's environment (or run the repo's port-sync script) and derive its base URL from the assigned front-end port. A hardcoded port would silently drive another worktree's servers and the failure would be baffling. Each Player is a separate browser context, which gives each its own storage and therefore its own Seat token with no extra machinery. A shared fixture provides a seated pair in a fresh Room. Two repo prerequisites ride along, both needed before this ticket can be committed at all: the allowed commit scopes must gain `e2e`, and the Playwright MCP project configuration is committed if it is to be shared (it is an authoring aid only — no committed test may require an MCP server). ## Acceptance criteria - [ ] A new workspace package `@chess/e2e` exists and its manifest declares no dependency on the front-end package - [ ] The package implements the Turbo pipeline's existing `test:slow` task, and does **not** implement `test` - [ ] `pnpm test` and the pre-commit hook do not run any browser; the five-command gate is unchanged locally - [ ] A separate CI job runs the suite on pull requests, including a Chromium install step - [ ] The Playwright base URL is derived from the worktree's assigned front-end port; no port is hardcoded - [ ] Both the front-end and the API are started by the test run; CI runs against built artifacts, local runs against dev servers, chosen by environment variable - [ ] Chromium only; no retries; a per-test timeout; focused subsets refused; traces kept on failure - [ ] A shared fixture yields two independent browser contexts, each with its own storage - [ ] Green test: Player A creates a Room from the home page, the invite link is taken from A's browser, Player B opens it, and **both** Players observe two filled Seats - [ ] The Room used by the test is created through the user interface, not by calling a procedure - [ ] The package records the selector law: role plus accessible name first; the domain-anchored hooks (board and its orientation, squares by algebraic name, the move list, the captured trays, the per-square selection / legal-target / last-move / check attributes) where no accessible name exists; and the layout-anchored hooks (the rail and its four sub-regions, the room layout wrapper) banned outright - [ ] No new test hooks are added to the front-end package - [ ] No test-only procedure is added to the API - [ ] The allowed commit scopes include `e2e` - [ ] All five gate commands pass
root commented 2026-09-01 13:44:30 +00:00 (Migrated from gitlab.core-project.space)

GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links).

> _GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links)._ <!-- github-relations --> - Blocking: #199, #198, #194, #193
root (Migrated from gitlab.core-project.space) closed this issue 2026-09-01 14:23:32 +00:00
root commented 2026-10-13 08:39:09 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #193

mentioned in issue #193
root commented 2026-10-13 08:39:09 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #194

mentioned in issue #194
root commented 2026-10-13 08:39:09 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #198

mentioned in issue #198
root commented 2026-10-13 08:39:10 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #199

mentioned in issue #199
root commented 2026-10-13 08:41:45 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #199

marked this issue as related to #199
root commented 2026-10-13 08:41:45 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #198

marked this issue as related to #198
root commented 2026-10-13 08:41:45 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #194

marked this issue as related to #194
root commented 2026-10-13 08:41:45 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #193

marked this issue as related to #193
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.

Reference
amaurycoudr/chess-project#192
No description provided.