Template — Playwright
| Statut | Actif — v1.0 — 2026-06-27 |
| Usage | Copier dans .github/workflows/playwright.yml |
| Voir aussi | Playbook Playwright |
Usage
Copier dans .github/workflows/playwright.yml du projet frontend.
Ce workflow ne tourne que sur les PRs qui modifient des fichiers frontend — pas sur toutes les PRs. Il ne bloque pas le merge par défaut ; promouvoir en required check une fois la suite stabilisée.
Template
name: Playwright E2E
# Standard DMV — E2E tests on critical user journeys only.
# Runs on PRs that touch frontend files.
# Not a required check by default — promote once the suite is stable.
on:
pull_request:
paths:
- 'app/**'
- 'components/**'
- 'pages/**'
- 'src/**'
- 'tests/e2e/**'
- 'playwright.config.ts'
permissions:
contents: read
jobs:
playwright:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install chromium --with-deps
- name: Build app
run: npm run build
env:
NEXT_TELEMETRY_DISABLED: 1
- name: Run Playwright tests
run: npx playwright test
env:
PLAYWRIGHT_BASE_URL: ${{ secrets.PLAYWRIGHT_BASE_URL || 'http://localhost:3000' }}
# TEST_USER_EMAIL: ${{ secrets.TEST_USER_EMAIL }}
# TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
- name: Upload test report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7