-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplaywright.local.config.ts
More file actions
59 lines (55 loc) · 1.79 KB
/
Copy pathplaywright.local.config.ts
File metadata and controls
59 lines (55 loc) · 1.79 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
import { defineConfig, devices, type ReporterDescription } from '@playwright/test'
import * as dotenv from 'dotenv'
import * as path from 'path'
import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
dotenv.config({ path: path.resolve(__dirname, 'e2e/local.config.env') })
process.env.E2E_USE_REAL_BACKEND = 'true'
process.env.E2E_GWS_FLOWS_HOST = process.env.E2E_GWS_FLOWS_HOST || 'http://localhost:7777'
// See playwright.demo.config.ts for the full reporter rationale; the same
// stack runs against the local gws-flows + ZenPayroll proxy so output shape
// stays consistent across environments.
const reporters: ReporterDescription[] = [
['list'],
['html'],
['./e2e/reporters/scenario-reporter.ts'],
]
if (process.env.GITHUB_ACTIONS === 'true') {
reporters.push(['github'])
}
export default defineConfig({
globalSetup: './e2e/globalSetup.ts',
testDir: './e2e/tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: 2,
// Run sequentially everywhere: the scenario fixture caches a provisioned
// demo company per worker, so running multiple workers means multiple
// demo creations for tests that share a scenario ID. With workers: 1
// the worker-scoped cache effectively becomes suite-scoped. Override
// locally with --workers=N for parallel debugging of independent
// scenarios.
workers: 1,
reporter: reporters,
timeout: 120_000,
expect: {
timeout: 30_000,
},
use: {
baseURL: 'http://localhost:5173',
trace: 'on-first-retry',
video: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'npm run e2e:serve',
url: 'http://localhost:5173',
reuseExistingServer: true,
timeout: 120_000,
},
})