Skip to content

ci: reliably install WebKit for mobile Playwright e2e#133

Merged
PAMulligan merged 1 commit into
mainfrom
ci/fix-e2e-webkit-cache
Jun 18, 2026
Merged

ci: reliably install WebKit for mobile Playwright e2e#133
PAMulligan merged 1 commit into
mainfrom
ci/fix-e2e-webkit-cache

Conversation

@PAMulligan

Copy link
Copy Markdown
Contributor

Problem

The pnpm e2e workflow fails on every run with:

browserType.launch: Executable doesn't exist at /home/runner/.cache/ms-playwright/webkit-2272/pw_run.sh

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 behind if: cache-hit != 'true', while the cache-hit branch ran only playwright 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-playwright was 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

  • Install browsers unconditionally with 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.
  • Key the cache on the resolved Playwright version, which pins the exact browser builds — a Playwright upgrade now auto-invalidates the cache.
  • Rename chromium-mobilemobile-safari. It has always run on WebKit; the misleading name is what led CI to install chromium only to begin with.
  • Add webkit to the local e2e:install script so local devs running the mobile spec don't hit the same wall.

Verification

Full e2e suite run locally — 10 passed across chromium-desktop and mobile-safari:

Running 10 tests using 8 workers
  ✓ [mobile-safari] › opens as a bottom sheet with a scrim and a drag handle
  ✓ [mobile-safari] › tapping the scrim closes the bottom sheet
  ✓ [mobile-safari] › send a message and receive a reply on mobile
  ✓ [chromium-desktop] › ... (7 tests)
  10 passed (11.8s)

No widget source code changed — only CI config, the e2e project name, and the install script.

🤖 Generated with Claude Code

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>
@PAMulligan
PAMulligan merged commit c379fb9 into main Jun 18, 2026
9 checks passed
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