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 --- {