Skip to content
Latchkey

GitHub Actions Workflow for Playwright End-to-End Tests

Run Playwright e2e tests in CI with reports and traces.

This workflow installs Playwright browsers, runs the e2e suite, and uploads the report even when tests fail.

The workflow

.github/workflows/e2e.yml
name: E2E
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20, cache: npm }
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: playwright-report
          path: playwright-report/

Notes

  • --with-deps installs the OS libraries the browsers need.
  • The report uploads with if: always() so failures are debuggable.
  • Shard with the matrix --shard flag for large suites.

Run it cheaper

Point runs-on: at a Latchkey label to run this workflow at roughly 69% lower per-minute cost, with self-healing for transient failures.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →