-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
51 lines (49 loc) · 1.45 KB
/
playwright.config.ts
File metadata and controls
51 lines (49 loc) · 1.45 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
import { defineConfig, devices } from '@playwright/test'
import { createRequire } from 'module'
// Import ports from ecosystem config (single source of truth)
const require = createRequire(import.meta.url)
const { PORTS } = require('./ecosystem.config.cjs')
export default defineConfig({
testDir: './e2e',
globalSetup: './e2e/global-setup.ts',
globalTeardown: './e2e/global-teardown.ts',
fullyParallel: false, // Run tests sequentially for data integrity
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1, // Single worker to avoid data conflicts
reporter: [
['html', { outputFolder: 'packages/web/public/playwright-report', open: 'never' }],
['list']
],
use: {
baseURL: `http://localhost:${PORTS.WEB}`,
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: [
{
command: 'npm run dev:api',
url: `http://localhost:${PORTS.API}/api/health`,
reuseExistingServer: !process.env.CI,
timeout: 30000,
},
{
command: 'npm run dev:web',
url: `http://localhost:${PORTS.WEB}`,
reuseExistingServer: !process.env.CI,
timeout: 30000,
},
],
// Use generous timeouts in CI, faster locally for quick feedback
timeout: process.env.CI ? 30000 : 15000,
expect: {
timeout: process.env.CI ? 10000 : 5000,
},
})