Skip to content

Commit

Permalink
chore: update playwright config
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaclen committed Sep 20, 2024
1 parent 24ec385 commit 5f29603
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -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 = [
{
Expand All @@ -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'
Expand Down

0 comments on commit 5f29603

Please sign in to comment.