How to Run Playwright WebKit in CI
WebKit is the Playwright engine that breaks most often in CI: it needs a longer, distinct list of system libraries than Chromium or Firefox.
Playwright bundles a WebKit build, but on Linux WebKit links against extra libraries (GStreamer, WebP, ICU, libwoff) that Chromium does not need. The fix is the same --with-deps installer - but WebKit is the engine that most often exposes a missing-dependency gap.
Why it fails in CI
After npm ci the WebKit binary is missing until you run the installer, and even then a slim runner lacks WebKit-specific libraries like libgstreamer, libwebp, libwoff2, and libenchant. Chromium may launch while WebKit fails with Host system is missing dependencies to run browsers listing WebKit-only libs.
Install & run it reliably
Install WebKit with its system dependencies via the official installer, or use the official Playwright image which already has every library. Installing only the engine you test cuts download time.
npm ci
npx playwright install --with-deps webkit
npx playwright test --project=webkit
# or use the official image (all libs preinstalled):
# mcr.microsoft.com/playwright:v1.XX.X-jammy (pin to your version)Cache & speed
WebKit binaries live in ~/.cache/ms-playwright; cache it keyed on the Playwright version so the download happens once. Note that the OS libraries from --with-deps are not cached by that path - bake them into a custom image or use the official Playwright image to skip the apt step every run.
Common errors
Host system is missing dependencieslisting libgstreamer/libwebp/libwoff → runplaywright install --with-deps webkit.Executable doesn’t exist at .../webkit-XXXX/...→ you never installed the webkit browser.- Chromium passes but WebKit fails → WebKit-only libraries are missing; use
--with-depsor the official image. - Version mismatch in the Docker image → align the image tag with your Playwright version.
Key takeaways
- WebKit needs more Linux libraries than Chromium/Firefox - use
--with-deps webkit. - The official
mcr.microsoft.com/playwrightimage has every WebKit library. - Cache
~/.cache/ms-playwright; bake the apt libs into the image.