Repository navigation
Expand file tree
/
Copy pathplaywright.config.js
More file actions
55 lines (53 loc) · 2.33 KB
/
Copy pathplaywright.config.js
File metadata and controls
55 lines (53 loc) · 2.33 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
const { defineConfig, devices } = require('@playwright/test');
module.exports = defineConfig({
testDir: './tests/playwright/specs',
fullyParallel: true,
// Several regionSelector specs navigate many times in a single test
// (once per dashboard, sometimes nested); the 30s default is too tight.
timeout: 60000,
// The dev server's first request for any given route recompiles and
// dependency-scans on demand (a documented Vite dev-server characteristic),
// which can outrun the 5s default under concurrent load.
expect: {
timeout: 10000,
},
// A first-time route visit against the dev server can occasionally be
// slow enough to miss the expect timeout; one local retry absorbs
// that without masking a genuinely broken assertion.
retries: process.env.CI ? 2 : 1,
// Uncapped local parallelism overloads the single shared dev server
// enough to cause real navigation stalls, not just slow first loads.
workers: process.env.CI ? 2 : 4,
reporter: process.env.CI ? 'github' : 'line',
use: {
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:3000',
trace: 'on-first-retry',
},
// Only start a local dev server when targeting it - PLAYWRIGHT_BASE_URL
// points at a remote site (e.g. stage/prod), which needs no local
// toolchain or port 3000 at all.
webServer: process.env.PLAYWRIGHT_BASE_URL ? undefined : {
// npm start, not watch:app alone - a fresh checkout has no compiled
// CSS yet (src/components/views/css/ is gitignored), and watch:app on
// its own never runs the Stylus build that produces it.
command: 'npm start',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
// Chromium only, matching the nightwatch.conf.js we migrated from
// (`desiredCapabilities: { browserName: 'chrome' }` in both of its
// environments) - this migration ports that existing coverage, it doesn't
// expand it.
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
testIgnore: '**/jsDisabled.spec.js',
},
{
name: 'chromium-no-js',
use: { ...devices['Desktop Chrome'], javaScriptEnabled: false },
testMatch: '**/jsDisabled.spec.js',
},
],
});