diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8d154627..119e76e8 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -29,9 +29,11 @@ jobs: - run: pnpm install --frozen-lockfile - run: pnpm build - - run: npx playwright install --with-deps chromium + - run: google-chrome --version - name: Run e2e tests + env: + PAPERCLIP_PLAYWRIGHT_CHANNEL: "chrome" run: pnpm run test:e2e - uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fa081796..8ed50ba1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -273,8 +273,11 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Install Playwright - run: npx playwright install --with-deps chromium + - name: Verify runner Chrome + # GitHub's Ubuntu runner image already ships Google Chrome, so use that + # directly for the headless e2e lane instead of downloading Playwright + # browser bundles inside the 30 minute job budget. + run: google-chrome --version - name: Generate Paperclip config run: | @@ -294,6 +297,7 @@ jobs: - name: Run e2e tests env: PAPERCLIP_E2E_SKIP_LLM: "true" + PAPERCLIP_PLAYWRIGHT_CHANNEL: "chrome" run: pnpm run test:e2e - name: Upload Playwright report diff --git a/.github/workflows/release-smoke.yml b/.github/workflows/release-smoke.yml index 823a578c..8ab96aeb 100644 --- a/.github/workflows/release-smoke.yml +++ b/.github/workflows/release-smoke.yml @@ -58,8 +58,10 @@ jobs: - name: Install dependencies run: pnpm install --no-frozen-lockfile - - name: Install Playwright browser - run: npx playwright install --with-deps chromium + - name: Verify runner Chrome + # Release smoke also runs headless on GitHub's Ubuntu image, so use the + # runner's preinstalled Chrome instead of a Playwright browser download. + run: google-chrome --version - name: Launch Docker smoke harness run: | @@ -89,6 +91,7 @@ jobs: PAPERCLIP_RELEASE_SMOKE_BASE_URL: ${{ env.SMOKE_BASE_URL }} PAPERCLIP_RELEASE_SMOKE_EMAIL: ${{ env.SMOKE_ADMIN_EMAIL }} PAPERCLIP_RELEASE_SMOKE_PASSWORD: ${{ env.SMOKE_ADMIN_PASSWORD }} + PAPERCLIP_PLAYWRIGHT_CHANNEL: "chrome" run: pnpm run test:release-smoke - name: Capture Docker logs diff --git a/tests/e2e/playwright.config.ts b/tests/e2e/playwright.config.ts index 4f1c7206..89ad041d 100644 --- a/tests/e2e/playwright.config.ts +++ b/tests/e2e/playwright.config.ts @@ -8,6 +8,7 @@ import { defineConfig } from "@playwright/test"; const PORT = Number(process.env.PAPERCLIP_E2E_PORT ?? 3199); const BASE_URL = `http://127.0.0.1:${PORT}`; const PAPERCLIP_HOME = fs.mkdtempSync(path.join(os.tmpdir(), "paperclip-e2e-home-")); +const PLAYWRIGHT_CHANNEL = process.env.PAPERCLIP_PLAYWRIGHT_CHANNEL; export default defineConfig({ testDir: ".", @@ -26,7 +27,10 @@ export default defineConfig({ projects: [ { name: "chromium", - use: { browserName: "chromium" }, + use: { + browserName: "chromium", + ...(PLAYWRIGHT_CHANNEL ? { channel: PLAYWRIGHT_CHANNEL } : {}), + }, }, ], // The webServer directive bootstraps a throwaway instance and then starts it. diff --git a/tests/release-smoke/playwright.config.ts b/tests/release-smoke/playwright.config.ts index 76e278f9..fbdc9ffd 100644 --- a/tests/release-smoke/playwright.config.ts +++ b/tests/release-smoke/playwright.config.ts @@ -2,6 +2,7 @@ import { defineConfig } from "@playwright/test"; const BASE_URL = process.env.PAPERCLIP_RELEASE_SMOKE_BASE_URL ?? "http://127.0.0.1:3232"; +const PLAYWRIGHT_CHANNEL = process.env.PAPERCLIP_PLAYWRIGHT_CHANNEL; export default defineConfig({ testDir: ".", @@ -20,7 +21,10 @@ export default defineConfig({ projects: [ { name: "chromium", - use: { browserName: "chromium" }, + use: { + browserName: "chromium", + ...(PLAYWRIGHT_CHANNEL ? { channel: PLAYWRIGHT_CHANNEL } : {}), + }, }, ], outputDir: "./test-results",