From dcf142953b9a5401e8c9f53518ed78720c802fd1 Mon Sep 17 00:00:00 2001 From: Arnau Giralt Date: Wed, 13 May 2026 21:51:45 +0200 Subject: [PATCH] ci(admin): produce Playwright HTML report and post PR summary The E2E job uploaded admin/ui/e2e/playwright-report/ but the Playwright config never enabled the html reporter, so the artifact upload always warned that the path was empty. Wire the html and json reporters into the config, and add a same-repo-PR step that posts a sticky comment with per-project pass/fail counts. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci-admin.yml | 10 ++++++++++ .gitignore | 1 + admin/ui/e2e/playwright.config.js | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/.github/workflows/ci-admin.yml b/.github/workflows/ci-admin.yml index ad24aaf..1c5bbc9 100644 --- a/.github/workflows/ci-admin.yml +++ b/.github/workflows/ci-admin.yml @@ -125,6 +125,9 @@ jobs: name: E2E runs-on: ubuntu-latest needs: [lint-go, lint-ui, test-go, test-ui] + permissions: + contents: read + pull-requests: write steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -162,6 +165,13 @@ jobs: path: admin/ui/e2e/playwright-report/ retention-days: 14 + - name: Post test summary to PR + # Skipped on forked PRs (read-only token) and on push events. + if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} + uses: daun/playwright-report-summary@1229105480a2a4bdd91598d8a146fbab41343fce # v3.11.0 + with: + report-file: admin/ui/e2e/results.json + build: name: Build runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 5f0e496..857ae72 100644 --- a/.gitignore +++ b/.gitignore @@ -84,6 +84,7 @@ admin/seed-user # Admin E2E tests admin/ui/e2e/.auth/ admin/ui/e2e/results/ +admin/ui/e2e/results.json admin/ui/e2e/playwright-report/ # Playwright MCP output diff --git a/admin/ui/e2e/playwright.config.js b/admin/ui/e2e/playwright.config.js index 8ec0c82..ba41e91 100644 --- a/admin/ui/e2e/playwright.config.js +++ b/admin/ui/e2e/playwright.config.js @@ -29,6 +29,11 @@ export default defineConfig({ screenshot: 'only-on-failure', testIdAttribute: 'data-testid', }, + reporter: [ + ['list'], + ['html', { outputFolder: 'playwright-report', open: 'never' }], + ['json', { outputFile: 'results.json' }], + ], projects: [ // --- Chromium (primary): full suite --- {