-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
87 lines (76 loc) · 2.14 KB
/
playwright.config.ts
File metadata and controls
87 lines (76 loc) · 2.14 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { defineConfig, devices } from '@playwright/test'
/**
* Playwright configuration for Kickoff multiplayer testing
*/
export default defineConfig({
testDir: './tests',
fullyParallel: true, // Enable parallel execution with isolated test rooms
forbidOnly: !!process.env.CI,
// Smart retry strategy
retries: process.env.CI ? 2 : 1,
// Workers — CI overrides via --workers=4; locally Playwright auto-detects (cpus/2)
workers: undefined,
// Global timeout
timeout: 90000,
// Expect timeout
expect: {
timeout: 10000,
},
// Multiple reporters
reporter: [
['html', { open: 'never' }],
['json', { outputFile: 'test-results/results.json' }],
['list'],
],
use: {
baseURL: 'http://localhost:5174', // Test port (dev uses 5173)
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
hasTouch: false,
// Action timeout
actionTimeout: 30000,
// Navigation timeout
navigationTimeout: 60000,
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
hasTouch: false, // Disable touch emulation to prevent fullscreen splash overlay
launchOptions: {
args: [
'--disable-dev-shm-usage',
'--disable-blink-features=AutomationControlled',
'--disable-web-security',
'--disable-features=IsolateOrigins,site-per-process',
'--disable-gpu',
'--disable-background-timer-throttling', // Prevent requestAnimationFrame throttling
'--disable-backgrounding-occluded-windows',
'--disable-renderer-backgrounding',
],
},
},
},
],
// Auto-start test servers with isolated ports
webServer: [
{
command: 'npm run dev:server:test',
url: 'http://localhost:3001/health',
timeout: 60 * 1000,
reuseExistingServer: false,
stdout: 'pipe',
stderr: 'pipe',
},
{
command: 'npm run dev:client:test',
url: 'http://localhost:5174',
timeout: 120 * 1000,
reuseExistingServer: false,
stdout: 'pipe',
stderr: 'pipe',
},
],
})