Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
50 lines (48 loc) · 1.85 KB
/
Copy pathplaywright.config.ts
File metadata and controls
50 lines (48 loc) · 1.85 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
import { defineConfig, devices } from '@playwright/test'
const PORT = Number(process.env.PLAYWRIGHT_WEB_PORT ?? 5179)
const BASE_URL = `http://localhost:${PORT}`
export default defineConfig({
testDir: './e2e',
// Peer-stack specs need HAPI_PEER_* + mirror tooling; run via playwright.peer.config.ts only.
testIgnore: ['**/peer/**'],
timeout: 30_000,
expect: { timeout: 5_000 },
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'list',
use: {
baseURL: BASE_URL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
launchOptions: {
// The CI runner and most sandboxed dev environments
// run as root or under restricted user namespaces;
// without --no-sandbox chromium silently exits 0 a
// few seconds after launch and the page handshake
// times out. Keep the flag scoped to launchOptions
// so this is the only place a future maintainer has
// to revisit if they harden the runner.
args: ['--no-sandbox'],
},
},
},
],
webServer: {
// The fixture page mounts ScratchlistPanel in isolation; no hub
// is required, which is why this dev server doesn't proxy /api.
command: `bun run --cwd web dev -- --port ${PORT} --strictPort`,
url: `${BASE_URL}/e2e-fixtures/scratchlist-fixture.html`,
timeout: 60_000,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe',
},
})