From 3a9abee0a9dbd5f9502821c1a29f14891a42c0e3 Mon Sep 17 00:00:00 2001 From: Daniel Izdebski Date: Thu, 5 Oct 2023 21:56:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20chore(ci):=20Archive=20Playwrigh?= =?UTF-8?q?t=20traces=20for=20E2E=20tests=20(#919)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 9 +++++++++ wallets/metamask/playwright.config.ts | 11 +++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03e7cc19b..aa4921a29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,3 +60,12 @@ jobs: - name: Run E2E tests (headless) run: pnpm run test:e2e:headless + + - name: Archive Playwright traces + uses: actions/upload-artifact@v3 + if: success() || failure() + with: + name: playwright-traces + path: | + wallets/metamask/test-results + if-no-files-found: error diff --git a/wallets/metamask/playwright.config.ts b/wallets/metamask/playwright.config.ts index b2d851aef..e22f8eea5 100644 --- a/wallets/metamask/playwright.config.ts +++ b/wallets/metamask/playwright.config.ts @@ -17,13 +17,16 @@ export default defineConfig({ // Opt out of parallel tests on CI. workers: process.env.CI ? 1 : undefined, - // Concise 'dot' for CI, default 'html' when running locally. See https://playwright.dev/docs/test-reporters. + // Concise 'dot' for CI, default 'html' when running locally. + // See https://playwright.dev/docs/test-reporters. reporter: process.env.CI ? 'dot' : 'html', - // Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. + // Shared settings for all the projects below. + // See https://playwright.dev/docs/api/class-testoptions. use: { - // Collect traces for all failed tests. See https://playwright.dev/docs/trace-viewer. - trace: 'retain-on-failure' + // Collect all traces on CI, and only traces for failed tests when running locally. + // See https://playwright.dev/docs/trace-viewer. + trace: process.env.CI ? 'on' : 'retain-on-failure' }, // Configure projects for major browsers.