cypress 11.1.0 → 12.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/angular/dist/index.js +6 -0
- package/angular/package.json +2 -1
- package/lib/cli.js +3 -3
- package/lib/util.js +4 -0
- package/mount-utils/CHANGELOG.md +12 -0
- package/mount-utils/dist/index.js +6 -0
- package/mount-utils/package.json +2 -1
- package/package.json +4 -4
- package/react/CHANGELOG.md +7 -0
- package/react/dist/cypress-react.cjs.js +6 -0
- package/react/dist/cypress-react.esm-bundler.js +6 -0
- package/react/package.json +1 -0
- package/react18/dist/cypress-react.cjs.js +6 -0
- package/react18/dist/cypress-react.esm-bundler.js +6 -0
- package/react18/package.json +2 -1
- package/svelte/dist/cypress-svelte.cjs.js +6 -0
- package/svelte/dist/cypress-svelte.esm-bundler.js +6 -0
- package/svelte/package.json +1 -0
- package/types/cypress-npm-api.d.ts +4 -1
- package/types/cypress.d.ts +303 -213
- package/vue/CHANGELOG.md +14 -0
- package/vue/dist/cypress-vue.cjs.js +6 -0
- package/vue/dist/cypress-vue.esm-bundler.js +6 -0
- package/vue/package.json +2 -0
- package/vue2/dist/cypress-vue2.cjs.js +6 -0
- package/vue2/dist/cypress-vue2.esm-bundler.js +6 -0
- package/vue2/package.json +3 -1
package/angular/dist/index.js
CHANGED
@@ -63,6 +63,12 @@ function setupHooks(optionalCallback) {
|
|
63
63
|
Cypress.Commands.overwrite('visit', () => {
|
64
64
|
throw new Error('cy.visit from a component spec is not allowed');
|
65
65
|
});
|
66
|
+
Cypress.Commands.overwrite('session', () => {
|
67
|
+
throw new Error('cy.session from a component spec is not allowed');
|
68
|
+
});
|
69
|
+
Cypress.Commands.overwrite('origin', () => {
|
70
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
71
|
+
});
|
66
72
|
// @ts-ignore
|
67
73
|
Cypress.on('test:before:run', () => {
|
68
74
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
package/angular/package.json
CHANGED
@@ -8,7 +8,8 @@
|
|
8
8
|
"build": "rollup -c rollup.config.mjs",
|
9
9
|
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
10
10
|
"build-prod": "yarn build",
|
11
|
-
"check-ts": "tsc --noEmit"
|
11
|
+
"check-ts": "tsc --noEmit",
|
12
|
+
"lint": "eslint --ext .js,.ts,.json, ."
|
12
13
|
},
|
13
14
|
"dependencies": {},
|
14
15
|
"devDependencies": {
|
package/lib/cli.js
CHANGED
@@ -123,7 +123,7 @@ const descriptions = {
|
|
123
123
|
exit: 'keep the browser open after tests finish',
|
124
124
|
forceInstall: 'force install the Cypress binary',
|
125
125
|
global: 'force Cypress into global mode as if its globally installed',
|
126
|
-
group: 'a named group for recorded runs in
|
126
|
+
group: 'a named group for recorded runs in Cypress Cloud',
|
127
127
|
headed: 'displays the browser instead of running headlessly',
|
128
128
|
headless: 'hide the browser instead of running headed (default for cypress run)',
|
129
129
|
key: 'your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.',
|
@@ -131,11 +131,11 @@ const descriptions = {
|
|
131
131
|
port: 'runs Cypress on a specific port. overrides any value in cypress.config.{js,ts,mjs,cjs}.',
|
132
132
|
project: 'path to the project',
|
133
133
|
quiet: 'run quietly, using only the configured reporter',
|
134
|
-
record: 'records the run. sends test results, screenshots and videos to
|
134
|
+
record: 'records the run. sends test results, screenshots and videos to Cypress Cloud.',
|
135
135
|
reporter: 'runs a specific mocha reporter. pass a path to use a custom reporter. defaults to "spec"',
|
136
136
|
reporterOptions: 'options for the mocha reporter. defaults to "null"',
|
137
137
|
spec: 'runs specific spec file(s). defaults to "all"',
|
138
|
-
tag: 'named tag(s) for recorded runs in
|
138
|
+
tag: 'named tag(s) for recorded runs in Cypress Cloud',
|
139
139
|
version: 'prints Cypress version'
|
140
140
|
};
|
141
141
|
const knownCommands = ['cache', 'help', '-h', '--help', 'install', 'open', 'run', 'open-ct', 'run-ct', 'verify', '-v', '--version', 'version', 'info'];
|
package/lib/util.js
CHANGED
@@ -507,6 +507,7 @@ const util = {
|
|
507
507
|
getEnv(varName, trim) {
|
508
508
|
la(is.unemptyString(varName), 'expected environment variable name, not', varName);
|
509
509
|
const configVarName = `npm_config_${varName}`;
|
510
|
+
const configVarNameLower = configVarName.toLowerCase();
|
510
511
|
const packageConfigVarName = `npm_package_config_${varName}`;
|
511
512
|
let result;
|
512
513
|
|
@@ -516,6 +517,9 @@ const util = {
|
|
516
517
|
} else if (process.env.hasOwnProperty(configVarName)) {
|
517
518
|
debug(`Using ${varName} from npm config`);
|
518
519
|
result = process.env[configVarName];
|
520
|
+
} else if (process.env.hasOwnProperty(configVarNameLower)) {
|
521
|
+
debug(`Using ${varName.toLowerCase()} from npm config`);
|
522
|
+
result = process.env[configVarNameLower];
|
519
523
|
} else if (process.env.hasOwnProperty(packageConfigVarName)) {
|
520
524
|
debug(`Using ${varName} from package.json config`);
|
521
525
|
result = process.env[packageConfigVarName];
|
package/mount-utils/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# [@cypress/mount-utils-v4.0.0](https://github.com/cypress-io/cypress/compare/@cypress/mount-utils-v3.0.0...@cypress/mount-utils-v4.0.0) (2022-12-02)
|
2
|
+
|
3
|
+
|
4
|
+
### chore
|
5
|
+
|
6
|
+
* remove experimentalSessionAndOrigin flag ([#24340](https://github.com/cypress-io/cypress/issues/24340)) ([69873ae](https://github.com/cypress-io/cypress/commit/69873ae9884228f15310fd151e42cbc0cb712817))
|
7
|
+
|
8
|
+
|
9
|
+
### BREAKING CHANGES
|
10
|
+
|
11
|
+
* removed experimentalSessionAndOrigin flag. testIsolation defaults to strict
|
12
|
+
|
1
13
|
# [@cypress/mount-utils-v3.0.0](https://github.com/cypress-io/cypress/compare/@cypress/mount-utils-v2.1.0...@cypress/mount-utils-v3.0.0) (2022-11-07)
|
2
14
|
|
3
15
|
|
@@ -35,6 +35,12 @@ export function setupHooks(optionalCallback) {
|
|
35
35
|
Cypress.Commands.overwrite('visit', () => {
|
36
36
|
throw new Error('cy.visit from a component spec is not allowed');
|
37
37
|
});
|
38
|
+
Cypress.Commands.overwrite('session', () => {
|
39
|
+
throw new Error('cy.session from a component spec is not allowed');
|
40
|
+
});
|
41
|
+
Cypress.Commands.overwrite('origin', () => {
|
42
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
43
|
+
});
|
38
44
|
// @ts-ignore
|
39
45
|
Cypress.on('test:before:run', () => {
|
40
46
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
package/mount-utils/package.json
CHANGED
@@ -8,7 +8,8 @@
|
|
8
8
|
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
9
9
|
"build-prod": "yarn build",
|
10
10
|
"check-ts": "tsc --noEmit",
|
11
|
-
"watch": "tsc -w"
|
11
|
+
"watch": "tsc -w",
|
12
|
+
"lint": "eslint --ext .js,.ts,.json, ."
|
12
13
|
},
|
13
14
|
"dependencies": {},
|
14
15
|
"devDependencies": {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cypress",
|
3
|
-
"version": "
|
3
|
+
"version": "12.0.0",
|
4
4
|
"main": "index.js",
|
5
5
|
"scripts": {
|
6
6
|
"postinstall": "node index.js --exec install",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"cypress": "bin/cypress"
|
69
69
|
},
|
70
70
|
"engines": {
|
71
|
-
"node": ">=
|
71
|
+
"node": "^14.0.0 || ^16.0.0 || >=18.0.0"
|
72
72
|
},
|
73
73
|
"types": "types",
|
74
74
|
"exports": {
|
@@ -118,8 +118,8 @@
|
|
118
118
|
},
|
119
119
|
"buildInfo": {
|
120
120
|
"commitBranch": "develop",
|
121
|
-
"commitSha": "
|
122
|
-
"commitDate": "2022-
|
121
|
+
"commitSha": "797c8f8d7737ff8c5d76107faf505dc980ff953f",
|
122
|
+
"commitDate": "2022-12-06T14:19:39.000Z",
|
123
123
|
"stable": true
|
124
124
|
},
|
125
125
|
"description": "Cypress is a next generation front end testing tool built for the modern web",
|
package/react/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [@cypress/react-v7.0.2](https://github.com/cypress-io/cypress/compare/@cypress/react-v7.0.1...@cypress/react-v7.0.2) (2022-12-02)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* remove cypress.server.defaults, cy.server and cy.route ([#24411](https://github.com/cypress-io/cypress/issues/24411)) ([2f18a8c](https://github.com/cypress-io/cypress/commit/2f18a8cbd2d1a90fe1f77a29cdc89571bf54109e))
|
7
|
+
|
1
8
|
# [@cypress/react-v7.0.1](https://github.com/cypress-io/cypress/compare/@cypress/react-v7.0.0...@cypress/react-v7.0.1) (2022-11-08)
|
2
9
|
|
3
10
|
|
@@ -110,6 +110,12 @@ function setupHooks(optionalCallback) {
|
|
110
110
|
Cypress.Commands.overwrite('visit', () => {
|
111
111
|
throw new Error('cy.visit from a component spec is not allowed');
|
112
112
|
});
|
113
|
+
Cypress.Commands.overwrite('session', () => {
|
114
|
+
throw new Error('cy.session from a component spec is not allowed');
|
115
|
+
});
|
116
|
+
Cypress.Commands.overwrite('origin', () => {
|
117
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
118
|
+
});
|
113
119
|
// @ts-ignore
|
114
120
|
Cypress.on('test:before:run', () => {
|
115
121
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
@@ -83,6 +83,12 @@ function setupHooks(optionalCallback) {
|
|
83
83
|
Cypress.Commands.overwrite('visit', () => {
|
84
84
|
throw new Error('cy.visit from a component spec is not allowed');
|
85
85
|
});
|
86
|
+
Cypress.Commands.overwrite('session', () => {
|
87
|
+
throw new Error('cy.session from a component spec is not allowed');
|
88
|
+
});
|
89
|
+
Cypress.Commands.overwrite('origin', () => {
|
90
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
91
|
+
});
|
86
92
|
// @ts-ignore
|
87
93
|
Cypress.on('test:before:run', () => {
|
88
94
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
package/react/package.json
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
"cy:run": "node ../../scripts/cypress.js run --component",
|
13
13
|
"cy:run:debug": "node --inspect-brk ../../scripts/start.js --component-testing --run-project ${PWD}",
|
14
14
|
"test": "yarn cy:run",
|
15
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
|
15
16
|
"watch": "yarn build --watch --watch.exclude ./dist/**/*"
|
16
17
|
},
|
17
18
|
"devDependencies": {
|
@@ -124,6 +124,12 @@ function setupHooks(optionalCallback) {
|
|
124
124
|
Cypress.Commands.overwrite('visit', () => {
|
125
125
|
throw new Error('cy.visit from a component spec is not allowed');
|
126
126
|
});
|
127
|
+
Cypress.Commands.overwrite('session', () => {
|
128
|
+
throw new Error('cy.session from a component spec is not allowed');
|
129
|
+
});
|
130
|
+
Cypress.Commands.overwrite('origin', () => {
|
131
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
132
|
+
});
|
127
133
|
// @ts-ignore
|
128
134
|
Cypress.on('test:before:run', () => {
|
129
135
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
@@ -97,6 +97,12 @@ function setupHooks(optionalCallback) {
|
|
97
97
|
Cypress.Commands.overwrite('visit', () => {
|
98
98
|
throw new Error('cy.visit from a component spec is not allowed');
|
99
99
|
});
|
100
|
+
Cypress.Commands.overwrite('session', () => {
|
101
|
+
throw new Error('cy.session from a component spec is not allowed');
|
102
|
+
});
|
103
|
+
Cypress.Commands.overwrite('origin', () => {
|
104
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
105
|
+
});
|
100
106
|
// @ts-ignore
|
101
107
|
Cypress.on('test:before:run', () => {
|
102
108
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
package/react18/package.json
CHANGED
@@ -7,7 +7,8 @@
|
|
7
7
|
"build": "rimraf dist && rollup -c rollup.config.mjs",
|
8
8
|
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
9
9
|
"build-prod": "yarn build",
|
10
|
-
"watch": "yarn build --watch --watch.exclude ./dist/**/*"
|
10
|
+
"watch": "yarn build --watch --watch.exclude ./dist/**/*",
|
11
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, ."
|
11
12
|
},
|
12
13
|
"devDependencies": {
|
13
14
|
"@cypress/mount-utils": "0.0.0-development",
|
@@ -46,6 +46,12 @@ function setupHooks(optionalCallback) {
|
|
46
46
|
Cypress.Commands.overwrite('visit', () => {
|
47
47
|
throw new Error('cy.visit from a component spec is not allowed');
|
48
48
|
});
|
49
|
+
Cypress.Commands.overwrite('session', () => {
|
50
|
+
throw new Error('cy.session from a component spec is not allowed');
|
51
|
+
});
|
52
|
+
Cypress.Commands.overwrite('origin', () => {
|
53
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
54
|
+
});
|
49
55
|
// @ts-ignore
|
50
56
|
Cypress.on('test:before:run', () => {
|
51
57
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
@@ -42,6 +42,12 @@ function setupHooks(optionalCallback) {
|
|
42
42
|
Cypress.Commands.overwrite('visit', () => {
|
43
43
|
throw new Error('cy.visit from a component spec is not allowed');
|
44
44
|
});
|
45
|
+
Cypress.Commands.overwrite('session', () => {
|
46
|
+
throw new Error('cy.session from a component spec is not allowed');
|
47
|
+
});
|
48
|
+
Cypress.Commands.overwrite('origin', () => {
|
49
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
50
|
+
});
|
45
51
|
// @ts-ignore
|
46
52
|
Cypress.on('test:before:run', () => {
|
47
53
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
package/svelte/package.json
CHANGED
@@ -173,7 +173,7 @@ declare namespace CypressCommandLine {
|
|
173
173
|
title: string[]
|
174
174
|
state: string
|
175
175
|
body: string
|
176
|
-
|
176
|
+
/**
|
177
177
|
* Error string as it's presented in console if the test fails
|
178
178
|
*/
|
179
179
|
displayError: string | null
|
@@ -229,6 +229,7 @@ declare namespace CypressCommandLine {
|
|
229
229
|
startedAt: dateTimeISO
|
230
230
|
endedAt: dateTimeISO
|
231
231
|
duration: ms
|
232
|
+
wallClockDuration?: number
|
232
233
|
}
|
233
234
|
/**
|
234
235
|
* Reporter name like "spec"
|
@@ -259,8 +260,10 @@ declare namespace CypressCommandLine {
|
|
259
260
|
* resolved filename of the spec
|
260
261
|
*/
|
261
262
|
absolute: string
|
263
|
+
relativeToCommonRoot: string
|
262
264
|
}
|
263
265
|
shouldUploadVideo: boolean
|
266
|
+
skippedSpec: boolean
|
264
267
|
}
|
265
268
|
|
266
269
|
/**
|
package/types/cypress.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
1
2
|
/// <reference path="./cypress-npm-api.d.ts" />
|
2
3
|
/// <reference path="./cypress-eventemitter.d.ts" />
|
3
4
|
/// <reference path="./cypress-type-helpers.d.ts" />
|
@@ -49,6 +50,9 @@ declare namespace Cypress {
|
|
49
50
|
interface CommandFnWithOriginalFnAndSubject<T extends keyof Chainable, S> {
|
50
51
|
(this: Mocha.Context, originalFn: CommandOriginalFnWithSubject<T, S>, prevSubject: S, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]> | void
|
51
52
|
}
|
53
|
+
interface QueryFn<T extends keyof ChainableMethods> {
|
54
|
+
(this: Command, ...args: Parameters<ChainableMethods[T]>): (subject: any) => any
|
55
|
+
}
|
52
56
|
interface ObjectLike {
|
53
57
|
[key: string]: any
|
54
58
|
}
|
@@ -127,6 +131,58 @@ declare namespace Cypress {
|
|
127
131
|
unsupportedVersion?: boolean
|
128
132
|
}
|
129
133
|
|
134
|
+
interface Ensure {
|
135
|
+
/**
|
136
|
+
* Throws an error if `subject` is not one of the passed in `type`s.
|
137
|
+
*/
|
138
|
+
isType(subject: any, type: PrevSubject[], commandName: string, cy: Chainable): void
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Throws an error if `subject` is not a DOM element.
|
142
|
+
*/
|
143
|
+
isElement(subject: any, commandName: string, cy: Chainable): void
|
144
|
+
|
145
|
+
/**
|
146
|
+
* Throws an error if `subject` is not a `document`.
|
147
|
+
*/
|
148
|
+
isDocument(subject: any, commandName: string, cy: Chainable): void
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Throws an error if `subject` is not a `window`.
|
152
|
+
*/
|
153
|
+
isWindow(subject: any, commandName: string, cy: Chainable): void
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Throws an error if `subject` is not a DOM element attached to the application under test.
|
157
|
+
*/
|
158
|
+
isAttached(subject: any, commandName: string, cy: Chainable, onFail?: Log): void
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Throws an error if `subject` is a disabled DOM element.
|
162
|
+
*/
|
163
|
+
isNotDisabled(subject: any, commandName: string, onFail?: Log): void
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Throws an error if `subject` is a DOM element hidden by any of its parent elements.
|
167
|
+
*/
|
168
|
+
isNotHiddenByAncestors(subject: any, commandName: string, onFail?: Log): void
|
169
|
+
|
170
|
+
/**
|
171
|
+
* Throws an error if `subject` is a read-only form element.
|
172
|
+
*/
|
173
|
+
isNotReadonly(subject: any, commandName: string, onFail?: Log): void
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Throws an error if `subject` is a read-only form element.
|
177
|
+
*/
|
178
|
+
isScrollable(subject: any, commandName: string, onFail?: Log): void
|
179
|
+
|
180
|
+
/**
|
181
|
+
* Throws an error if `subject` is not a DOM element visible in the AUT.
|
182
|
+
*/
|
183
|
+
isVisible(subject: any, commandName: string, onFail?: Log): void
|
184
|
+
}
|
185
|
+
|
130
186
|
interface LocalStorage {
|
131
187
|
/**
|
132
188
|
* Called internally to clear `localStorage` in two situations.
|
@@ -141,6 +197,39 @@ declare namespace Cypress {
|
|
141
197
|
clear: (keys?: string[]) => void
|
142
198
|
}
|
143
199
|
|
200
|
+
// TODO: raise minimum required TypeScript version to 3.7
|
201
|
+
// and make this recursive
|
202
|
+
// https://github.com/cypress-io/cypress/issues/24875
|
203
|
+
type Storable =
|
204
|
+
| string
|
205
|
+
| number
|
206
|
+
| boolean
|
207
|
+
| null
|
208
|
+
| StorableObject
|
209
|
+
| StorableArray
|
210
|
+
|
211
|
+
interface StorableObject {
|
212
|
+
[key: string]: Storable
|
213
|
+
}
|
214
|
+
|
215
|
+
interface StorableArray extends Array<Storable> { }
|
216
|
+
|
217
|
+
type StorableRecord = Record<string, Storable>
|
218
|
+
|
219
|
+
interface OriginStorage {
|
220
|
+
origin: string
|
221
|
+
value: StorableRecord
|
222
|
+
}
|
223
|
+
|
224
|
+
interface Storages {
|
225
|
+
localStorage: OriginStorage[]
|
226
|
+
sessionStorage: OriginStorage[]
|
227
|
+
}
|
228
|
+
|
229
|
+
interface StorageByOrigin {
|
230
|
+
[key: string]: StorableRecord
|
231
|
+
}
|
232
|
+
|
144
233
|
type IsBrowserMatcher = BrowserName | Partial<Browser> | Array<BrowserName | Partial<Browser>>
|
145
234
|
|
146
235
|
interface ViewportPosition extends WindowPosition {
|
@@ -271,6 +360,12 @@ declare namespace Cypress {
|
|
271
360
|
*/
|
272
361
|
sinon: sinon.SinonStatic
|
273
362
|
|
363
|
+
/**
|
364
|
+
* Utility functions for ensuring various properties about a subject.
|
365
|
+
* @see https://on.cypress.io/custom-queries
|
366
|
+
*/
|
367
|
+
ensure: Ensure
|
368
|
+
|
274
369
|
/**
|
275
370
|
* Cypress version string. i.e. "1.1.2"
|
276
371
|
* @see https://on.cypress.io/version
|
@@ -462,30 +557,92 @@ declare namespace Cypress {
|
|
462
557
|
*/
|
463
558
|
log(options: Partial<LogConfig>): Log
|
464
559
|
|
465
|
-
/**
|
466
|
-
* @see https://on.cypress.io/api/commands
|
467
|
-
*/
|
468
560
|
Commands: {
|
561
|
+
/**
|
562
|
+
* Add a custom command
|
563
|
+
* @see https://on.cypress.io/api/commands
|
564
|
+
*/
|
469
565
|
add<T extends keyof Chainable>(name: T, fn: CommandFn<T>): void
|
566
|
+
|
567
|
+
/**
|
568
|
+
* Add a custom parent command
|
569
|
+
* @see https://on.cypress.io/api/commands#Parent-Commands
|
570
|
+
*/
|
470
571
|
add<T extends keyof Chainable>(name: T, options: CommandOptions & {prevSubject: false}, fn: CommandFn<T>): void
|
572
|
+
|
573
|
+
/**
|
574
|
+
* Add a custom child command
|
575
|
+
* @see https://on.cypress.io/api/commands#Child-Commands
|
576
|
+
*/
|
471
577
|
add<T extends keyof Chainable, S = any>(name: T, options: CommandOptions & {prevSubject: true}, fn: CommandFnWithSubject<T, S>): void
|
578
|
+
|
579
|
+
/**
|
580
|
+
* Add a custom child or dual command
|
581
|
+
* @see https://on.cypress.io/api/commands#Validations
|
582
|
+
*/
|
472
583
|
add<T extends keyof Chainable, S extends PrevSubject>(
|
473
|
-
|
584
|
+
name: T, options: CommandOptions & { prevSubject: S | ['optional'] }, fn: CommandFnWithSubject<T, PrevSubjectMap[S]>,
|
474
585
|
): void
|
586
|
+
|
587
|
+
/**
|
588
|
+
* Add a custom command that allows multiple types as the prevSubject
|
589
|
+
* @see https://on.cypress.io/api/commands#Validations#Allow-Multiple-Types
|
590
|
+
*/
|
475
591
|
add<T extends keyof Chainable, S extends PrevSubject>(
|
476
|
-
|
592
|
+
name: T, options: CommandOptions & { prevSubject: S[] }, fn: CommandFnWithSubject<T, PrevSubjectMap<void>[S]>,
|
477
593
|
): void
|
594
|
+
|
595
|
+
/**
|
596
|
+
* Add one or more custom commands
|
597
|
+
* @see https://on.cypress.io/api/commands
|
598
|
+
*/
|
478
599
|
addAll<T extends keyof Chainable>(fns: CommandFns): void
|
600
|
+
|
601
|
+
/**
|
602
|
+
* Add one or more custom parent commands
|
603
|
+
* @see https://on.cypress.io/api/commands#Parent-Commands
|
604
|
+
*/
|
479
605
|
addAll<T extends keyof Chainable>(options: CommandOptions & {prevSubject: false}, fns: CommandFns): void
|
606
|
+
|
607
|
+
/**
|
608
|
+
* Add one or more custom child commands
|
609
|
+
* @see https://on.cypress.io/api/commands#Child-Commands
|
610
|
+
*/
|
480
611
|
addAll<T extends keyof Chainable, S = any>(options: CommandOptions & { prevSubject: true }, fns: CommandFnsWithSubject<S>): void
|
612
|
+
|
613
|
+
/**
|
614
|
+
* Add one or more custom commands that validate their prevSubject
|
615
|
+
* @see https://on.cypress.io/api/commands#Validations
|
616
|
+
*/
|
481
617
|
addAll<T extends keyof Chainable, S extends PrevSubject>(
|
482
|
-
|
618
|
+
options: CommandOptions & { prevSubject: S | ['optional'] }, fns: CommandFnsWithSubject<PrevSubjectMap[S]>,
|
483
619
|
): void
|
620
|
+
|
621
|
+
/**
|
622
|
+
* Add one or more custom commands that allow multiple types as their prevSubject
|
623
|
+
* @see https://on.cypress.io/api/commands#Allow-Multiple-Types
|
624
|
+
*/
|
484
625
|
addAll<T extends keyof Chainable, S extends PrevSubject>(
|
485
|
-
|
626
|
+
options: CommandOptions & { prevSubject: S[] }, fns: CommandFnsWithSubject<PrevSubjectMap<void>[S]>,
|
486
627
|
): void
|
628
|
+
|
629
|
+
/**
|
630
|
+
* Overwrite an existing Cypress command with a new implementation
|
631
|
+
* @see https://on.cypress.io/api/commands#Overwrite-Existing-Commands
|
632
|
+
*/
|
487
633
|
overwrite<T extends keyof Chainable>(name: T, fn: CommandFnWithOriginalFn<T>): void
|
634
|
+
|
635
|
+
/**
|
636
|
+
* Overwrite an existing Cypress command with a new implementation
|
637
|
+
* @see https://on.cypress.io/api/commands#Overwrite-Existing-Commands
|
638
|
+
*/
|
488
639
|
overwrite<T extends keyof Chainable, S extends PrevSubject>(name: T, fn: CommandFnWithOriginalFnAndSubject<T, PrevSubjectMap[S]>): void
|
640
|
+
|
641
|
+
/**
|
642
|
+
* Add a custom query
|
643
|
+
* @see https://on.cypress.io/api/custom-queries
|
644
|
+
*/
|
645
|
+
addQuery<T extends keyof Chainable>(name: T, fn: QueryFn<T>): void
|
489
646
|
}
|
490
647
|
|
491
648
|
/**
|
@@ -493,16 +650,6 @@ declare namespace Cypress {
|
|
493
650
|
*/
|
494
651
|
Cookies: {
|
495
652
|
debug(enabled: boolean, options?: Partial<DebugOptions>): void
|
496
|
-
/**
|
497
|
-
* @deprecated Use `cy.session()` instead.
|
498
|
-
* @see https://on.cypress.io/session
|
499
|
-
*/
|
500
|
-
preserveOnce(...names: string[]): void
|
501
|
-
/**
|
502
|
-
* @deprecated Use `cy.session()` instead.
|
503
|
-
* @see https://on.cypress.io/session
|
504
|
-
*/
|
505
|
-
defaults(options: Partial<CookieDefaults>): CookieDefaults
|
506
653
|
}
|
507
654
|
|
508
655
|
/**
|
@@ -601,13 +748,6 @@ declare namespace Cypress {
|
|
601
748
|
defaults(options: Partial<KeyboardDefaultsOptions>): void
|
602
749
|
}
|
603
750
|
|
604
|
-
/**
|
605
|
-
* @see https://on.cypress.io/api/api-server
|
606
|
-
*/
|
607
|
-
Server: {
|
608
|
-
defaults(options: Partial<ServerOptions>): void
|
609
|
-
}
|
610
|
-
|
611
751
|
/**
|
612
752
|
* @see https://on.cypress.io/screenshot-api
|
613
753
|
*/
|
@@ -654,30 +794,11 @@ declare namespace Cypress {
|
|
654
794
|
onSpecWindow: (window: Window, specList: string[] | Array<() => Promise<void>>) => void
|
655
795
|
}
|
656
796
|
|
657
|
-
interface SessionOptions {
|
658
|
-
/**
|
659
|
-
* Whether or not to persist the session across all specs in the run.
|
660
|
-
* @default {false}
|
661
|
-
*/
|
662
|
-
cacheAcrossSpecs?: boolean,
|
663
|
-
/**
|
664
|
-
* Function to run immediately after the session is created and `setup` function runs or
|
665
|
-
* after a session is restored and the page is cleared. If this returns `false`, throws an
|
666
|
-
* exception, returns a Promise which resolves to `false` or rejects or contains any failing
|
667
|
-
* Cypress command, the session is considered invalid.
|
668
|
-
*
|
669
|
-
* If validation fails immediately after `setup`, the test will fail.
|
670
|
-
* If validation fails after restoring a session, `setup` will re-run.
|
671
|
-
* @default {false}
|
672
|
-
*/
|
673
|
-
validate?: () => Promise<false | void> | void
|
674
|
-
}
|
675
|
-
|
676
797
|
type CanReturnChainable = void | Chainable | Promise<unknown>
|
677
798
|
type ThenReturn<S, R> =
|
678
799
|
R extends void ? Chainable<S> :
|
679
|
-
|
680
|
-
|
800
|
+
R extends R | undefined ? Chainable<S | Exclude<R, undefined>> :
|
801
|
+
Chainable<S>
|
681
802
|
|
682
803
|
/**
|
683
804
|
* Chainable interface for non-array Subjects
|
@@ -775,7 +896,7 @@ declare namespace Cypress {
|
|
775
896
|
clear(options?: Partial<ClearOptions>): Chainable<Subject>
|
776
897
|
|
777
898
|
/**
|
778
|
-
* Clear a specific browser cookie for the current
|
899
|
+
* Clear a specific browser cookie for the current hostname or for the domain specified.
|
779
900
|
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn't need to use this command unless you're using it to clear a specific cookie inside a single test.
|
780
901
|
*
|
781
902
|
* @see https://on.cypress.io/clearcookie
|
@@ -783,7 +904,7 @@ declare namespace Cypress {
|
|
783
904
|
clearCookie(name: string, options?: CookieOptions): Chainable<null>
|
784
905
|
|
785
906
|
/**
|
786
|
-
* Clear all browser cookies for the current
|
907
|
+
* Clear all browser cookies for the current hostname or for the domain specified.
|
787
908
|
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn't need to use this command unless you're using it to clear all cookies or specific cookies inside a single test.
|
788
909
|
*
|
789
910
|
* @see https://on.cypress.io/clearcookies
|
@@ -791,7 +912,35 @@ declare namespace Cypress {
|
|
791
912
|
clearCookies(options?: CookieOptions): Chainable<null>
|
792
913
|
|
793
914
|
/**
|
794
|
-
*
|
915
|
+
* Get local storage for all origins.
|
916
|
+
*
|
917
|
+
* @see https://on.cypress.io/getalllocalstorage
|
918
|
+
*/
|
919
|
+
getAllLocalStorage(options?: Partial<Loggable>): Chainable<StorageByOrigin>
|
920
|
+
|
921
|
+
/**
|
922
|
+
* Clear local storage for all origins.
|
923
|
+
*
|
924
|
+
* @see https://on.cypress.io/clearalllocalstorage
|
925
|
+
*/
|
926
|
+
clearAllLocalStorage(options?: Partial<Loggable>): Chainable<null>
|
927
|
+
|
928
|
+
/**
|
929
|
+
* Get session storage for all origins.
|
930
|
+
*
|
931
|
+
* @see https://on.cypress.io/getallsessionstorage
|
932
|
+
*/
|
933
|
+
getAllSessionStorage(options?: Partial<Loggable>): Chainable<StorageByOrigin>
|
934
|
+
|
935
|
+
/**
|
936
|
+
* Clear session storage for all origins.
|
937
|
+
*
|
938
|
+
* @see https://on.cypress.io/clearallsessionstorage
|
939
|
+
*/
|
940
|
+
clearAllSessionStorage(options?: Partial<Loggable>): Chainable<null>
|
941
|
+
|
942
|
+
/**
|
943
|
+
* Clear data in local storage for the current origin.
|
795
944
|
* Cypress automatically runs this command before each test to prevent state from being
|
796
945
|
* shared across tests. You shouldn't need to use this command unless you're using it
|
797
946
|
* to clear localStorage inside a single test. Yields `localStorage` object.
|
@@ -1085,8 +1234,6 @@ declare namespace Cypress {
|
|
1085
1234
|
/**
|
1086
1235
|
* Save/Restore browser Cookies, LocalStorage, and SessionStorage data resulting from the supplied `setup` function.
|
1087
1236
|
*
|
1088
|
-
* Only available if the `experimentalSessionAndOrigin` config option is enabled.
|
1089
|
-
*
|
1090
1237
|
* @see https://on.cypress.io/session
|
1091
1238
|
*/
|
1092
1239
|
session(id: string | object, setup: () => void, options?: SessionOptions): Chainable<null>
|
@@ -1248,14 +1395,14 @@ declare namespace Cypress {
|
|
1248
1395
|
get<S = any>(alias: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<S>
|
1249
1396
|
|
1250
1397
|
/**
|
1251
|
-
* Get a browser cookie by its name for the current
|
1398
|
+
* Get a browser cookie by its name for the current hostname or for the domain specified.
|
1252
1399
|
*
|
1253
1400
|
* @see https://on.cypress.io/getcookie
|
1254
1401
|
*/
|
1255
1402
|
getCookie(name: string, options?: CookieOptions): Chainable<Cookie | null>
|
1256
1403
|
|
1257
1404
|
/**
|
1258
|
-
* Get all of the browser cookies for the current
|
1405
|
+
* Get all of the browser cookies for the current hostname or for the domain specified.
|
1259
1406
|
*
|
1260
1407
|
* @see https://on.cypress.io/getcookies
|
1261
1408
|
*/
|
@@ -1429,6 +1576,13 @@ declare namespace Cypress {
|
|
1429
1576
|
*/
|
1430
1577
|
not(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery>
|
1431
1578
|
|
1579
|
+
/**
|
1580
|
+
* Invoke a command synchronously, without using the command queue.
|
1581
|
+
*
|
1582
|
+
* @see https://on.cypress.io/custom-queries
|
1583
|
+
*/
|
1584
|
+
now(name: string, ...args: any[]): Promise<any> | ((subject: any) => any)
|
1585
|
+
|
1432
1586
|
/**
|
1433
1587
|
* These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
|
1434
1588
|
* @see https://on.cypress.io/catalog-of-events#App-Events
|
@@ -1677,66 +1831,6 @@ declare namespace Cypress {
|
|
1677
1831
|
*/
|
1678
1832
|
root<E extends Node = HTMLHtmlElement>(options?: Partial<Loggable>): Chainable<JQuery<E>> // can't do better typing unless we ignore the `.within()` case
|
1679
1833
|
|
1680
|
-
/**
|
1681
|
-
* @deprecated Use `cy.intercept()` instead.
|
1682
|
-
*
|
1683
|
-
* Use `cy.route()` to manage the behavior of network requests.
|
1684
|
-
* @see https://on.cypress.io/route
|
1685
|
-
* @example
|
1686
|
-
* cy.server()
|
1687
|
-
* cy.route('https://localhost:7777/users', [{id: 1, name: 'Pat'}])
|
1688
|
-
*/
|
1689
|
-
route(url: string | RegExp, response?: string | object): Chainable<null>
|
1690
|
-
/**
|
1691
|
-
* @deprecated Use `cy.intercept()` instead.
|
1692
|
-
*
|
1693
|
-
* Spy or stub request with specific method and url.
|
1694
|
-
*
|
1695
|
-
* @see https://on.cypress.io/route
|
1696
|
-
* @example
|
1697
|
-
* cy.server()
|
1698
|
-
* // spy on POST /todos requests
|
1699
|
-
* cy.route('POST', '/todos').as('add-todo')
|
1700
|
-
*/
|
1701
|
-
route(method: string, url: string | RegExp, response?: string | object): Chainable<null>
|
1702
|
-
/**
|
1703
|
-
* @deprecated Use `cy.intercept()` instead.
|
1704
|
-
*
|
1705
|
-
* Set a route by returning an object literal from a callback function.
|
1706
|
-
* Functions that return a Promise will automatically be awaited.
|
1707
|
-
*
|
1708
|
-
* @see https://on.cypress.io/route
|
1709
|
-
* @example
|
1710
|
-
* cy.server()
|
1711
|
-
* cy.route(() => {
|
1712
|
-
* // your logic here
|
1713
|
-
* // return an appropriate routing object here
|
1714
|
-
* return {
|
1715
|
-
* method: 'POST',
|
1716
|
-
* url: '/comments',
|
1717
|
-
* response: this.commentsFixture
|
1718
|
-
* }
|
1719
|
-
* })
|
1720
|
-
*/
|
1721
|
-
route(fn: () => RouteOptions): Chainable<null>
|
1722
|
-
/**
|
1723
|
-
* @deprecated Use `cy.intercept()` instead.
|
1724
|
-
*
|
1725
|
-
* Spy or stub a given route.
|
1726
|
-
*
|
1727
|
-
* @see https://on.cypress.io/route
|
1728
|
-
* @example
|
1729
|
-
* cy.server()
|
1730
|
-
* cy.route({
|
1731
|
-
* method: 'DELETE',
|
1732
|
-
* url: '/users',
|
1733
|
-
* status: 412,
|
1734
|
-
* delay: 1000
|
1735
|
-
* // and other options, see documentation
|
1736
|
-
* })
|
1737
|
-
*/
|
1738
|
-
route(options: Partial<RouteOptions>): Chainable<null>
|
1739
|
-
|
1740
1834
|
/**
|
1741
1835
|
* Take a screenshot of the application under test and the Cypress Command Log.
|
1742
1836
|
*
|
@@ -1782,26 +1876,6 @@ declare namespace Cypress {
|
|
1782
1876
|
*/
|
1783
1877
|
select(valueOrTextOrIndex: string | number | Array<string | number>, options?: Partial<SelectOptions>): Chainable<Subject>
|
1784
1878
|
|
1785
|
-
/**
|
1786
|
-
* @deprecated Use `cy.intercept()` instead.
|
1787
|
-
*
|
1788
|
-
* Start a server to begin routing responses to `cy.route()` and `cy.request()`.
|
1789
|
-
*
|
1790
|
-
* @example
|
1791
|
-
* // start server
|
1792
|
-
* cy.server()
|
1793
|
-
* // get default server options
|
1794
|
-
* cy.server().should((server) => {
|
1795
|
-
* expect(server.delay).to.eq(0)
|
1796
|
-
* expect(server.method).to.eq('GET')
|
1797
|
-
* expect(server.status).to.eq(200)
|
1798
|
-
* // and many others options
|
1799
|
-
* })
|
1800
|
-
*
|
1801
|
-
* @see https://on.cypress.io/server
|
1802
|
-
*/
|
1803
|
-
server(options?: Partial<ServerOptions>): Chainable<ServerOptions>
|
1804
|
-
|
1805
1879
|
/**
|
1806
1880
|
* Set a browser cookie.
|
1807
1881
|
*
|
@@ -2373,8 +2447,8 @@ declare namespace Cypress {
|
|
2373
2447
|
|
2374
2448
|
type ChainableMethods<Subject = any> = {
|
2375
2449
|
[P in keyof Chainable<Subject>]: Chainable<Subject>[P] extends ((...args: any[]) => any)
|
2376
|
-
|
2377
|
-
|
2450
|
+
? Chainable<Subject>[P]
|
2451
|
+
: never
|
2378
2452
|
}
|
2379
2453
|
|
2380
2454
|
interface SinonSpyAgent<A extends sinon.SinonSpy> {
|
@@ -2403,10 +2477,6 @@ declare namespace Cypress {
|
|
2403
2477
|
|
2404
2478
|
type Agent<T extends sinon.SinonSpy> = SinonSpyAgent<T> & T
|
2405
2479
|
|
2406
|
-
interface CookieDefaults {
|
2407
|
-
preserve: string | string[] | RegExp | ((cookie: Cookie) => boolean)
|
2408
|
-
}
|
2409
|
-
|
2410
2480
|
interface Failable {
|
2411
2481
|
/**
|
2412
2482
|
* Whether to fail on response codes other than 2xx and 3xx
|
@@ -2636,7 +2706,7 @@ declare namespace Cypress {
|
|
2636
2706
|
interface CookieOptions extends Partial<Loggable & Timeoutable> {
|
2637
2707
|
/**
|
2638
2708
|
* Domain to set cookies on or get cookies from
|
2639
|
-
* @default
|
2709
|
+
* @default hostname of the current app under test
|
2640
2710
|
*/
|
2641
2711
|
domain?: string
|
2642
2712
|
}
|
@@ -2694,7 +2764,7 @@ declare namespace Cypress {
|
|
2694
2764
|
*/
|
2695
2765
|
env: { [key: string]: any }
|
2696
2766
|
/**
|
2697
|
-
* 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
|
2767
|
+
* 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 a tool to test what files would match.
|
2698
2768
|
* @default "*.hot-update.js"
|
2699
2769
|
*/
|
2700
2770
|
excludeSpecPattern: string | string[]
|
@@ -2816,8 +2886,7 @@ declare namespace Cypress {
|
|
2816
2886
|
*/
|
2817
2887
|
supportFile: string | false
|
2818
2888
|
/**
|
2819
|
-
* The test isolation ensures a clean browser context between tests.
|
2820
|
-
* `experimentalSessionAndOrigin=true`.
|
2889
|
+
* The test isolation ensures a clean browser context between tests.
|
2821
2890
|
*
|
2822
2891
|
* Cypress will always reset/clear aliases, intercepts, clock, and viewport before each test
|
2823
2892
|
* to ensure a clean test slate; i.e. this configuration only impacts the browser context.
|
@@ -2825,23 +2894,23 @@ declare namespace Cypress {
|
|
2825
2894
|
* Note: the [`cy.session()`](https://on.cypress.io/session) command will inherent this value to determine whether
|
2826
2895
|
* or not the page is cleared when the command executes. This command is only available in end-to-end testing.
|
2827
2896
|
*
|
2828
|
-
* -
|
2897
|
+
* - true - The page is cleared before each test. Cookies, local storage and session storage in all domains are cleared
|
2829
2898
|
* before each test. The `cy.session()` command will also clear the page and current browser context when creating
|
2830
2899
|
* or restoring the browser session.
|
2831
|
-
* -
|
2900
|
+
* - false - The current browser state will persist between tests. The page does not clear before the test and cookies, local
|
2832
2901
|
* storage and session storage will be available in the next test. The `cy.session()` command will only clear the
|
2833
2902
|
* current browser context when creating or restoring the browser session - the current page will not clear.
|
2834
2903
|
*
|
2835
2904
|
* Tradeoffs:
|
2836
2905
|
* Turning test isolation off may improve performance of end-to-end tests, however, previous tests could impact the
|
2837
2906
|
* browser state of the next test and cause inconsistency when using .only(). Be mindful to write isolated tests when
|
2838
|
-
* test isolation is
|
2907
|
+
* test isolation is false. If a test in the suite impacts the state of other tests and it were to fail, you could see
|
2839
2908
|
* misleading errors in later tests which makes debugging clunky. See the [documentation](https://on.cypress.io/test-isolation)
|
2840
2909
|
* for more information.
|
2841
2910
|
*
|
2842
|
-
* @default
|
2911
|
+
* @default true
|
2843
2912
|
*/
|
2844
|
-
testIsolation:
|
2913
|
+
testIsolation: boolean
|
2845
2914
|
/**
|
2846
2915
|
* Path to folder where videos will be saved after a headless or CI run
|
2847
2916
|
* @default "cypress/videos"
|
@@ -2863,7 +2932,7 @@ declare namespace Cypress {
|
|
2863
2932
|
*/
|
2864
2933
|
video: boolean
|
2865
2934
|
/**
|
2866
|
-
* Whether Cypress will upload the video to
|
2935
|
+
* Whether Cypress will upload the video to Cypress Cloud even if all tests are passing. This applies only when recording your runs to Cypress Cloud. Turn this off if you'd like the video uploaded only when there are failing tests.
|
2867
2936
|
* @default true
|
2868
2937
|
*/
|
2869
2938
|
videoUploadOnPasses: boolean
|
@@ -2902,11 +2971,6 @@ declare namespace Cypress {
|
|
2902
2971
|
* @default false
|
2903
2972
|
*/
|
2904
2973
|
experimentalInteractiveRunEvents: boolean
|
2905
|
-
/**
|
2906
|
-
* Enables cross-origin and improved session support, including the `cy.origin` and `cy.session` commands. See https://on.cypress.io/origin and https://on.cypress.io/session.
|
2907
|
-
* @default false
|
2908
|
-
*/
|
2909
|
-
experimentalSessionAndOrigin: boolean
|
2910
2974
|
/**
|
2911
2975
|
* Whether Cypress will search for and replace obstructive code in third party .js or .html files.
|
2912
2976
|
* NOTE: Setting this flag to true removes Subresource Integrity (SRI).
|
@@ -2982,7 +3046,7 @@ declare namespace Cypress {
|
|
2982
3046
|
* Override default config options for E2E Testing runner.
|
2983
3047
|
* @default {}
|
2984
3048
|
*/
|
2985
|
-
e2e:
|
3049
|
+
e2e: EndToEndConfigOptions
|
2986
3050
|
|
2987
3051
|
/**
|
2988
3052
|
* An array of objects defining the certificates
|
@@ -2997,6 +3061,19 @@ declare namespace Cypress {
|
|
2997
3061
|
indexHtmlFile: string
|
2998
3062
|
}
|
2999
3063
|
|
3064
|
+
interface EndToEndConfigOptions extends Omit<CoreConfigOptions, 'indexHtmlFile'> {
|
3065
|
+
/**
|
3066
|
+
* Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially.
|
3067
|
+
* @default false
|
3068
|
+
*/
|
3069
|
+
experimentalRunAllSpecs?: boolean
|
3070
|
+
/**
|
3071
|
+
* Enables support for require/import within cy.origin.
|
3072
|
+
* @default false
|
3073
|
+
*/
|
3074
|
+
experimentalOriginDependencies?: boolean
|
3075
|
+
}
|
3076
|
+
|
3000
3077
|
/**
|
3001
3078
|
* Options appended to config object on runtime.
|
3002
3079
|
*/
|
@@ -3070,19 +3147,17 @@ declare namespace Cypress {
|
|
3070
3147
|
socketIoRoute: string
|
3071
3148
|
spec: Cypress['spec'] | null
|
3072
3149
|
specs: Array<Cypress['spec']>
|
3073
|
-
xhrRoute: string
|
3074
|
-
xhrUrl: string
|
3075
3150
|
}
|
3076
3151
|
|
3077
3152
|
interface SuiteConfigOverrides extends Partial<
|
3078
|
-
Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'
|
3153
|
+
Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>
|
3079
3154
|
>, Partial<Pick<ResolvedConfigOptions, 'baseUrl' | 'testIsolation'>> {
|
3080
3155
|
browser?: IsBrowserMatcher | IsBrowserMatcher[]
|
3081
3156
|
keystrokeDelay?: number
|
3082
3157
|
}
|
3083
3158
|
|
3084
3159
|
interface TestConfigOverrides extends Partial<
|
3085
|
-
Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'
|
3160
|
+
Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>
|
3086
3161
|
>, Partial<Pick<ResolvedConfigOptions, 'baseUrl'>> {
|
3087
3162
|
browser?: IsBrowserMatcher | IsBrowserMatcher[]
|
3088
3163
|
keystrokeDelay?: number
|
@@ -3112,15 +3187,15 @@ declare namespace Cypress {
|
|
3112
3187
|
type PickConfigOpt<T> = T extends keyof DefineDevServerConfig ? DefineDevServerConfig[T] : any
|
3113
3188
|
|
3114
3189
|
interface AngularDevServerProjectConfig {
|
3115
|
-
root: string
|
3116
|
-
sourceRoot: string
|
3190
|
+
root: string
|
3191
|
+
sourceRoot: string
|
3117
3192
|
buildOptions: Record<string, any>
|
3118
3193
|
}
|
3119
3194
|
|
3120
3195
|
type DevServerFn<ComponentDevServerOpts = any> = (cypressDevServerConfig: DevServerConfig, devServerConfig: ComponentDevServerOpts) => ResolvedDevServerConfig | Promise<ResolvedDevServerConfig>
|
3121
3196
|
|
3122
3197
|
type ConfigHandler<T> = T
|
3123
|
-
|
3198
|
+
| (() => T | Promise<T>)
|
3124
3199
|
|
3125
3200
|
type DevServerConfigOptions = {
|
3126
3201
|
bundler: 'webpack'
|
@@ -3131,15 +3206,15 @@ declare namespace Cypress {
|
|
3131
3206
|
framework: 'react' | 'vue' | 'svelte'
|
3132
3207
|
viteConfig?: ConfigHandler<Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>>
|
3133
3208
|
} | {
|
3134
|
-
bundler: 'webpack'
|
3135
|
-
framework: 'angular'
|
3136
|
-
webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'
|
3209
|
+
bundler: 'webpack'
|
3210
|
+
framework: 'angular'
|
3211
|
+
webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>
|
3137
3212
|
options?: {
|
3138
3213
|
projectConfig: AngularDevServerProjectConfig
|
3139
3214
|
}
|
3140
3215
|
}
|
3141
3216
|
|
3142
|
-
interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | '
|
3217
|
+
interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalStudio'> {
|
3143
3218
|
devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
|
3144
3219
|
devServerConfig?: ComponentDevServerOpts
|
3145
3220
|
/**
|
@@ -3162,7 +3237,7 @@ declare namespace Cypress {
|
|
3162
3237
|
/**
|
3163
3238
|
* Hosts mappings to IP addresses.
|
3164
3239
|
*/
|
3165
|
-
|
3240
|
+
hosts?: null | {[key: string]: string}
|
3166
3241
|
}
|
3167
3242
|
|
3168
3243
|
interface PluginConfigOptions extends ResolvedConfigOptions, RuntimeConfigOptions {
|
@@ -3328,31 +3403,60 @@ declare namespace Cypress {
|
|
3328
3403
|
interval: number
|
3329
3404
|
}
|
3330
3405
|
|
3331
|
-
/**
|
3332
|
-
* Setting default options for cy.server()
|
3333
|
-
* @see https://on.cypress.io/server
|
3334
|
-
*/
|
3335
|
-
interface ServerOptions {
|
3336
|
-
delay: number
|
3337
|
-
method: HttpMethod
|
3338
|
-
status: number
|
3339
|
-
headers: object
|
3340
|
-
response: any
|
3341
|
-
onRequest(...args: any[]): void
|
3342
|
-
onResponse(...args: any[]): void
|
3343
|
-
onAbort(...args: any[]): void
|
3344
|
-
enable: boolean
|
3345
|
-
force404: boolean
|
3346
|
-
urlMatchingOptions: object
|
3347
|
-
ignore(xhr: Request): void
|
3348
|
-
onAnyRequest(route: RouteOptions, proxy: any): void
|
3349
|
-
onAnyResponse(route: RouteOptions, proxy: any): void
|
3350
|
-
onAnyAbort(route: RouteOptions, proxy: any): void
|
3351
|
-
}
|
3352
|
-
|
3353
3406
|
interface Session {
|
3354
|
-
|
3407
|
+
/**
|
3408
|
+
* Clear all sessions saved on the backend, including cached global sessions.
|
3409
|
+
*/
|
3355
3410
|
clearAllSavedSessions: () => Promise<void>
|
3411
|
+
/**
|
3412
|
+
* Clear all storage and cookie data across all origins associated with the current session.
|
3413
|
+
*/
|
3414
|
+
clearCurrentSessionData: () => Promise<void>
|
3415
|
+
/**
|
3416
|
+
* Get all storage and cookie data across all origins associated with the current session.
|
3417
|
+
*/
|
3418
|
+
getCurrentSessionData: () => Promise<SessionData>
|
3419
|
+
/**
|
3420
|
+
* Get all storage and cookie data saved on the backend associated with the provided session id.
|
3421
|
+
*/
|
3422
|
+
getSession: (id: string) => Promise<ServerSessionData>
|
3423
|
+
}
|
3424
|
+
|
3425
|
+
type ActiveSessions = Record<string, SessionData>
|
3426
|
+
|
3427
|
+
interface SessionData {
|
3428
|
+
id: string
|
3429
|
+
hydrated: boolean
|
3430
|
+
cacheAcrossSpecs: SessionOptions['cacheAcrossSpecs']
|
3431
|
+
cookies?: Cookie[] | null
|
3432
|
+
localStorage?: OriginStorage[] | null
|
3433
|
+
sessionStorage?: OriginStorage[] | null
|
3434
|
+
setup: () => void
|
3435
|
+
validate?: SessionOptions['validate']
|
3436
|
+
}
|
3437
|
+
|
3438
|
+
interface ServerSessionData extends Omit<SessionData, 'setup' |'validate'> {
|
3439
|
+
setup: string
|
3440
|
+
validate?: string
|
3441
|
+
}
|
3442
|
+
|
3443
|
+
interface SessionOptions {
|
3444
|
+
/**
|
3445
|
+
* Whether or not to persist the session across all specs in the run.
|
3446
|
+
* @default {false}
|
3447
|
+
*/
|
3448
|
+
cacheAcrossSpecs?: boolean
|
3449
|
+
/**
|
3450
|
+
* Function to run immediately after the session is created and `setup` function runs or
|
3451
|
+
* after a session is restored and the page is cleared. If this returns `false`, throws an
|
3452
|
+
* exception, returns a Promise which resolves to `false` or rejects or contains any failing
|
3453
|
+
* Cypress command, the session is considered invalid.
|
3454
|
+
*
|
3455
|
+
* If validation fails immediately after `setup`, the test will fail.
|
3456
|
+
* If validation fails after restoring a session, `setup` will re-run.
|
3457
|
+
* @default {false}
|
3458
|
+
*/
|
3459
|
+
validate?: () => Promise<false | void> | void
|
3356
3460
|
}
|
3357
3461
|
|
3358
3462
|
type SameSiteStatus = 'no_restriction' | 'strict' | 'lax'
|
@@ -5769,7 +5873,7 @@ declare namespace Cypress {
|
|
5769
5873
|
* Useful for debugging purposes if you're confused about the order in which commands will execute.
|
5770
5874
|
* @see https://on.cypress.io/catalog-of-events#App-Events
|
5771
5875
|
*/
|
5772
|
-
(action: 'command:enqueued', fn: (command:
|
5876
|
+
(action: 'command:enqueued', fn: (command: EnqueuedCommandAttributes) => void): Cypress
|
5773
5877
|
/**
|
5774
5878
|
* Fires when cy begins actually running and executing your command.
|
5775
5879
|
* Useful for debugging and understanding how the command queue is async.
|
@@ -5897,7 +6001,7 @@ declare namespace Cypress {
|
|
5897
6001
|
sameSite?: SameSiteStatus
|
5898
6002
|
}
|
5899
6003
|
|
5900
|
-
interface
|
6004
|
+
interface EnqueuedCommandAttributes {
|
5901
6005
|
id: string
|
5902
6006
|
name: string
|
5903
6007
|
args: any[]
|
@@ -5905,9 +6009,17 @@ declare namespace Cypress {
|
|
5905
6009
|
chainerId: string
|
5906
6010
|
injected: boolean
|
5907
6011
|
userInvocationStack?: string
|
6012
|
+
query?: boolean
|
5908
6013
|
fn(...args: any[]): any
|
5909
6014
|
}
|
5910
6015
|
|
6016
|
+
interface Command {
|
6017
|
+
get<K extends keyof EnqueuedCommandAttributes>(attr: K): EnqueuedCommandAttributes[K]
|
6018
|
+
get(): EnqueuedCommandAttributes
|
6019
|
+
set<K extends keyof EnqueuedCommandAttributes>(key: K, value: EnqueuedCommandAttributes[K]): Log
|
6020
|
+
set(options: Partial<EnqueuedCommandAttributes>): Log
|
6021
|
+
}
|
6022
|
+
|
5911
6023
|
interface Exec {
|
5912
6024
|
code: number
|
5913
6025
|
stdout: string
|
@@ -5986,28 +6098,6 @@ declare namespace Cypress {
|
|
5986
6098
|
viewportHeight: number
|
5987
6099
|
}
|
5988
6100
|
|
5989
|
-
interface WaitXHR {
|
5990
|
-
duration: number
|
5991
|
-
id: string
|
5992
|
-
method: HttpMethod
|
5993
|
-
request: {
|
5994
|
-
body: string | ObjectLike
|
5995
|
-
headers: ObjectLike
|
5996
|
-
}
|
5997
|
-
requestBody: WaitXHR['request']['body']
|
5998
|
-
requestHeaders: WaitXHR['request']['headers']
|
5999
|
-
response: {
|
6000
|
-
body: string | ObjectLike
|
6001
|
-
headers: ObjectLike
|
6002
|
-
}
|
6003
|
-
responseBody: WaitXHR['response']['body']
|
6004
|
-
responseHeaders: WaitXHR['response']['headers']
|
6005
|
-
status: number
|
6006
|
-
statusMessage: string
|
6007
|
-
url: string
|
6008
|
-
xhr: XMLHttpRequest
|
6009
|
-
}
|
6010
|
-
|
6011
6101
|
type Encodings = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'utf8' | 'utf-8' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' | null
|
6012
6102
|
type PositionType = 'topLeft' | 'top' | 'topRight' | 'left' | 'center' | 'right' | 'bottomLeft' | 'bottom' | 'bottomRight'
|
6013
6103
|
type ViewportPreset = 'macbook-16' | 'macbook-15' | 'macbook-13' | 'macbook-11' | 'ipad-2' | 'ipad-mini' | 'iphone-xr' | 'iphone-x' | 'iphone-6+' | 'iphone-se2' | 'iphone-8' | 'iphone-7' | 'iphone-6' | 'iphone-5' | 'iphone-4' | 'iphone-3' | 'samsung-s10' | 'samsung-note9'
|
package/vue/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [@cypress/vue-v5.0.3](https://github.com/cypress-io/cypress/compare/@cypress/vue-v5.0.2...@cypress/vue-v5.0.3) (2022-12-02)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* remove cypress.server.defaults, cy.server and cy.route ([#24411](https://github.com/cypress-io/cypress/issues/24411)) ([2f18a8c](https://github.com/cypress-io/cypress/commit/2f18a8cbd2d1a90fe1f77a29cdc89571bf54109e))
|
7
|
+
|
8
|
+
# [@cypress/vue-v5.0.2](https://github.com/cypress-io/cypress/compare/@cypress/vue-v5.0.1...@cypress/vue-v5.0.2) (2022-11-23)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* fix windows-lint CI job ([#24758](https://github.com/cypress-io/cypress/issues/24758)) ([2166ba0](https://github.com/cypress-io/cypress/commit/2166ba0d9496037df843d55f07517f83817171a3))
|
14
|
+
|
1
15
|
# [@cypress/vue-v5.0.1](https://github.com/cypress-io/cypress/compare/@cypress/vue-v5.0.0...@cypress/vue-v5.0.1) (2022-11-08)
|
2
16
|
|
3
17
|
|
@@ -95,6 +95,12 @@ function setupHooks(optionalCallback) {
|
|
95
95
|
Cypress.Commands.overwrite('visit', () => {
|
96
96
|
throw new Error('cy.visit from a component spec is not allowed');
|
97
97
|
});
|
98
|
+
Cypress.Commands.overwrite('session', () => {
|
99
|
+
throw new Error('cy.session from a component spec is not allowed');
|
100
|
+
});
|
101
|
+
Cypress.Commands.overwrite('origin', () => {
|
102
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
103
|
+
});
|
98
104
|
// @ts-ignore
|
99
105
|
Cypress.on('test:before:run', () => {
|
100
106
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
@@ -72,6 +72,12 @@ function setupHooks(optionalCallback) {
|
|
72
72
|
Cypress.Commands.overwrite('visit', () => {
|
73
73
|
throw new Error('cy.visit from a component spec is not allowed');
|
74
74
|
});
|
75
|
+
Cypress.Commands.overwrite('session', () => {
|
76
|
+
throw new Error('cy.session from a component spec is not allowed');
|
77
|
+
});
|
78
|
+
Cypress.Commands.overwrite('origin', () => {
|
79
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
80
|
+
});
|
75
81
|
// @ts-ignore
|
76
82
|
Cypress.on('test:before:run', () => {
|
77
83
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
package/vue/package.json
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
"build": "rimraf dist && rollup -c rollup.config.mjs",
|
11
11
|
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
12
12
|
"typecheck": "yarn tsd && vue-tsc --noEmit",
|
13
|
+
"check-ts": "yarn tsd && vue-tsc --noEmit",
|
14
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .",
|
13
15
|
"test": "yarn cy:run",
|
14
16
|
"tsd": "yarn build && yarn tsc -p test-tsd/tsconfig.tsd.json",
|
15
17
|
"watch": "yarn build --watch --watch.exclude ./dist/**/*"
|
@@ -19825,6 +19825,12 @@ function setupHooks(optionalCallback) {
|
|
19825
19825
|
Cypress.Commands.overwrite('visit', () => {
|
19826
19826
|
throw new Error('cy.visit from a component spec is not allowed');
|
19827
19827
|
});
|
19828
|
+
Cypress.Commands.overwrite('session', () => {
|
19829
|
+
throw new Error('cy.session from a component spec is not allowed');
|
19830
|
+
});
|
19831
|
+
Cypress.Commands.overwrite('origin', () => {
|
19832
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
19833
|
+
});
|
19828
19834
|
// @ts-ignore
|
19829
19835
|
Cypress.on('test:before:run', () => {
|
19830
19836
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
@@ -19817,6 +19817,12 @@ function setupHooks(optionalCallback) {
|
|
19817
19817
|
Cypress.Commands.overwrite('visit', () => {
|
19818
19818
|
throw new Error('cy.visit from a component spec is not allowed');
|
19819
19819
|
});
|
19820
|
+
Cypress.Commands.overwrite('session', () => {
|
19821
|
+
throw new Error('cy.session from a component spec is not allowed');
|
19822
|
+
});
|
19823
|
+
Cypress.Commands.overwrite('origin', () => {
|
19824
|
+
throw new Error('cy.origin from a component spec is not allowed');
|
19825
|
+
});
|
19820
19826
|
// @ts-ignore
|
19821
19827
|
Cypress.on('test:before:run', () => {
|
19822
19828
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
package/vue2/package.json
CHANGED
@@ -9,7 +9,9 @@
|
|
9
9
|
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
10
10
|
"build-prod": "yarn build",
|
11
11
|
"test": "echo \"Tests for @cypress/vue2 are run from system-tests\"",
|
12
|
-
"watch": "yarn build --watch --watch.exclude ./dist/**/*"
|
12
|
+
"watch": "yarn build --watch --watch.exclude ./dist/**/*",
|
13
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .",
|
14
|
+
"test-ci": "node ../../scripts/run-ct-examples.js --examplesList=./examples.env"
|
13
15
|
},
|
14
16
|
"devDependencies": {
|
15
17
|
"@cypress/mount-utils": "0.0.0-development",
|