Skip to content

test(desktop): make the Playwright e2e suite runnable on Windows - #5457

Open
TheSeydiCharyyev wants to merge 1 commit into
block:mainfrom
TheSeydiCharyyev:fix/windows-e2e-runnable
Open

test(desktop): make the Playwright e2e suite runnable on Windows#5457
TheSeydiCharyyev wants to merge 1 commit into
block:mainfrom
TheSeydiCharyyev:fix/windows-e2e-runnable

Conversation

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor

Summary

  • probe for a Python interpreter that actually answers, instead of hardcoding python3 in both Playwright configs
  • compare logical lines in the code-block clipboard assertion, so it holds on Windows too

Two separate defects stop the desktop e2e suite on a stock Windows box. Neither is a product bug; both are in the test setup.

1. python3 is an alias stub on Windows

desktop/playwright.config.ts and desktop/playwright.perf.config.ts both ran python3 -m http.server 4173 -d dist.

On Windows, python3 is normally the Microsoft Store app-execution alias. It prints an install hint and exits 9009, even when a real interpreter is installed under the name python. Playwright shows only this:

[WebServer] Python was not found; run without arguments to install from the Microsoft Store...
Error: Process from config.webServer was not able to start. Exit code: 9009

So no test runs at all, and the message does not point at the cause.

On my machine:

python3 --version  -> the Store hint, exit 9009
python  --version  -> Python 3.13.5

staticWebServer now probes the candidates and takes the first one that answers. -c "" is a no-op that a real interpreter accepts and the stub rejects. Linux and macOS keep python3 first, so the command CI runs does not change.

2. The clipboard assertion cannot hold on Windows

copy a rendered code block and paste it back as code compared navigator.clipboard.readText() to a string with LF. Chromium returns CRLF when it reads text/plain off the Windows clipboard, so the two never match, and the diff looks like two identical blocks.

The app is not at fault. copyCodeBlockToClipboard puts code into the text/plain blob verbatim, with LF. The normalization happens in the clipboard layer on read. So the test now compares logical lines.

Only this one assertion needed it. The other clipboard read in the suite (agents.spec.ts) copies a single-line URL, which has no line endings.

Validation

All on Windows 11, desktop/:

  • before: npx playwright test tests/e2e/messaging.spec.ts --project=smoke cannot start; exit code 9009
  • after: the same command starts its own server and passes 48/48
  • clean main control, with a static server started by hand to get past defect 1: 47/48, and the one failure is copy a rendered code block and paste it back as code — defect 2
  • the integration project also starts the server and passes
  • --config=playwright.perf.config.ts --list loads and lists its 6 tests
  • pnpm --filter buzz exec tsc --noEmit
  • pnpm --filter buzz check — biome, file sizes, px-text, pubkey truncation

I cannot run Linux or macOS here. The reason CI is unaffected is small enough to read: on any non-Windows platform the first candidate is python3, and when it answers, the command string is byte-for-byte what it was before.

Two separate defects stopped the desktop e2e suite on a stock Windows box.

The webServer command hardcoded `python3`. On Windows that name is normally
the Microsoft Store app-execution alias, which prints an install hint and
exits 9009 even when a real interpreter is installed as `python`. Playwright
reports only "Process from config.webServer was not able to start. Exit
code: 9009", so no test runs at all. Both Playwright configs now probe for
an interpreter that actually answers. Linux and macOS still try `python3`
first, so the command they run is unchanged.

The code-block copy test compared the clipboard to a LF string. Chromium
returns CRLF when it reads text/plain off the Windows clipboard, so the
assertion could not hold there. The app is not at fault: it writes `code`
into the text/plain blob verbatim. The test now compares logical lines.

Signed-off-by: Seydi Charyyev <seydi.charyev@gmail.com>
@TheSeydiCharyyev
TheSeydiCharyyev requested a review from a team as a code owner August 10, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant