Docs: E2E instructions say `pnpm run build`, which strips the mock bridge and breaks all smoke specs
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
### Problem
The E2E docs tell contributors to run a **plain production build** before re-running Playwright tests, which produces a bundle **without the E2E Tauri mock bridge** — so every smoke spec fails at boot.
Occurrences of the wrong instruction:
- `AGENTS.md` — "Writing E2E Screenshot Specs" → **Stale server** paragraph: "Kill port 4173 and `pnpm run build` before re-running tests after code changes."
- `desktop/src-tauri/src/managed_agents/screenshot_skill.md` — Gotcha 1 repeats the same `pnpm run build` advice.
- Header comments of the four perf specs in `desktop/tests/e2e/` (`typing-latency.perf.ts`, `scroll-smoothness.perf.ts`, `warm-switch-markdown.perf.ts`, `cold-switch-longtask.perf.ts`) say to run `pnpm build` first — they all call `installMockBridge`, so the same failure applies.
### Why it fails
`desktop/src/main.tsx` deliberately compiles the mock bridge only into dev and explicit E2E builds:
```ts
if (
!(import.meta.env.DEV || import.meta.env.MODE === "e2e") ||
!(window as E2eWindow).__BUZZ_E2E__
) {
return;
}
const { maybeInstallE2eTauriMocks } = await import("@/testing/e2eBridge");
```
`pnpm build` (`vite build`) runs in `production` mode, so the bridge is stripped. The Playwright web server (`python3 -m http.server 4173 -d dist`) then serves a bridge-less bundle and every spec that calls `installMockBridge` dies at boot with:
> Community connection failed / Cannot read properties of undefined (reading 'invoke')
The correct command is `pnpm build:e2e` (`vite build --mode e2e`) — it's what the `test:e2e*` package scripts already use.
### Impact
Two independent agent sessions lost real debugging time to this on 2026-07-27, chasing what looked like an app regression but was just a doc-induced wrong build mode.
### Fix
Update the docs (and perf-spec header comments) to say `pnpm build:e2e`, with a one-line warning that a plain `pnpm build` strips the mock bridge.
Contributor guide
Assessment
This issue has not been assessed yet.