-
Notifications
You must be signed in to change notification settings - Fork 253
/
Copy pathplaywright.config.ts
82 lines (77 loc) · 2.25 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
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 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,
use: {
trace: 'on-first-retry',
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/MailHog -ui-bind-addr=localhost:6125 -api-bind-addr=localhost:6125 -smtp-bind-addr=localhost:6105 >/dev/null 2>&1',
port: 6125,
},
{
command: './bin/mockoidc -addr=127.0.0.1:9997',
port: 9997,
},
{
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