From caec6c1587195e6044796beb804b0342b589d05b Mon Sep 17 00:00:00 2001 From: xBlaz3kx Date: Wed, 17 Dec 2025 23:41:06 +0100 Subject: [PATCH] feat: add playwright test report on PR --- .github/workflows/default.yml | 12 +++++++++++- playwright.config.ts | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 690a40010c..a30a7790bf 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -215,6 +215,7 @@ jobs: permissions: contents: read actions: write + pull-requests: write # Needed for commenting coverage reports on PRs steps: - uses: actions/checkout@v6 @@ -268,10 +269,11 @@ jobs: run: npx playwright install-deps chromium - name: Run tests - run: npx playwright test + run: PLAYWRIGHT_JSON_OUTPUT_NAME=results.json npx playwright test timeout-minutes: 20 env: TZ: Europe/Berlin + continue-on-error: true - uses: actions/upload-artifact@v5 if: ${{ !cancelled() }} @@ -280,6 +282,14 @@ jobs: path: playwright-report/ retention-days: 14 + - uses: daun/playwright-report-summary@v3 + if: github.event_name == 'pull_request' + continue-on-error: true + with: + report-file: results.json + create-comment: true + job-summary: true + code_coverage: name: "Code coverage report" if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch diff --git a/playwright.config.ts b/playwright.config.ts index efc47de86c..482cc81f7f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ forbidOnly: !!process.env.CI, retries: process.env.CI ? 4 : 0, timeout: 60000, // 60s - reporter: [[process.env.CI ? "github" : "list"], ["html", { open: "never" }]], + reporter: [[process.env.CI ? "github" : "list"], ["json"], ["html", {open: "never"}]], use: { baseURL: "http://127.0.0.1:7070", trace: "on-first-retry",