-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
60 lines (54 loc) · 1.42 KB
/
playwright.config.ts
File metadata and controls
60 lines (54 loc) · 1.42 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
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: 'tests/e2e',
testMatch: '**/*.e2e.{ts,js}',
fullyParallel: true,
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? 'github' : 'list',
timeout: 15_000,
use: {
trace: 'on-first-retry',
screenshot: 'only-on-failure'
},
projects: [
// Smoke: runs against dev server, any DB state
{
name: 'smoke',
testDir: 'tests/e2e/smoke',
use: {
...devices['Desktop Chrome'],
baseURL: 'http://localhost:5173'
}
},
// Deterministic: login once, save session
{
name: 'det-setup',
testDir: 'tests/e2e/deterministic',
testMatch: 'auth-setup.e2e.ts',
use: {
...devices['Desktop Chrome'],
baseURL: 'http://localhost:4173'
}
},
// Deterministic: all tests with saved auth
{
name: 'deterministic',
testDir: 'tests/e2e/deterministic',
testIgnore: 'auth-setup.e2e.ts',
dependencies: ['det-setup'],
use: {
...devices['Desktop Chrome'],
baseURL: 'http://localhost:4173',
storageState: 'test-data/auth/admin.json'
}
}
],
webServer: {
command: 'npm run build && npm run preview',
port: 4173,
reuseExistingServer: true,
timeout: 60_000,
env: { DATA_PATH: './test-data', ADMIN_PASSWORD: 'admin' }
}
});