-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
214 lines (208 loc) · 6.51 KB
/
playwright.config.ts
File metadata and controls
214 lines (208 loc) · 6.51 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
import { defineConfig, devices } from "@playwright/test";
import { testPlanFilter } from "allure-playwright/dist/testplan";
import environments from "lib/constants/environments";
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/**TODO: Remove this timeout *
* It has been intentionally used to slow loading of govtool.
*/
timeout: process.env.NETWORK === "preview" ? 180_000 : 90_000,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!environments.ci,
/* Retry on CI only */
retries: 0,
/* Opt out of parallel tests on CI. */
workers: environments.ci ? parseInt(process.env.TEST_WORKERS) : undefined,
/*use Allure Playwright's testPlanFilter() to determine the grep parameter*/
grep: testPlanFilter(),
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: environments.ci ? [["line"], ["allure-playwright"]] : [["line"]],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: environments.frontendUrl,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
screenshot: "only-on-failure",
// video: "on",
},
/* Configure projects for major browsers */
projects: [
{
name: "wallet bootstrap",
testMatch: "**/wallet.bootstrap.ts",
teardown: environments.ci && "cleanup faucet",
},
{
name: "user auth setup",
testMatch: "**/user.auth.setup.ts",
},
{
name: "adaholder auth setup",
testMatch: "**/adaholder.auth.setup.ts",
dependencies: environments.ci ? ["wallet bootstrap"] : [],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "dRep auth setup",
testMatch: "**/dRep.auth.setup.ts",
},
{
name: "proposal discussion auth setup",
testMatch: "**/proposal-discussion.auth.setup.ts",
},
{
name: "budget proposal auth setup",
testMatch: "**/proposal-budget.auth.setup.ts",
teardown: environments.ci && "cleanup faucet",
},
{
name: "proposal submission ga auth setup",
testMatch: "**/proposal-submission.ga.auth.setup.ts",
dependencies: environments.ci ? ["proposal setup"] : [],
teardown: environments.ci && "cleanup faucet",
},
{
name: "dRep setup",
testMatch: "**/dRep.setup.ts",
dependencies: environments.ci ? ["wallet bootstrap"] : [],
teardown: environments.ci && "cleanup dRep",
},
{
name: "budget proposal dRep setup",
testMatch: "**/proposal-budget.dRep.setup.ts",
teardown: environments.ci && "cleanup dRep",
},
{
name: "proposal setup",
testMatch: "**/proposal.setup.ts",
teardown: environments.ci && "cleanup faucet",
},
{
name: "proposal discussion",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.pd.spec.ts",
testIgnore: ["**/*.loggedin.pd.spec.ts"],
dependencies: environments.ci
? ["proposal discussion auth setup"]
: [],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "proposal discussion (loggedin)",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.loggedin.pd.spec.ts",
dependencies: environments.ci
? ["proposal discussion auth setup", "user auth setup"]
: [],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "budget proposal",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.pb.spec.ts",
dependencies: environments.ci
? ["budget proposal auth setup"]
: [],
testIgnore: ["**/*.dRep.pb.spec.ts"],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "proposal submission",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.ga.spec.ts",
dependencies: environments.ci
? ["proposal submission ga auth setup"]
: [],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "loggedin (desktop)",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.loggedin.spec.ts",
dependencies: environments.ci ? ["user auth setup"] : [],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "budget proposal dRep",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.dRep.pb.spec.ts",
dependencies: environments.ci
? ["budget proposal auth setup","budget proposal dRep setup"]
: [],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "dRep",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.dRep.spec.ts",
dependencies: environments.ci
? ["dRep auth setup" , "dRep setup"]
: [],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "delegation",
use: { ...devices["Desktop Chrome"] },
testMatch: "**/*.delegation.spec.ts",
dependencies: environments.ci
? ["adaholder auth setup","dRep auth setup"]
: [],
teardown: environments.ci && "cleanup delegation",
},
{
name: "independent (desktop)",
use: { ...devices["Desktop Chrome"] },
testIgnore: [
"**/*.delegation.spec.ts",
"**/*.loggedin.spec.ts",
"**/*.dRep.spec.ts",
"**/*.tx.spec.ts",
"**/*.ga.spec.ts",
"**/*.pd.spec.ts",
"**/*.pb.spec.ts",
],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "mobile",
use: { ...devices["Pixel 5"] },
testIgnore: [
"**/*.loggedin.spec.ts",
"**/*.dRep.spec.ts",
"**/*.delegation.spec.ts",
"**/*.tx.spec.ts",
"**/*.ga.spec.ts",
"**/*.pd.spec.ts",
"**/*.pb.spec.ts",
"**/walletConnect.spec.ts",
],
teardown: environments.ci && "cleanup artifacts",
},
{
name: "cleanup delegation",
testMatch: "delegation.teardown.ts",
},
{
name: "cleanup dRep",
testMatch: "dRep.teardown.ts",
},
{
name: "cleanup faucet",
testMatch: "faucet.teardown.ts",
},
{
name: "cleanup artifacts",
testMatch: "generated-artifacts.teardown.ts",
},
],
});