/
cypress.schema.json
383 lines (383 loc) · 16.1 KB
/
cypress.schema.json
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
{
"title": "JSON schema for the https://cypress.io Test Runner's configuration file. Details at https://on.cypress.io/configuration",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"definitions": {
"cypressConfig": {
"properties": {
"baseUrl": {
"type": "string",
"default": null,
"description": "Url used as prefix for cy.visit() or cy.request() command’s url. Example http://localhost:3030 or https://test.my-domain.com"
},
"env": {
"type": "object",
"description": "Any values to be set as environment variables. See https://on.cypress.io/environment-variables",
"body": {}
},
"ignoreTestFiles": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
},
"description": "A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: {dot: true, matchBase: true}. We suggest using http://globtester.com to test what files would match."
},
"numTestsKeptInMemory": {
"type": "number",
"default": 50,
"description": "The number of tests for which snapshots and command data are kept in memory. Reduce this number if you are experiencing high memory consumption in your browser during a test run."
},
"port": {
"type": "number",
"default": null,
"description": "Port used to host Cypress. Normally this is a randomly generated port"
},
"reporter": {
"type": "string",
"default": "spec",
"description": "The reporter used when running headlessly or in CI. See https://on.cypress.io/reporters"
},
"reporterOptions": {
"type": "object",
"default": null,
"description": "The reporter options used. Supported options depend on the reporter. See https://on.cypress.io/reporters#Reporter-Options"
},
"slowTestThreshold": {
"type": "number",
"default": 10000,
"description": "Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold. See https://on.cypress.io/configuration#Timeouts"
},
"testFiles": {
"type": [
"string",
"array"
],
"default": "**/*.*",
"description": "A String or Array of string glob patterns of the test files to load. See https://on.cypress.io/configuration#Global"
},
"watchForFileChanges": {
"type": "boolean",
"default": true,
"description": "Whether Cypress will watch and restart tests on test file changes"
},
"defaultCommandTimeout": {
"type": "number",
"default": 4000,
"description": "Time, in milliseconds, to wait until most DOM based commands are considered timed out"
},
"execTimeout": {
"type": "number",
"default": 60000,
"description": "Time, in milliseconds, to wait for a system command to finish executing during a cy.exec() command"
},
"taskTimeout": {
"type": "number",
"default": 60000,
"description": "Time, in milliseconds, to wait for a task to finish executing during a cy.task() command"
},
"pageLoadTimeout": {
"type": "number",
"default": 60000,
"description": "Time, in milliseconds, to wait for page transition events or cy.visit(), cy.go(), cy.reload() commands to fire their page load events. Network requests are limited by the underlying operating system, and may still time out if this value is increased."
},
"requestTimeout": {
"type": "number",
"default": 5000,
"description": "Time, in milliseconds, to wait for an XHR request to go out in a cy.wait() command"
},
"responseTimeout": {
"type": "number",
"default": 30000,
"description": "Time, in milliseconds, to wait until a response in a cy.request(), cy.wait(), cy.fixture(), cy.getCookie(), cy.getCookies(), cy.setCookie(), cy.clearCookie(), cy.clearCookies(), and cy.screenshot() commands"
},
"fileServerFolder": {
"type": "string",
"default": "root project folder",
"description": "Path to folder where application files will attempt to be served from"
},
"fixturesFolder": {
"type": [
"string",
"boolean"
],
"default": "cypress/fixtures",
"description": "Path to folder containing fixture files (Pass false to disable)"
},
"integrationFolder": {
"type": "string",
"default": "cypress/integration",
"description": "Path to folder containing integration test files"
},
"downloadsFolder": {
"type": "string",
"default": "cypress/downloads",
"description": "Path to folder where files downloaded during a test are saved"
},
"componentFolder": {
"type": [
"string",
"boolean"
],
"default": false,
"description": "Path to folder containing component test files (Pass false to disable)"
},
"pluginsFile": {
"type": [
"string",
"boolean"
],
"default": "cypress/plugins/index.js",
"description": "Path to plugins file. (Pass false to disable)"
},
"screenshotOnRunFailure": {
"type": "boolean",
"default": true,
"description": "Whether Cypress will take a screenshot when a test fails during cypress run"
},
"screenshotsFolder": {
"type": "string",
"default": "cypress/screenshots",
"description": "Path to folder where screenshots will be saved from cy.screenshot() command or after a test fails during cypress run"
},
"supportFile": {
"type": [
"string",
"boolean"
],
"default": "cypress/support/index.js",
"description": "Path to file to load before test files load. This file is compiled and bundled. (Pass false to disable)"
},
"videosFolder": {
"type": "string",
"default": "cypress/videos",
"description": "Path to folder where videos will be saved during cypress run"
},
"trashAssetsBeforeRuns": {
"type": "boolean",
"default": true,
"description": "Whether Cypress will trash assets within the screenshotsFolder and videosFolder before tests run with cypress run"
},
"videoCompression": {
"type": [
"number",
"boolean"
],
"default": 32,
"description": "The quality setting for the video compression, in Constant Rate Factor (CRF). The value can be false to disable compression or a value between 0 and 51, where a lower value results in better quality (at the expense of a higher file size)."
},
"video": {
"type": "boolean",
"default": true,
"description": "Whether Cypress will capture a video of the tests run with cypress run"
},
"videoUploadOnPasses": {
"type": "boolean",
"default": true,
"description": "Whether Cypress will process, compress, and upload videos to the Dashboard even when all tests in a spec file are passing. This only applies when recording your runs to the Dashboard. Turn this off if you’d like to only upload the spec file’s video when there are failing tests."
},
"chromeWebSecurity": {
"type": "boolean",
"default": true,
"description": "Whether Chrome Web Security for same-origin policy and insecure mixed content is enabled. Read more about this at https://on.cypress.io/web-security"
},
"userAgent": {
"type": "string",
"default": null,
"description": "Enables you to override the default user agent the browser sends in all request headers. User agent values are typically used by servers to help identify the operating system, browser, and browser version. See User-Agent MDN Documentation for example user agent values here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent"
},
"blockHosts": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
},
"default": null,
"description": "A String or Array of hosts that you wish to block traffic for. Please read the notes for examples on using this https://on.cypress.io/configuration#blockHosts"
},
"modifyObstructiveCode": {
"type": "boolean",
"default": true,
"description": "Whether Cypress will search for and replace obstructive JS code found in .js or .html files that prevent Cypress from working. Please read the notes for more information on this setting. https://on.cypress.io/configuration#modifyObstructiveCode"
},
"viewportHeight": {
"type": "number",
"default": 660,
"description": "Default height in pixels for the application under tests’ viewport (Override with cy.viewport() command)"
},
"viewportWidth": {
"type": "number",
"default": 1000,
"description": "Default width in pixels for the application under tests’ viewport. (Override with cy.viewport() command)"
},
"animationDistanceThreshold": {
"type": "number",
"default": 5,
"description": "The distance in pixels an element must exceed over time to be considered animating"
},
"waitForAnimations": {
"type": "boolean",
"default": true,
"description": "Whether to wait for elements to finish animating before executing commands"
},
"scrollBehavior": {
"enum": [
false,
"center",
"top",
"bottom",
"nearest"
],
"default": "top",
"description": "Viewport position to which an element should be scrolled prior to action commands. Setting `false` disables scrolling."
},
"projectId": {
"type": "string",
"default": null,
"description": "A 6 character string use to identify this project in the Cypress Dashboard. See https://on.cypress.io/dashboard-service#Identification"
},
"nodeVersion": {
"enum": [
"system",
"bundled"
],
"default": "system",
"description": "DEPRECATED: If set to 'bundled', Cypress will use the Node version bundled with Cypress. Otherwise, Cypress will use the Node version that was used to launch the Cypress. This Node version is used when executing your plugins file and building spec files."
},
"experimentalInteractiveRunEvents": {
"type": "boolean",
"default": false,
"description": "Allows listening to the `before:run`, `after:run`, `before:spec`, and `after:spec` events in the plugins file during interactive mode."
},
"experimentalSessionAndOrigin": {
"type": "boolean",
"default": false,
"description": "Enables cross-origin and improved session support, including the `cy.origin` and `cy.session` commands."
},
"experimentalSourceRewriting": {
"type": "boolean",
"default": false,
"description": "Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm."
},
"experimentalFetchPolyfill": {
"type": "boolean",
"default": false,
"description": "Polyfills `window.fetch` to enable Network spying and stubbing"
},
"experimentalStudio": {
"type": "boolean",
"default": false,
"description": "Generate and save commands directly to your test suite by interacting with your app as an end user would."
},
"retries": {
"type": [
"object",
"number",
"null"
],
"default": {
"runMode": 0,
"openMode": 0
},
"description": "The number of times to retry a failing. Can be configured to apply only in runMode or openMode"
},
"includeShadowDom": {
"type": "boolean",
"default": false,
"description": "Enables including elements within the shadow DOM when using querying commands (e.g. cy.get(), cy.find()). Can be set globally in cypress.json, per-suite or per-test in the test configuration object, or programmatically with Cypress.config()"
},
"clientCertificates": {
"description": "Defines client certificates to use when sending requests to the specified URLs",
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"description": "Requests for URLs matching this minimatch pattern will use the supplied client certificate",
"type": "string"
},
"ca": {
"description": "Path(s) to CA file(s) to validate certs against, relative to project root",
"type": "array",
"items": {
"type": "string"
}
},
"certs": {
"type": "array",
"items": {
"anyOf": [
{
"description": "PEM file specific properties",
"type": "object",
"properties": {
"cert": {
"description": "Path to the certificate, relative to project root",
"type": "string"
},
"key": {
"description": "Path to the private key, relative to project root",
"type": "string"
},
"passphrase": {
"description": "(Optional) File path to a UTF-8 text file containing the passphrase for the key, relative to project root",
"type": "string"
}
},
"required": [
"cert",
"key"
]
},
{
"description": "PFX file specific properties",
"type": "object",
"properties": {
"pfx": {
"description": "Path to the certificate container, relative to project root",
"type": "string"
},
"passphrase": {
"description": "(Optional) File path to a UTF-8 text file containing the passphrase for the container, relative to project root",
"type": "string"
}
},
"required": [
"pfx"
]
}
]
}
}
},
"required": [
"url",
"certs"
]
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/cypressConfig"
},
{
"properties": {
"component": {
"description": "Any component runner specific overrides",
"$ref": "#/definitions/cypressConfig"
},
"e2e": {
"description": "Any e2e runner specific overrides",
"$ref": "#/definitions/cypressConfig"
}
}
}
]
}