test(desktop): make the Playwright e2e suite runnable on Windows - #5457
Open
TheSeydiCharyyev wants to merge 1 commit into
Open
test(desktop): make the Playwright e2e suite runnable on Windows#5457TheSeydiCharyyev wants to merge 1 commit into
TheSeydiCharyyev wants to merge 1 commit into
Conversation
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>
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.
Summary
python3in both Playwright configsTwo separate defects stop the desktop e2e suite on a stock Windows box. Neither is a product bug; both are in the test setup.
1.
python3is an alias stub on Windowsdesktop/playwright.config.tsanddesktop/playwright.perf.config.tsboth ranpython3 -m http.server 4173 -d dist.On Windows,
python3is normally the Microsoft Store app-execution alias. It prints an install hint and exits 9009, even when a real interpreter is installed under the namepython. Playwright shows only this:So no test runs at all, and the message does not point at the cause.
On my machine:
staticWebServernow 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 keeppython3first, 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 codecomparednavigator.clipboard.readText()to a string with LF. Chromium returns CRLF when it readstext/plainoff the Windows clipboard, so the two never match, and the diff looks like two identical blocks.The app is not at fault.
copyCodeBlockToClipboardputscodeinto thetext/plainblob 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/:npx playwright test tests/e2e/messaging.spec.ts --project=smokecannot start; exit code 9009maincontrol, with a static server started by hand to get past defect 1: 47/48, and the one failure iscopy a rendered code block and paste it back as code— defect 2integrationproject also starts the server and passes--config=playwright.perf.config.ts --listloads and lists its 6 testspnpm --filter buzz exec tsc --noEmitpnpm --filter buzz check— biome, file sizes, px-text, pubkey truncationI 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.