From 5f29603478504ef5b5884619242a8603588b8b3c Mon Sep 17 00:00:00 2001 From: Fernando Maclen Date: Fri, 20 Sep 2024 11:27:07 -0400 Subject: [PATCH] chore: update playwright config --- .github/workflows/test.yml | 11 +++++++---- playwright.config.ts | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64041cb..04c6ec1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,17 +7,20 @@ on: jobs: test: name: Playwright - timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' - name: Install dependencies run: npm ci + - name: Install Playwright Browsers run: npx playwright install --with-deps + - name: Run Playwright tests run: npm test env: - NODE_ENV: CI + CI: true diff --git a/playwright.config.ts b/playwright.config.ts index b794885..877e2f1 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,6 +1,6 @@ import { type PlaywrightTestConfig, devices } from '@playwright/test'; -const isEnvCI = process.env.NODE_ENV === 'CI'; +const isEnvCI = process.env.CI; const enableMultipleBrowsers = [ { @@ -22,7 +22,8 @@ const config: PlaywrightTestConfig = { command: 'npm run dev', port: 5173 }, - retries: isEnvCI ? 3 : 0, + workers: isEnvCI ? 1 : undefined, + retries: isEnvCI ? 2 : 0, use: { trace: isEnvCI ? 'off' : 'retain-on-failure', screenshot: isEnvCI ? 'off' : 'only-on-failure'