-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathplaywright.dev.config.ts
More file actions
60 lines (59 loc) · 2.08 KB
/
Copy pathplaywright.dev.config.ts
File metadata and controls
60 lines (59 loc) · 2.08 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
import { defineConfig, devices } from '@playwright/test'
export default defineConfig({
testDir: './test/e2e',
fullyParallel: false, // Single worker for debugging
forbidOnly: false, // Allow .only() in dev mode
retries: 0, // No retries in dev mode
workers: 1, // Single worker for better debugging
timeout: 60000, // Longer timeout for debugging
reporter: [
['list'], // Detailed list output
['html', { open: 'on-failure' }], // Auto-open HTML report on failure
],
use: {
// Prefer explicit IPv4 loopback to avoid environments where `localhost`
// resolves to IPv6 (::1) but the app only listens on 127.0.0.1.
baseURL: 'http://127.0.0.1:20000',
trace: 'on', // Always collect traces in dev mode
screenshot: 'on', // Always take screenshots
video: 'on', // Always record videos
headless: false, // Run in headed mode for debugging
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
actionTimeout: 30000, // Longer timeouts for debugging
navigationTimeout: 60000,
// Slow down actions for better visibility
launchOptions: {
slowMo: 250,
},
},
// Only Chrome for development
projects: [
{
name: 'chrome-debug',
use: {
...devices['Desktop Chrome'],
viewport: { width: 1280, height: 720 },
// Additional Chrome flags for debugging
launchOptions: {
slowMo: 250,
args: ['--disable-web-security', '--disable-features=VizDisplayCompositor'],
},
},
},
],
webServer: {
// Keep a long-lived process so Playwright's webServer harness doesn't fail
// with "exited early" when the app is already running (e.g. via Docker).
command: 'bash -lc "curl -fsS http://127.0.0.1:20000/api/ping >/dev/null && tail -f /dev/null"',
url: 'http://127.0.0.1:20000',
reuseExistingServer: true,
timeout: 10000,
},
outputDir: 'test-results-dev/',
expect: {
timeout: 15000, // Longer expect timeout for debugging
},
// Global setup for development (optional)
// globalSetup: require.resolve('./test/e2e/global-setup-dev.ts'),
})