diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e1abf9733..6e8c165cdc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -177,6 +177,13 @@ jobs: - name: Run E2E tests run: yarn test:e2e --setup --concurrency=1 --project=${{ matrix.project }} + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: playwright-trace + path: test-apps/e2e/**/test-results/**/trace.zip + retention-days: 1 + api_ce_pg: if: needs.changes.outputs.backend == 'true' runs-on: ubuntu-latest diff --git a/playwright.base.config.js b/playwright.base.config.js index 94ffb766e7..e8805cb2b3 100644 --- a/playwright.base.config.js +++ b/playwright.base.config.js @@ -36,8 +36,11 @@ const createConfig = ({ port, testDir, appDir }) => ({ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ actionTimeout: 0, - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'off', + /* Collect trace when a test failed on the CI. See https://playwright.dev/docs/trace-viewer + Until https://github.com/strapi/strapi/issues/18196 is fixed we can't enable this locally, + because the Strapi server restarts every time a new file (trace) is created. + */ + trace: process.env.CI ? 'retain-on-failure' : 'off', }, /* Configure projects for major browsers */