From febb7a53833e27113cf9085cb1389065412cdbe4 Mon Sep 17 00:00:00 2001 From: Johan Lundgren Date: Thu, 16 Jan 2025 13:36:15 +0100 Subject: [PATCH] ci: saving screenshots of failing tests (#964) * test: saving screenshots of failing tests * test: corrected output directory * test: fix output directory path * test: using artifacts upload v4 * test: reverting to older ubuntu version * test: lowering artifacts retention days --- .github/workflows/playwright.yml | 9 ++++++++- packages/core/playwright.config.ts | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ffefd7d63..7c78fc3dc 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -6,7 +6,7 @@ on: branches: [main, develop] jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -33,3 +33,10 @@ jobs: if: always() with: report-file: ./packages/core/results.json + + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: playwright-output + path: ./packages/core/test-results/output ## Folder used in playwright.config.js `outputDir` + retention-days: 1 diff --git a/packages/core/playwright.config.ts b/packages/core/playwright.config.ts index e50d45232..eccceb5d7 100644 --- a/packages/core/playwright.config.ts +++ b/packages/core/playwright.config.ts @@ -8,7 +8,9 @@ const config: PlaywrightTestConfig = { use: { baseURL: 'http://localhost:3333', browserName: 'chromium', + screenshot: 'only-on-failure', }, + outputDir: './test-results/output', webServer: { command: 'serve -p 3333', port: 3333,