Skip to content

fix(ui): serve the mock playwright suite from a production build, not the dev server - #3163

Draft
Charlesthebird wants to merge 1 commit into
mainfrom
charlesthebird/e2eProdBuild
Draft

Charlesthebird wants to merge 1 commit into
mainfrom
charlesthebird/e2eProdBuild

Conversation

@Charlesthebird

Copy link
Copy Markdown
Collaborator

🤖 written by Claude (start)

Release note

NONE

Changes

Closes #3134. Each mock Playwright server now runs vite build into its own outDir and serves it with vite preview, so pages load one bundle instead of hundreds of dev modules, and the suite tests the code that ships. The API mode and extension settings are fixed at build time, so the bare and extension apps get separate builds; the mock backend and the live suite are unchanged.

Testing

  1. Run yarn test:pw in ui/.
  2. Check each server serves dist/e2e-<port> and the suite needs no retries.

🤖 written by Claude (end)

🤖 Generated with Claude Code

… the dev server

Both mock web servers ran `yarn dev`, so each page load fetched hundreds of
unbundled modules through the service worker, and under load a plain
`page.goto` could exceed the 30s test budget. The suite also tested dev-mode
code rather than the bundle that ships.

Each mock server now runs `vite build` into its own `outDir` and serves it
with `vite preview`. The API-mode and example-extension pins are inlined at
build time, so the bare and extension apps need separate builds. The mock
backend is unchanged, and the build keeps `mockServiceWorker.js`. The live
suite stays on `yarn dev`.

Closes #3134

Verified with `yarn test:pw` (chromium, firefox, chromium-with-extension)
on a heavily loaded machine: three runs on the build, 190/190 each, 2.1-2.6m
wall. Two runs on the dev server before the change failed 8 and 5 tests and
took 3.7-4.4m. `yarn lint` (0 errors), `yarn typecheck` and the
`playwright/` vitest checks pass.

Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Run the mock UI Playwright suite against a production build, not the Vite dev server

2 participants