-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
108 lines (106 loc) · 3.01 KB
/
Copy pathplaywright.config.ts
File metadata and controls
108 lines (106 loc) · 3.01 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
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
102
103
104
105
106
107
108
import { defineConfig } from '@playwright/test';
import path from 'path';
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? 'http://localhost:4173';
const chromiumExecutablePath = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH;
export default defineConfig({
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: 60_000,
retries: 2,
expect: {
timeout: 10_000
},
use: {
baseURL,
trace: 'retain-on-failure',
video: 'retain-on-failure'
},
webServer: [
{
command: 'npx tsx e2e/support/start-mock-oidc.ts',
url: 'http://localhost:9090/.well-known/openid-configuration',
reuseExistingServer: true
},
{
command: 'npx tsx e2e/support/start-mock-trino.ts',
url: 'http://localhost:8080',
reuseExistingServer: true
},
{
command: 'PORT=4173 node --env-file=.env.test build',
url: baseURL,
reuseExistingServer: true
}
],
projects: [
// Each browser project gets its own auth setup so that parallel workers
// log in as different users. This prevents cross-worker races on shared
// server-side state (e.g. the in-memory Trino connection store).
{
name: 'setup-chromium',
testMatch: /auth\.setup\.ts/,
use: {
browserName: 'chromium',
viewport: { width: 1280, height: 720 }
}
},
{
name: 'setup-firefox',
testMatch: /auth\.setup\.ts/,
use: {
browserName: 'firefox',
viewport: { width: 1280, height: 720 }
}
},
...(!process.env.CI
? [
{
name: 'setup-mobile',
testMatch: /auth\.setup\.ts/,
use: {
browserName: 'chromium' as const,
viewport: { width: 393, height: 851 }
}
}
]
: []),
{
name: 'firefox',
use: {
browserName: 'firefox',
viewport: { width: 1280, height: 720 },
storageState: 'e2e/.auth/user-setup-firefox.json'
},
dependencies: ['setup-firefox']
},
{
name: 'chromium',
use: {
browserName: 'chromium',
viewport: { width: 1280, height: 720 },
storageState: 'e2e/.auth/user-setup-chromium.json',
...(chromiumExecutablePath && { launchOptions: { executablePath: chromiumExecutablePath } })
},
dependencies: ['setup-chromium']
},
...(!process.env.CI
? [
{
name: 'mobile',
use: {
browserName: 'chromium' as const,
viewport: { width: 393, height: 851 },
isMobile: true,
hasTouch: true,
storageState: 'e2e/.auth/user-setup-mobile.json',
...(chromiumExecutablePath && {
launchOptions: { executablePath: chromiumExecutablePath }
})
},
dependencies: ['setup-mobile']
}
]
: [])
]
});