-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
230 lines (220 loc) · 5.22 KB
/
Copy pathplaywright.config.ts
File metadata and controls
230 lines (220 loc) · 5.22 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
import { defineConfig, devices } from "@playwright/test"
// Auth state file path (added to .gitignore)
const authFile = "e2e/.auth/user.json"
const frontdeskFile = "e2e/.auth/frontdesk.json"
const ticketsAttendeeFile = "e2e/.auth/tickets-attendee.json"
/**
* Playwright configuration for Buzz E2E tests.
*
* Uses the recommended "setup project" pattern for authentication:
* 1. Setup project runs first and saves auth state to file
* 2. Other projects depend on setup and reuse the stored auth state
*
* @see https://playwright.dev/docs/auth
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: "./e2e/tests",
fullyParallel: false, // Sequential for Frappe state consistency
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1, // Single worker for Frappe session management
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "html",
timeout: 60000,
expect: {
timeout: 10000,
},
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL: process.env.BASE_URL || "http://buzz.test:8000",
trace: "on-first-retry",
video: "retain-on-failure",
screenshot: "only-on-failure",
actionTimeout: 15000,
navigationTimeout: 30000,
},
/* Configure projects for major browsers */
projects: [
{
name: "setup",
testMatch: /auth\.setup\.ts/,
},
{
name: "event-setup",
testMatch: /event\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
name: "login-modal",
testMatch: /login-modal\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: { cookies: [], origins: [] },
},
dependencies: ["setup"],
},
{
name: "chromium",
testIgnore: /guest-booking|custom-forms|event-proposal|login-modal|check-in|tickets|language/,
use: {
...devices["Desktop Chrome"],
storageState: authFile,
},
dependencies: ["setup", "event-setup"],
},
{
name: "guest-event-setup",
testMatch: /guest-event\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
name: "guest-chromium",
testMatch: /guest-booking\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
},
dependencies: ["guest-event-setup"],
},
{
name: "custom-forms-setup",
testMatch: /custom-forms\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
name: "custom-forms-chromium",
testMatch: /custom-forms\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: authFile,
},
dependencies: ["custom-forms-setup"],
},
{
name: "event-proposal-setup",
testMatch: /event-proposal\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
name: "event-proposal-chromium",
testMatch: /event-proposal\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: authFile,
},
dependencies: ["event-proposal-setup"],
},
{
name: "check-in-setup",
testMatch: /check-in\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
name: "check-in-chromium",
testMatch: /check-in\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: frontdeskFile,
},
dependencies: ["check-in-setup"],
},
{
name: "tickets-setup",
testMatch: /tickets\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
name: "tickets-chromium",
testMatch: /tickets\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: ticketsAttendeeFile,
},
dependencies: ["tickets-setup"],
},
{
name: "language-setup",
testMatch: /language\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
// The guest specs in here drop the storage state per describe block.
name: "language-chromium",
testMatch: /language\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: authFile,
},
dependencies: ["language-setup"],
},
{
name: "offline-payment-setup",
testMatch: /offline-payment\.setup\.ts/,
use: {
storageState: authFile,
},
dependencies: ["setup"],
},
{
name: "offline-payment-chromium",
testMatch: /offline-payment\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: authFile,
},
dependencies: ["offline-payment-setup"],
},
// {
// name: "firefox",
// use: { ...devices["Desktop Firefox"] },
// },
// {
// name: "webkit",
// use: { ...devices["Desktop Safari"] },
// },
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://localhost:3000',
// reuseExistingServer: !process.env.CI,
// },
})