-
-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
72 lines (70 loc) · 2.46 KB
/
Copy pathplaywright.config.ts
File metadata and controls
72 lines (70 loc) · 2.46 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
import { defineConfig } from '@playwright/test'
import { OWNER_STATE_FILE } from './tests/e2e/helpers/constants'
const ADMIN_BASE_URL = process.env.E2E_ADMIN_BASE_URL ?? 'http://127.0.0.1:5174'
process.env.E2E_PUBLIC_BASE_URL ??= 'http://127.0.0.1:3002'
const LOCAL_TRACE = process.env.E2E_TRACE === '1'
const LOCAL_VIDEO = process.env.E2E_VIDEO === '1'
export default defineConfig({
testDir: './tests/e2e',
testMatch: '**/*.e2e.ts',
outputDir: '.tmp/playwright-results',
fullyParallel: false,
workers: 1,
timeout: 60_000,
expect: {
timeout: 10_000,
},
retries: process.env.CI ? 1 : 0,
reporter: [
['list'],
['html', { open: 'never', outputFolder: '.tmp/playwright-report' }],
],
use: {
baseURL: ADMIN_BASE_URL,
screenshot: 'only-on-failure',
// The full single-worker suite keeps every open SSE request in a trace.
// Recording every local test can therefore consume gigabytes before the
// worker finishes and discards passing artifacts. Keep local capture opt-in;
// CI records only the first retry, where an artifact is actionable.
trace: process.env.CI ? 'on-first-retry' : LOCAL_TRACE ? 'retain-on-failure' : 'off',
video: process.env.CI ? 'on-first-retry' : LOCAL_VIDEO ? 'retain-on-failure' : 'off',
},
// The disposable DB is set up once per run, so first-run setup runs in its own
// `setup` project. Dashboard preflight then verifies clean-install facts before
// persona/capability specs mutate site-wide users and plugins. `personas` creates
// accounts used by destructive self-management specs; those specs must never
// revoke the shared owner session that ordinary specs reuse.
projects: [
{
name: 'setup',
testMatch: /auth\.setup\.ts$/,
},
{
name: 'dashboard-preflight',
testMatch: /dashboard\.e2e\.ts$/,
dependencies: ['setup'],
use: { storageState: OWNER_STATE_FILE },
},
{
name: 'personas',
testMatch: /account-persona\.setup\.ts$/,
dependencies: ['dashboard-preflight'],
},
{
name: 'e2e',
testMatch: '**/*.e2e.ts',
testIgnore: /dashboard\.e2e\.ts$/,
dependencies: ['setup', 'personas'],
use: { storageState: OWNER_STATE_FILE },
},
],
webServer: {
command: 'bun run e2e:dev',
url: ADMIN_BASE_URL,
reuseExistingServer: process.env.E2E_REUSE_SERVER === '1',
timeout: 120_000,
gracefulShutdown: { signal: 'SIGTERM', timeout: 500 },
stdout: 'pipe',
stderr: 'pipe',
},
})