-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
68 lines (56 loc) · 1.88 KB
/
playwright.config.js
File metadata and controls
68 lines (56 loc) · 1.88 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
// @ts-check
const {
defineConfig,
devices
} = require('@playwright/test');
/**
* Playwright configuration for BalatroBench test suite
* Optimized for fast, headless testing of static web application
*
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
// Look for test files in the tests directory
testDir: './tests',
// Run tests in files in parallel
fullyParallel: true,
// Fail the build on CI if you accidentally left test.only in the source code
forbidOnly: !!process.env.CI,
// No retries for faster testing (static site should be reliable)
retries: 0,
// Single worker for speed (static site, no backend contention)
workers: 10,
// Reporter to use - dot gives concise output
reporter: 'dot',
use: {
// Base URL for tests - all page navigations will be relative to this
baseURL: 'http://localhost:8000',
// Collect trace on failure for debugging
trace: 'on-first-retry',
// Screenshot on failure
screenshot: 'only-on-failure',
// Reasonable timeout for static site (10 seconds)
actionTimeout: 10000,
},
// Configure projects for Chromium only (fast, single browser)
projects: [{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Force headless mode for speed
headless: true,
},
}, ],
// Auto-start local dev server before running tests
webServer: {
// Use Python's built-in HTTP server (no dependencies needed)
command: 'python3 -m http.server 8000 --directory site',
url: 'http://localhost:8000',
reuseExistingServer: !process.env.CI,
// Give the server time to start
timeout: 5000,
// Suppress server logs for cleaner test output
stdout: 'ignore',
stderr: 'ignore',
},
});