Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
67 lines (65 loc) · 2.05 KB
/
Copy pathplaywright.config.ts
File metadata and controls
67 lines (65 loc) · 2.05 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
import { defineConfig } from '@playwright/test';
import path from 'path';
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? 'http://localhost:4173';
const appPort = new URL(baseURL).port || '80';
const chromiumExecutablePath = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH;
export default defineConfig({
// Each worker logs in as its own user (see e2e/support/fixtures.ts), so
// tests can run in parallel without racing on per-user server-side state.
fullyParallel: true,
// CI runners have few cores; keep their load low.
workers: process.env.CI ? 2 : 4,
testDir: path.join(import.meta.dirname, 'e2e'),
outputDir: path.join(import.meta.dirname, 'e2e/test-results'),
globalSetup: path.join(import.meta.dirname, 'e2e/support/global-setup.ts'),
timeout: 20_000,
globalTimeout: 40 * 60_000,
retries: 2,
expect: {
timeout: 10_000
},
use: {
baseURL,
trace: process.env.CI ? 'on-first-retry' : 'retain-on-failure',
screenshot: 'only-on-failure'
},
webServer: [
{
command: 'npx tsx e2e/support/start-mock-oidc.ts',
url: 'http://localhost:19090/.well-known/openid-configuration',
reuseExistingServer: false
},
{
command: 'npx tsx e2e/support/start-mock-trino.ts',
url: 'http://localhost:18080',
reuseExistingServer: false
},
{
command: 'npx tsx e2e/support/start-app.ts',
env: { PORT: appPort },
url: baseURL,
timeout: 300_000,
// App logs drown out the test output; set E2E_SERVER_LOGS=1 to see them.
stdout: process.env.E2E_SERVER_LOGS ? 'pipe' : 'ignore',
gracefulShutdown: { signal: 'SIGTERM', timeout: 30_000 },
reuseExistingServer: false
}
],
projects: [
{
name: 'firefox',
use: {
browserName: 'firefox',
viewport: { width: 1280, height: 720 }
}
},
{
name: 'chromium',
use: {
browserName: 'chromium',
viewport: { width: 1280, height: 720 },
...(chromiumExecutablePath && { launchOptions: { executablePath: chromiumExecutablePath } })
}
}
]
});