-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
149 lines (133 loc) · 5.19 KB
/
Copy pathplaywright.config.ts
File metadata and controls
149 lines (133 loc) · 5.19 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import { defineConfig, devices } from '@playwright/test';
/**
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: './tests/e2e',
/* 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,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [['html', { outputFolder: 'test-artifacts/reports/playwright-report' }]],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.TEST_URL || 'https://localhost:3128',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
/* Screenshot options */
screenshot: { mode: 'only-on-failure', fullPage: true },
/* Ignore HTTPS errors for self-signed certificates in development */
ignoreHTTPSErrors: true,
},
/* Where Playwright writes per-test artifacts (videos, screenshots, traces).
* The showcase report generator reads from here. */
outputDir: 'test-artifacts/playwright-output',
/* Configure projects for major browsers */
projects: [
{
name: 'GraphDone-Core/dev-neo4j/chromium',
// The showcase tour and the local-VLM visual eval run in their own
// capture-heavy projects below; keep them out of the default (fast)
// project so the smoke gate stays quick.
testIgnore: [/showcase\.spec\.ts/, /visual-vlm\.spec\.ts/],
use: { ...devices['Desktop Chrome'] },
},
/* Showcase: records web-friendly .webm video + full-page screenshots of
* every mode of operation, across the responsive viewport matrix. Run via
* `npm run report:showcase`. Heavy by design — not part of the smoke gate. */
{
name: 'showcase',
testMatch: /showcase\.spec\.ts/,
use: {
...devices['Desktop Chrome'],
video: 'on',
screenshot: 'on',
trace: 'retain-on-failure',
},
},
/* Performance budgets (ADAPT-8). Lives in tests/perf, run via
* `npm run test:perf`. Reads window.__graphPerf / API latency and asserts
* budgets. Kept separate from the smoke gate so it can have its own
* thresholds and run cadence. */
{
name: 'perf',
testDir: './tests/perf',
// The large-scale sweep is heavy and report-only; it has its own project
// so `test:perf` (the budget gate) stays fast.
testIgnore: /scale-sweep\.spec\.ts/,
use: { ...devices['Desktop Chrome'] },
},
/* Large-scale graph creation + performance metric sweep. Seeds graphs of
* increasing size and records window.__graphPerf across them. Heavy +
* report-only; run via `npm run test:perf:scale`. */
{
name: 'perf-scale',
testDir: './tests/perf',
testMatch: /scale-sweep\.spec\.ts/,
use: { ...devices['Desktop Chrome'] },
},
/* Local-VLM visual evaluation across personas. Skips unless VLM_ENDPOINTS
* is set in .env.test.local. Run via `npm run test:vlm`. */
{
name: 'vlm',
testDir: './tests/e2e',
testMatch: /visual-vlm\.spec\.ts/,
use: { ...devices['Desktop Chrome'], screenshot: 'on' },
},
/* Graph-geometry diagnostics: measures node/edge/label geometry from the
* rendered DOM (edge attachment, label fit, overlaps) to SEE layout issues
* before/after a fix. Report-only. Run via `npm run test:geometry`. */
{
name: 'geometry',
testDir: './tests/diagnostics',
use: { ...devices['Desktop Chrome'], screenshot: 'on' },
},
// Commented out until browsers installed with system dependencies
// {
// name: 'GraphDone-Core/dev-neo4j/firefox',
// use: { ...devices['Desktop Firefox'] },
// },
// {
// name: 'GraphDone-Core/dev-neo4j/webkit',
// use: { ...devices['Desktop Safari'] },
// },
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],
/* Auto-start a dev server ONLY for bare local runs. When TEST_URL is set
* (run-pr-tests, CI, ./start test) the stack is externally managed —
* webServer must stay off, or CI=true makes Playwright refuse the already
* -running server ("port is already used") and every suite dies at
* collection. That one interaction silently killed the whole E2E gate. */
...(process.env.TEST_URL
? {}
: {
webServer: {
command: 'npm run dev',
url: 'http://localhost:3127',
reuseExistingServer: !process.env.CI,
},
}),
});