forked from target/goalert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
101 lines (94 loc) · 2.98 KB
/
playwright.config.ts
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { devices } from '@playwright/test'
import { scanUniqueFlagCombos } from './test/integration/setup/scan-flags'
const dbURL = process.env.CI
? 'postgres://postgres@/goalert_integration?client_encoding=UTF8'
: 'postgres://goalert:goalert@localhost:5432/goalert_integration?client_encoding=UTF8'
const swoMainURL = process.env.CI
? 'postgres://postgres@/goalert_swo_main?client_encoding=UTF8'
: 'postgres://goalert:goalert@localhost:5432/goalert_swo_main?client_encoding=UTF8'
const swoNextURL = process.env.CI
? 'postgres://postgres@/goalert_swo_next?client_encoding=UTF8'
: 'postgres://goalert:goalert@localhost:5432/goalert_swo_next?client_encoding=UTF8'
const wsEnv = {
GOALERT_DB_URL: dbURL,
GOALERT_ENGINE_CYCLE_TIME: '50ms',
GOALERT_STRICT_EXPERIMENTAL: '1',
GOALERT_LOG_ERRORS_ONLY: '1',
GOCOVERDIR: process.env.GOCOVERDIR,
}
const config = {
testDir: './test/integration',
globalSetup: require.resolve('./test/integration/setup/global-setup.ts'),
globalTeardown: require.resolve(
'./test/integration/setup/global-teardown.ts',
),
retries: process.env.CI ? 3 : 0,
forbidOnly: !!process.env.CI, // fail CI if .only() is used
workers: process.env.CI ? 2 : undefined,
use: {
trace: process.env.CI ? 'on-first-retry' : 'retain-on-failure',
baseURL: 'http://localhost:6130',
viewport: { width: 1440, height: 900 },
timezoneId: 'America/Chicago',
launchOptions: {
// slowMo: 1000,
},
actionTimeout: 5000,
},
projects: [
{
name: 'chromium-wide',
use: {
...devices['Desktop Chrome'],
viewport: { width: 1440, height: 900 },
},
},
{
name: 'chromium-mobile',
use: {
...devices['Pixel 5'],
viewport: { width: 375, height: 667 },
},
},
],
webServer: [
{
command: './bin/tools/mailpit -l=localhost:6125 -s=localhost:6105',
port: 6125,
},
{
command: './bin/mockoidc -addr=127.0.0.1:9997',
port: 9997,
},
{
command:
'./bin/goalert.cover -l=localhost:6110 --public-url=http://localhost:6110', // switchover instance
env: {
...wsEnv,
GOALERT_DB_URL: swoMainURL,
GOALERT_DB_URL_NEXT: swoNextURL,
},
url: 'http://localhost:6110/health',
},
{
command: './bin/goalert.cover -l=localhost:6120', // no public url (fallback code)
env: { ...wsEnv, GOALERT_PUBLIC_URL: '' },
url: 'http://localhost:6120/health',
},
{
command:
'./bin/goalert.cover -l=localhost:6130 --public-url=http://localhost:6130',
env: wsEnv,
url: 'http://localhost:6130/health',
},
// generate a web server for each unique flag combination
...scanUniqueFlagCombos().map((flagStr, i) => ({
command: `./bin/goalert.cover -l=localhost:${
i + 6131
} --public-url=http://localhost:${i + 6131} --experimental=${flagStr}`,
env: wsEnv,
url: `http://localhost:${i + 6131}/health`,
})),
],
}
export default config