From 097546ae0f184b6884295704bbbc640b87d1e5f6 Mon Sep 17 00:00:00 2001 From: Sem Bauke Date: Wed, 4 Dec 2024 19:37:57 +0100 Subject: [PATCH] test: debug playwright ci with screenshots (#57396) --- .github/workflows/e2e-playwright.yml | 8 +++++++- playwright.config.ts | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-playwright.yml b/.github/workflows/e2e-playwright.yml index 1bf883a04d1..8c3f76fba03 100644 --- a/.github/workflows/e2e-playwright.yml +++ b/.github/workflows/e2e-playwright.yml @@ -157,10 +157,16 @@ jobs: pnpm run start-ci & sleep 10 npx playwright test --project="${{ matrix.browsers }}" --grep-invert 'third-party-donation.spec.ts' - - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: name: playwright-report-${{ matrix.browsers }} path: playwright/reporter retention-days: 30 + - name: Upload screenshots + if: failure() + uses: actions/upload-artifact@v4 + with: + name: screenshots-${{ matrix.browsers }} + path: playwright/test-results + retention-days: 14 diff --git a/playwright.config.ts b/playwright.config.ts index 8791e0ea687..4eec550f0ed 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -35,7 +35,8 @@ export default defineConfig({ trace: 'on-first-retry', storageState: 'playwright/.auth/certified-user.json', /* Use custom test attribute */ - testIdAttribute: 'data-playwright-test-label' + testIdAttribute: 'data-playwright-test-label', + screenshot: 'only-on-failure' }, /* Configure projects for major browsers */