-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathplaywright.config.js
More file actions
37 lines (34 loc) · 992 Bytes
/
Copy pathplaywright.config.js
File metadata and controls
37 lines (34 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig, devices } from '@playwright/test';
const isCI = process.env.CI === 'true';
// CI uses production build, local development uses dev server
const url = isCI ? 'http://localhost:4173' : 'http://localhost:5173';
export default defineConfig( {
testDir: './e2e',
// Narrower than the default, which also claims `*.test.js` — those belong to
// Vitest, which covers the non-spec helpers in this directory.
testMatch: '**/*.spec.js',
outputDir: './e2e/test-results',
fullyParallel: true,
workers: isCI ? 1 : undefined,
retries: isCI ? 2 : 0,
timeout: 60_000,
reporter: isCI ? 'list' : 'html',
use: {
baseURL: url,
actionTimeout: 10_000,
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices[ 'Desktop Chrome' ] },
},
],
webServer: {
// CI uses production build, local development uses dev server
command: isCI ? 'npm run preview' : 'npm run dev',
url,
reuseExistingServer: ! isCI,
timeout: 30_000,
},
} );