Updated recently
Last updated:
Quick Answer: To run Playwright in GitHub Actions: create a workflow YAML, install dependencies, install browsers, run tests. For Cypress: use the official Cypress GitHub Action. Both support parallelization and artifact capture.
Playwright in GitHub Actions
# .github/workflows/playwright.yml
name: Playwright Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- 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/
Cypress in GitHub Actions
# .github/workflows/cypress.yml
name: Cypress Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v6
with:
build: npm run build
start: npm run start
wait-on: 'http://localhost:3000'
browser: chrome
Best Practices
- Cache dependencies: Speed up npm install
- Run on PR only: Don’t run expensive E2E on every commit
- Use headless mode: No GUI overhead in CI
- Set timeouts: Prevent hanging on stuck tests
- Capture artifacts: Upload reports on failure
Training Resources
Master CI/CD with SkilBrill Playwright Training.
FAQ
How long do CI/CD test pipelines take?
Playwright: 5-15 minutes for 200 tests. Cypress: 8-20 minutes.
