-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
82 lines (74 loc) · 2.07 KB
/
playwright.config.ts
File metadata and controls
82 lines (74 loc) · 2.07 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
/**
* Playwright configuration — ForgePilot Canonical Test Doctrine v1.0.0
*
* Projects:
* forgepilot-e2e → tests/e2e/forgepilot/ (full user-journey E2E)
* site-smoke → tests/e2e/site/ (keon.systems smoke + link integrity)
* component → tests/component/ (UI unit / truthfulness / obs)
*
* Run targets:
* npx playwright test --project=forgepilot-e2e
* npx playwright test --project=site-smoke
* npx playwright test --project=component
*/
import { defineConfig, devices } from '@playwright/test'
const BASE_URL = process.env['BASE_URL'] ?? 'http://localhost:3000'
const SITE_URL = process.env['SITE_URL'] ?? 'https://keon.systems'
export default defineConfig({
testDir: './tests',
/* Only pick up .spec.ts files — never collide with Python tests/test_*.py */
testMatch: '**/*.spec.ts',
fullyParallel: true,
forbidOnly: !!process.env['CI'],
retries: process.env['CI'] ? 2 : 0,
workers: process.env['CI'] ? 2 : undefined,
timeout: 30_000,
expect: { timeout: 8_000 },
reporter: [
['list'],
['html', { outputFolder: 'playwright-report', open: 'never' }],
['json', { outputFile: 'playwright-report/results.json' }],
],
use: {
baseURL: BASE_URL,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'forgepilot-e2e',
testDir: './tests/e2e/forgepilot',
use: {
...devices['Desktop Chrome'],
baseURL: BASE_URL,
},
},
{
name: 'site-smoke',
testDir: './tests/e2e/site',
use: {
...devices['Desktop Chrome'],
baseURL: SITE_URL,
},
},
{
name: 'component',
testDir: './tests/component',
use: {
...devices['Desktop Chrome'],
baseURL: BASE_URL,
},
},
],
/* Start Next.js dev server for local runs against forgepilot-e2e and component */
webServer: {
command: 'npm run dev',
url: BASE_URL,
reuseExistingServer: !process.env['CI'],
timeout: 120_000,
env: {
NODE_ENV: 'test',
},
},
})