Skip to content

Commit aa98f2e

Browse files
authored
Merge pull request #21045 from cypress-io/merge-develop-4-12
chore: merge develop into 10.0-release
2 parents de17f44 + 38d860c commit aa98f2e

File tree

22 files changed

+477
-65
lines changed

22 files changed

+477
-65
lines changed

browser-versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"chrome:beta": "101.0.4951.15",
2+
"chrome:beta": "101.0.4951.26",
33
"chrome:stable": "100.0.4896.75"
44
}

circle.yml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -695,13 +695,6 @@ commands:
695695
name: Run tests using command
696696
working_directory: /tmp/<<parameters.repo>>/<<parameters.folder>>
697697
command: <<parameters.command>>
698-
699-
- store_artifacts:
700-
name: screenshots
701-
path: /tmp/<<parameters.repo>>/<<parameters.folder>>/cypress/screenshots
702-
- store_artifacts:
703-
name: videos
704-
path: /tmp/<<parameters.repo>>/<<parameters.folder>>/cypress/videos
705698
- unless:
706699
condition: <<parameters.folder>>
707700
steps:
@@ -719,12 +712,6 @@ commands:
719712
name: Run tests using command
720713
working_directory: /tmp/<<parameters.repo>>
721714
command: <<parameters.command>>
722-
- store_artifacts:
723-
name: screenshots
724-
path: /tmp/<<parameters.repo>>/cypress/screenshots
725-
- store_artifacts:
726-
name: videos
727-
path: /tmp/<<parameters.repo>>/cypress/videos
728715
- store-npm-logs
729716

730717
test-binary-against-repo:
@@ -844,13 +831,6 @@ commands:
844831
name: Run tests using command
845832
working_directory: /tmp/<<parameters.repo>>/<<parameters.folder>>
846833
command: <<parameters.command>>
847-
848-
- store_artifacts:
849-
name: screenshots
850-
path: /tmp/<<parameters.repo>>/<<parameters.folder>>/cypress/screenshots
851-
- store_artifacts:
852-
name: videos
853-
path: /tmp/<<parameters.repo>>/<<parameters.folder>>/cypress/videos
854834
- unless:
855835
condition: <<parameters.folder>>
856836
steps:
@@ -868,12 +848,6 @@ commands:
868848
name: Run tests using command
869849
working_directory: /tmp/<<parameters.repo>>
870850
command: <<parameters.command>>
871-
- store_artifacts:
872-
name: screenshots
873-
path: /tmp/<<parameters.repo>>/cypress/screenshots
874-
- store_artifacts:
875-
name: videos
876-
path: /tmp/<<parameters.repo>>/cypress/videos
877851
- store-npm-logs
878852

879853
wait-on-circle-jobs:
@@ -1565,8 +1539,6 @@ jobs:
15651539
working_directory: npm/vite-dev-server
15661540
- store_test_results:
15671541
path: npm/vite-dev-server/test_results
1568-
- store_artifacts:
1569-
path: npm/vite-dev-server/cypress/videos
15701542
- store-npm-logs
15711543

15721544
npm-webpack-batteries-included-preprocessor:
@@ -1774,10 +1746,6 @@ jobs:
17741746
name: Run Kitchensink example project
17751747
command: |
17761748
yarn cypress:run --project /tmp/cypress-example-kitchensink
1777-
- store_artifacts:
1778-
path: /tmp/cypress-example-kitchensink/cypress/screenshots
1779-
- store_artifacts:
1780-
path: /tmp/cypress-example-kitchensink/cypress/videos
17811749
- store-npm-logs
17821750

17831751
test-kitchensink-against-staging:
@@ -2020,15 +1988,13 @@ jobs:
20201988

20211989
test-binary-against-recipes-chrome:
20221990
<<: *defaults
2023-
parallelism: 3
20241991
steps:
20251992
- test-binary-against-repo:
20261993
repo: cypress-example-recipes
20271994
command: npm run test:ci:chrome
20281995

20291996
test-binary-against-recipes:
20301997
<<: *defaults
2031-
parallelism: 3
20321998
steps:
20331999
- test-binary-against-repo:
20342000
repo: cypress-example-recipes

cli/types/cypress.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@ declare namespace Cypress {
2424
interface CommandFn<T extends keyof ChainableMethods> {
2525
(this: Mocha.Context, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]> | void
2626
}
27+
interface CommandFns {
28+
[name: string]: (this: Mocha.Context, ...args: any) => any
29+
}
2730
interface CommandFnWithSubject<T extends keyof ChainableMethods, S> {
2831
(this: Mocha.Context, prevSubject: S, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]> | void
2932
}
33+
interface CommandFnsWithSubject<S> {
34+
[name: string]: (this: Mocha.Context, prevSubject: S, ...args: any) => any
35+
}
3036
interface CommandOriginalFn<T extends keyof ChainableMethods> extends CallableFunction {
3137
(...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]>
3238
}
@@ -467,6 +473,14 @@ declare namespace Cypress {
467473
add<T extends keyof Chainable, S extends PrevSubject>(
468474
name: T, options: CommandOptions & { prevSubject: S[] }, fn: CommandFnWithSubject<T, PrevSubjectMap<void>[S]>,
469475
): void
476+
addAll<T extends keyof Chainable>(fns: CommandFns): void
477+
addAll<T extends keyof Chainable>(options: CommandOptions & {prevSubject: false}, fns: CommandFns): void
478+
addAll<T extends keyof Chainable, S extends PrevSubject>(
479+
options: CommandOptions & { prevSubject: true | S | ['optional'] }, fns: CommandFnsWithSubject<PrevSubjectMap[S]>,
480+
): void
481+
addAll<T extends keyof Chainable, S extends PrevSubject>(
482+
options: CommandOptions & { prevSubject: S[] }, fns: CommandFnsWithSubject<PrevSubjectMap<void>[S]>,
483+
): void
470484
overwrite<T extends keyof Chainable>(name: T, fn: CommandFnWithOriginalFn<T>): void
471485
overwrite<T extends keyof Chainable, S extends PrevSubject>(name: T, fn: CommandFnWithOriginalFnAndSubject<T, PrevSubjectMap[S]>): void
472486
}

cli/types/tests/cypress-tests.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,118 @@ namespace CypressCommandsTests {
149149
arg
150150
return cy.wrap(new Promise<number>((resolve) => { resolve(5) }))
151151
})
152+
153+
Cypress.Commands.addAll({
154+
newCommand(arg) {
155+
// $ExpectType any
156+
arg
157+
this // $ExpectType Context
158+
return
159+
},
160+
newCommand2(arg, arg2) {
161+
// $ExpectType any
162+
arg
163+
// $ExpectType any
164+
arg2
165+
},
166+
newCommand3: (arg) => {
167+
// $ExpectType any
168+
arg
169+
return
170+
},
171+
newCommand4: (arg) => {
172+
// $ExpectType any
173+
arg
174+
},
175+
})
176+
Cypress.Commands.addAll({ prevSubject: true }, {
177+
newCommand: (subject, arg) => {
178+
subject // $ExpectType unknown
179+
arg // $ExpectType any
180+
return
181+
},
182+
})
183+
Cypress.Commands.addAll({ prevSubject: false }, {
184+
newCommand: (arg) => {
185+
arg // $ExpectType any
186+
return
187+
},
188+
})
189+
Cypress.Commands.addAll({ prevSubject: 'optional' }, {
190+
newCommand: (subject, arg) => {
191+
subject // $ExpectType unknown
192+
arg // $ExpectType any
193+
return
194+
},
195+
newCommand2: (subject, arg) => {
196+
subject // $ExpectType unknown
197+
arg // $ExpectType any
198+
},
199+
})
200+
Cypress.Commands.addAll({ prevSubject: ['optional'] }, {
201+
newCommand: (subject, arg) => {
202+
subject // $ExpectType unknown
203+
arg // $ExpectType any
204+
},
205+
})
206+
Cypress.Commands.addAll({ prevSubject: 'document' }, {
207+
newCommand: (subject, arg) => {
208+
subject // $ExpectType Document
209+
arg // $ExpectType any
210+
},
211+
})
212+
Cypress.Commands.addAll({ prevSubject: 'window' }, {
213+
newCommand: (subject, arg) => {
214+
subject // $ExpectType Window
215+
arg // $ExpectType any
216+
},
217+
})
218+
Cypress.Commands.addAll({ prevSubject: 'element' }, {
219+
newCommand: (subject, arg) => {
220+
subject // $ExpectType JQuery<HTMLElement>
221+
arg // $ExpectType any
222+
}
223+
})
224+
Cypress.Commands.addAll({ prevSubject: ['element'] }, {
225+
newCommand: (subject, arg) => {
226+
subject // $ExpectType JQuery<HTMLElement>
227+
arg // $ExpectType any
228+
}
229+
})
230+
Cypress.Commands.addAll({ prevSubject: ['element', 'document', 'window'] }, {
231+
newCommand: (subject, arg) => {
232+
if (subject instanceof Window) {
233+
subject // $ExpectType Window
234+
} else if (subject instanceof Document) {
235+
subject // $ExpectType Document
236+
} else {
237+
subject // $ExpectType JQuery<HTMLElement>
238+
}
239+
arg // $ExpectType any
240+
}
241+
})
242+
Cypress.Commands.addAll({ prevSubject: ['window', 'document', 'optional', 'element'] }, {
243+
newCommand: (subject, arg) => {
244+
if (subject instanceof Window) {
245+
subject // $ExpectType Window
246+
} else if (subject instanceof Document) {
247+
subject // $ExpectType Document
248+
} else if (subject) {
249+
subject // $ExpectType JQuery<HTMLElement>
250+
} else {
251+
subject // $ExpectType void
252+
}
253+
arg // $ExpectType any
254+
}
255+
})
256+
Cypress.Commands.addAll({
257+
newCommand: (arg) => {
258+
// $ExpectType any
259+
arg
260+
return cy.wrap(new Promise<number>((resolve) => { resolve(5) }))
261+
}
262+
})
263+
152264
Cypress.Commands.overwrite('newCommand', (originalFn, arg) => {
153265
arg // $ExpectType string
154266
originalFn // $ExpectedType Chainable['newCommand']

npm/react/docs/recipes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = (on, config) => {
5050
}
5151
```
5252

53-
See example in the folder [examples/nextjs](https://github.com/cypress-io/cypress/tree/develop/npm/react/https://github.com/cypress-io/cypress/tree/develop/npm/react/examples/nextjs).
53+
See example in the folder [examples/nextjs](https://github.com/cypress-io/cypress/tree/develop/npm/react/examples/nextjs).
5454

5555
### Your Webpack config
5656

npm/webpack-dev-server/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [@cypress/webpack-dev-server-v1.8.4](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.3...@cypress/webpack-dev-server-v1.8.4) (2022-03-29)
2+
3+
4+
### Bug Fixes
5+
6+
* **deps:** add 'lodash' to webpack-dev-server plugin dependencies ([#20815](https://github.com/cypress-io/cypress/issues/20815)) ([a472427](https://github.com/cypress-io/cypress/commit/a4724271601aff110c68ae4364e68764f22cd12c))
7+
18
# [@cypress/webpack-dev-server-v1.8.3](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.2...@cypress/webpack-dev-server-v1.8.3) (2022-03-15)
29

310

npm/webpack-dev-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"dependencies": {
1515
"debug": "^4.3.2",
16+
"lodash": "^4.17.21",
1617
"semver": "^7.3.4",
1718
"webpack-merge": "^5.4.0"
1819
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cypress",
3-
"version": "9.5.3",
3+
"version": "9.5.4",
44
"description": "Cypress.io end to end testing tool",
55
"private": true,
66
"scripts": {

packages/config/__snapshots__/index.spec.ts.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ exports['src/index .getDefaultValues returns list of public config keys 1'] = {
2626
"specPattern": "**/*.cy.{js,jsx,ts,tsx}",
2727
"indexHtmlFile": "cypress/support/component-index.html"
2828
},
29-
"cypressBinaryRoot": "/root/cypress",
3029
"defaultCommandTimeout": 4000,
3130
"downloadsFolder": "cypress/downloads",
3231
"e2e": {
3332
"specPattern": "cypress/e2e/**/*.cy.{js,jsx,ts,tsx}"
3433
},
3534
"env": {},
3635
"execTimeout": 60000,
37-
"exit": true,
3836
"experimentalFetchPolyfill": false,
3937
"experimentalInteractiveRunEvents": false,
4038
"experimentalSessionSupport": false,
@@ -81,6 +79,7 @@ exports['src/index .getDefaultValues returns list of public config keys 1'] = {
8179
"browsers": [],
8280
"clientRoute": "/__/",
8381
"configFile": "cypress.config.js",
82+
"cypressBinaryRoot": "/root/cypress",
8483
"devServerPublicPathRoute": "/__cypress/src",
8584
"hosts": null,
8685
"isInteractive": true,
@@ -107,7 +106,6 @@ exports['src/index .getPublicConfigKeys returns list of public config keys 1'] =
107106
"e2e",
108107
"env",
109108
"execTimeout",
110-
"exit",
111109
"experimentalFetchPolyfill",
112110
"experimentalInteractiveRunEvents",
113111
"experimentalSessionSupport",

packages/config/src/options.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ const resolvedOptions: Array<ResolvedConfigOption> = [
185185
defaultValue: 60000,
186186
validation: validate.isNumber,
187187
canUpdateDuringTestTime: true,
188-
}, {
189-
name: 'exit',
190-
defaultValue: true,
191-
validation: validate.isBoolean,
192-
canUpdateDuringTestTime: false,
193188
}, {
194189
name: 'experimentalFetchPolyfill',
195190
defaultValue: false,

0 commit comments

Comments
 (0)