-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
54 lines (50 loc) · 1.11 KB
/
playwright.config.ts
File metadata and controls
54 lines (50 loc) · 1.11 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { defineConfig, devices } from '@playwright/test'
import 'dotenv/config'
const PORT = process.env.PORT || '3006'
const WORKERS = process.env.PW_WORKERS
? Number(process.env.PW_WORKERS)
: 1
const RETRIES = process.env.PW_RETRIES
? Number(process.env.PW_RETRIES)
: process.env.CI
? 2
: 1
const TEST_TIMEOUT = process.env.PW_TEST_TIMEOUT
? Number(process.env.PW_TEST_TIMEOUT)
: 30_000
const EXPECT_TIMEOUT = process.env.PW_EXPECT_TIMEOUT
? Number(process.env.PW_EXPECT_TIMEOUT)
: 10_000
export default defineConfig({
testDir: './tests/e2e',
timeout: TEST_TIMEOUT,
expect: {
timeout: EXPECT_TIMEOUT,
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: RETRIES,
workers: WORKERS,
reporter: 'list',
use: {
baseURL: `http://localhost:${PORT}/`,
headless: true,
actionTimeout: 10_000,
navigationTimeout: 20_000,
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
],
webServer: {
command: 'E2E=true pnpm run dev',
url: 'http://localhost:3006',
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
})