test: Playwright e2e suite — flow smoke + multi-viewport layout assertions - #11
Merged
Conversation
…tions Adds an e2e/ workspace running Playwright against the real server in mock mode (built app, token auth, fresh data dir per run): bun run test:e2e, gated as a CI job. Flows (tests/flows.spec.ts): token gate refuses a wrong token and unlocks with the right one; new-session dialog → approve the tool call → a full turn (user echo, thinking block, tool card) drains back to an idle composer; assistant opens from the rail; logout revokes server-side. Layout (tests/layout.spec.ts) at 320/390/768/1280/1440: exactly one visible copy of the global header actions (catches the duplicated mobile header class of bug), no horizontal document overflow, and the composer's primary button contained within the composer box — idle, queued, and after draining. DOM-presence tests alone would pass a poking-out button, so containment is asserted via bounding boxes. The suite immediately caught two more mock bugs, fixed here: - streamCannedTurn stamped the assistant message with Date.now() in the same millisecond as the user echo, and the client upserts live messages by timestamp alone — so the assistant start swallowed the user echo and the bubble never rendered. Live messages are now identified by (role, timestamp), matching sameMessage(), and the mock stamps strictly-increasing timestamps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an
e2e/workspace (bun run test:e2e) running Playwright against the real server in mock mode — built app, token auth, fresh data dir per run — plus a CI job gating it. This is the roadmap item that used to live in the README, scoped small.Flow smoke (
tests/flows.spec.ts):Multi-viewport layout (
tests/layout.spec.ts), at 320 / 390 / 768 / 1280 / 1440:It already paid for itself
Day one, the suite caught two more real bugs, fixed in the same PR:
streamCannedTurnstamped the assistant message withDate.now()in the same millisecond as the user echo (its first step runs synchronously), and the client upserts live messages by timestamp alone — so the assistant'smessage_startswallowed the user echo and the bubble silently never rendered. Live messages are now identified by(role, timestamp)— the same identitysameMessagealready uses for history dedupe — and the mock stamps strictly-increasing timestamps.Notes
bun run checkand both unit suites still pass; e2e is a separate script + CI job (browser install is too heavy for the check-and-test job).bunx playwright install --with-deps chromium; failures upload the Playwright report as an artifact.