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 */