Merge pull request #18185 from strapi/chore/e2e-traces

chore(e2e): store test traces for failed tests as GH action artifacts
This commit is contained in:
Gustav Hansen 2023-09-28 15:14:33 +02:00 committed by GitHub
commit 2d98270c7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

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