ci: reliably install WebKit for mobile Playwright e2e#133
Merged
Conversation
The mobile e2e project emulates iPhone 13, which Playwright runs on WebKit. CI gated the browser-binary install behind a cache miss: on a cache hit only `playwright install-deps` (system libraries) ran, never the binaries. Once the cached ms-playwright dir was missing the current WebKit build, the cache-hit path could never repair it, so every run failed with `webkit-2272` not found while the chromium tests passed. - Run `playwright install --with-deps chromium webkit` unconditionally. It is idempotent and only downloads browsers missing from the cached dir, so a partial or stale cache self-heals instead of being skipped. - Key the browser cache on the resolved Playwright version, which pins the exact browser builds, so an upgrade auto-invalidates the cache. - Rename the misnamed `chromium-mobile` project to `mobile-safari`. It has always run on WebKit; the wrong name is what led CI to install chromium only to begin with. - Add webkit to the local `e2e:install` script for parity. Verified locally: full e2e suite green (10 passed) across chromium-desktop and mobile-safari. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Problem
The
pnpm e2eworkflow fails on every run with:The 3 mobile tests fail while the 7 desktop (chromium) tests pass. The mobile project emulates iPhone 13, which Playwright runs on WebKit — not Chromium, despite the project being named
chromium-mobile.Root cause
A cache-poisoning foot-gun in
e2e.yml. The browser-binary install was gated behindif: cache-hit != 'true', while the cache-hit branch ran onlyplaywright install-deps(system libraries, no binaries). Git history shows the project started chromium-only (33a6fc0) and later added webkit (93b28bf). Once the cached~/.cache/ms-playwrightwas missing the current WebKit build, the cache-hit path could never repair it — the binary install was permanently skipped — so the failure persisted on every run.Fix
playwright install --with-deps chromium webkit. The command is idempotent and only downloads what's missing from the (cached) dir, so a partial/stale cache self-heals instead of being skipped forever.chromium-mobile→mobile-safari. It has always run on WebKit; the misleading name is what led CI to install chromium only to begin with.e2e:installscript so local devs running the mobile spec don't hit the same wall.Verification
Full e2e suite run locally — 10 passed across
chromium-desktopandmobile-safari:No widget source code changed — only CI config, the e2e project name, and the install script.
🤖 Generated with Claude Code