Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,25 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Resolve Playwright version
id: playwright-version
run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"

- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-webkit-${{ runner.os }}-${{ hashFiles('widget/pnpm-lock.yaml') }}
# Key on the resolved Playwright version: each version pins specific
# browser builds (e.g. webkit-2272), so a bump auto-invalidates the cache.
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}

- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
# Run unconditionally. `playwright install` is idempotent: it only downloads
# browsers missing from the (possibly cached) ms-playwright dir, so a partial
# or stale cache self-heals here instead of permanently skipping the binary
# install. --with-deps re-applies system libraries, which are not cached.
- name: Install Playwright browsers and system dependencies
run: pnpm exec playwright install --with-deps chromium webkit

- name: Install Playwright system deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium webkit

- name: Run E2E tests
run: pnpm e2e

Expand Down
2 changes: 1 addition & 1 deletion widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"test:coverage": "vitest run --coverage",
"e2e": "playwright test",
"e2e:ui": "playwright test --ui",
"e2e:install": "playwright install chromium",
"e2e:install": "playwright install chromium webkit",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"format": "prettier --write \"src/**/*.{ts,tsx,css}\"",
Expand Down
4 changes: 3 additions & 1 deletion widget/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export default defineConfig({
testIgnore: ["**/mobile.spec.ts"],
},
{
name: "chromium-mobile",
// iPhone 13 emulation runs on WebKit (Mobile Safari), not Chromium —
// name it accordingly so CI installs the right browser binary.
name: "mobile-safari",
use: { ...devices["iPhone 13"] },
testMatch: ["**/mobile.spec.ts"],
},
Expand Down
Loading