Commit e47ad78
fix(e2e): platform-aware chromium resolver + pin playwright CLI (Phase 0.3)
`tests/e2e/lib_helpers.cjs` and `tests/e2e/test_task8_modularization.mjs`
both hard-coded `process.env.LOCALAPPDATA + "/ms-playwright/chromium-1208/
chrome-win64/chrome.exe"`. On a Linux CI runner LOCALAPPDATA is undefined,
so chromium.launch() was asked to start `"undefined/ms-playwright/.../chrome.exe"`
— Windows binary path on Linux, double bug. Latest e2e-smoke.yml run
(25877702139) failed at the first smoke step with exactly this error.
Replaced the hard-coded constant with a `resolveChromiumExecutable()`
helper:
1. honor `PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH` env override
2. on Windows with LOCALAPPDATA set, preserve the legacy path so local
dev keeps working
3. otherwise return `undefined` and let `playwright-core` auto-resolve
from the standard `~/.cache/ms-playwright/` location
Launch site only sets `executablePath` when the resolver returns a value,
so playwright-core can use its bundled discovery on Linux CI.
Second bug surfaced while reading the workflow log: `npx playwright
install` was unpinned and pulled the latest playwright (1.60.0 in the
failed run) — but package.json pins `playwright-core@1.59.1`. The CLI
would have installed chromium at a revision playwright-core wouldn't
look for at runtime. Pinned all three browser-install workflow steps
(`e2e-smoke.yml`, `e2e-full.yml`, `a11y-audit.yml`) to
`npx playwright@1.59.1 install --with-deps chromium` so the installed
chromium revision matches what playwright-core resolves.
Verification:
- Local Windows: `node -e` of the resolver returns the existing
`C:\Users\PC\AppData\Local\ms-playwright\chromium-1208\chrome-win64\
chrome.exe` path — local dev behavior unchanged.
- Linux CI: resolver returns `undefined`, launch options omit
`executablePath`, playwright-core discovers chromium installed by
`npx playwright@1.59.1 install`.
- Workflow green on next push will be the ground-truth signal; this
commit is being pushed specifically to exercise it.
Per Phase 0.3 of `docs/PUBLIC_RELEASE_PLAN.md` ("Fix e2e-smoke.yml
Playwright `undefined` env var failure — Windows binary path appears
on Linux runner").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 53876d4 commit e47ad78
5 files changed
Lines changed: 47 additions & 7 deletions
File tree
- .github/workflows
- tests/e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
6 | 18 | | |
7 | 19 | | |
8 | 20 | | |
| |||
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
43 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
44 | 58 | | |
45 | 59 | | |
46 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| |||
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
97 | | - | |
98 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
0 commit comments