Skip to content

Commit 0f201fe

Browse files
authored
Merge branch 'develop' into 9.0-release
2 parents 61e0444 + a639649 commit 0f201fe

File tree

84 files changed

+1611
-1013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1611
-1013
lines changed

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

browser-versions.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"chrome:beta": "94.0.4606.54",
3-
"chrome:stable": "94.0.4606.54"
2+
"chrome:beta": "95.0.4638.32",
3+
"chrome:stable": "94.0.4606.71"
44
}

circle.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,6 @@ jobs:
991991
- run: yarn lerna run build-prod --stream
992992
# run unit tests from each individual package
993993
- run: yarn test
994-
# check for compile errors with the releaserc scripts
995-
- run: yarn test-npm-package-release-script
996994
- verify-mocha-results:
997995
expectedResultCount: 9
998996
- store_test_results:
@@ -1002,6 +1000,14 @@ jobs:
10021000
path: cli/test/html
10031001
- store-npm-logs
10041002

1003+
unit-tests-release:
1004+
<<: *defaults
1005+
resource_class: medium
1006+
parallelism: 1
1007+
steps:
1008+
- restore_cached_workspace
1009+
- run: yarn test-npm-package-release-script
1010+
10051011
lint-types:
10061012
<<: *defaults
10071013
parallelism: 1
@@ -1975,6 +1981,10 @@ linux-workflow: &linux-workflow
19751981
- unit-tests:
19761982
requires:
19771983
- build
1984+
- unit-tests-release:
1985+
context: test-runner:npm-release
1986+
requires:
1987+
- build
19781988
- server-unit-tests:
19791989
requires:
19801990
- build
@@ -2108,6 +2118,7 @@ linux-workflow: &linux-workflow
21082118
- server-integration-tests
21092119
- server-unit-tests
21102120
- unit-tests
2121+
- unit-tests-release
21112122
- cli-visual-tests
21122123

21132124
# various testing scenarios, like building full binary

cli/lib/cypress.js

+17
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,23 @@ const cypressModuleApi = {
6868
return cli.parseRunCommand(args)
6969
},
7070
},
71+
72+
/**
73+
* Provides automatic code completion for configuration in many popular code editors.
74+
* While it's not strictly necessary for Cypress to parse your configuration, we
75+
* recommend wrapping your config object with `defineConfig()`
76+
* @example
77+
* module.exports = defineConfig({
78+
* viewportWith: 400
79+
* })
80+
*
81+
* @see ../types/cypress-npm-api.d.ts
82+
* @param {Cypress.ConfigOptions} config
83+
* @returns {Cypress.ConfigOptions} the configuration passed in parameter
84+
*/
85+
defineConfig (config) {
86+
return config
87+
},
7188
}
7289

7390
module.exports = cypressModuleApi

cli/types/cypress-npm-api.d.ts

+15
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,21 @@ declare module 'cypress' {
377377
* Cypress does
378378
*/
379379
cli: CypressCommandLine.CypressCliParser
380+
381+
/**
382+
* Provides automatic code completion for configuration in many popular code editors.
383+
* While it's not strictly necessary for Cypress to parse your configuration, we
384+
* recommend wrapping your config object with `defineConfig()`
385+
* @example
386+
* module.exports = defineConfig({
387+
* viewportWith: 400
388+
* })
389+
*
390+
* @see ../types/cypress-npm-api.d.ts
391+
* @param {Cypress.ConfigOptions} config
392+
* @returns {Cypress.ConfigOptions} the configuration passed in parameter
393+
*/
394+
defineConfig(config: Cypress.ConfigOptions): Cypress.ConfigOptions
380395
}
381396

382397
// export Cypress NPM module interface

cli/types/cypress.d.ts

+88-93
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ declare namespace Cypress {
168168
/**
169169
* The interface for user-defined properties in Window object under test.
170170
*/
171-
interface ApplicationWindow {} // tslint:disable-line
171+
interface ApplicationWindow { } // tslint:disable-line
172172

173173
/**
174174
* Several libraries are bundled with Cypress by default.
@@ -521,7 +521,7 @@ declare namespace Cypress {
521521
/**
522522
* @see https://on.cypress.io/keyboard-api
523523
*/
524-
Keyboard: {
524+
Keyboard: {
525525
defaults(options: Partial<KeyboardDefaultsOptions>): void
526526
}
527527

@@ -579,7 +579,7 @@ declare namespace Cypress {
579579
}
580580

581581
interface SessionOptions {
582-
validate?: () => false|void
582+
validate?: () => false | void
583583
}
584584

585585
type CanReturnChainable = void | Chainable | Promise<unknown>
@@ -717,36 +717,36 @@ declare namespace Cypress {
717717
```
718718
*/
719719
clearLocalStorage(re: RegExp): Chainable<Storage>
720-
/**
721-
* Clear data in local storage.
722-
* Cypress automatically runs this command before each test to prevent state from being
723-
* shared across tests. You shouldn’t need to use this command unless you’re using it
724-
* to clear localStorage inside a single test. Yields `localStorage` object.
725-
*
726-
* @see https://on.cypress.io/clearlocalstorage
727-
* @param {options} [object] - options object
728-
* @example
729-
```
730-
// Removes all local storage items, without logging
731-
cy.clearLocalStorage({ log: false })
732-
```
733-
*/
720+
/**
721+
* Clear data in local storage.
722+
* Cypress automatically runs this command before each test to prevent state from being
723+
* shared across tests. You shouldn’t need to use this command unless you’re using it
724+
* to clear localStorage inside a single test. Yields `localStorage` object.
725+
*
726+
* @see https://on.cypress.io/clearlocalstorage
727+
* @param {options} [object] - options object
728+
* @example
729+
```
730+
// Removes all local storage items, without logging
731+
cy.clearLocalStorage({ log: false })
732+
```
733+
*/
734734
clearLocalStorage(options: Partial<Loggable>): Chainable<Storage>
735-
/**
736-
* Clear data in local storage.
737-
* Cypress automatically runs this command before each test to prevent state from being
738-
* shared across tests. You shouldn’t need to use this command unless you’re using it
739-
* to clear localStorage inside a single test. Yields `localStorage` object.
740-
*
741-
* @see https://on.cypress.io/clearlocalstorage
742-
* @param {string} [key] - name of a particular item to remove (optional).
743-
* @param {options} [object] - options object
744-
* @example
745-
```
746-
// Removes item "todos" without logging
747-
cy.clearLocalStorage("todos", { log: false })
748-
```
749-
*/
735+
/**
736+
* Clear data in local storage.
737+
* Cypress automatically runs this command before each test to prevent state from being
738+
* shared across tests. You shouldn’t need to use this command unless you’re using it
739+
* to clear localStorage inside a single test. Yields `localStorage` object.
740+
*
741+
* @see https://on.cypress.io/clearlocalstorage
742+
* @param {string} [key] - name of a particular item to remove (optional).
743+
* @param {options} [object] - options object
744+
* @example
745+
```
746+
// Removes item "todos" without logging
747+
cy.clearLocalStorage("todos", { log: false })
748+
```
749+
*/
750750
clearLocalStorage(key: string, options: Partial<Loggable>): Chainable<Storage>
751751

752752
/**
@@ -834,7 +834,7 @@ declare namespace Cypress {
834834
* // or use this shortcut
835835
* cy.clock().invoke('restore')
836836
*/
837-
clock(now: number|Date, options?: Loggable): Chainable<Clock>
837+
clock(now: number | Date, options?: Loggable): Chainable<Clock>
838838
/**
839839
* Mocks global clock but only overrides specific functions.
840840
*
@@ -843,7 +843,7 @@ declare namespace Cypress {
843843
* // keep current date but override "setTimeout" and "clearTimeout"
844844
* cy.clock(null, ['setTimeout', 'clearTimeout'])
845845
*/
846-
clock(now: number|Date, functions?: Array<'setTimeout' | 'clearTimeout' | 'setInterval' | 'clearInterval' | 'Date'>, options?: Loggable): Chainable<Clock>
846+
clock(now: number | Date, functions?: Array<'setTimeout' | 'clearTimeout' | 'setInterval' | 'clearInterval' | 'Date'>, options?: Loggable): Chainable<Clock>
847847
/**
848848
* Mocks global clock and all functions.
849849
*
@@ -977,14 +977,14 @@ declare namespace Cypress {
977977
*/
978978
debug(options?: Partial<Loggable>): Chainable<Subject>
979979

980-
/**
981-
* Save/Restore browser Cookies, LocalStorage, and SessionStorage data resulting from the supplied `setup` function.
982-
*
983-
* Only available if the `experimentalSessionSupport` config option is enabled.
984-
*
985-
* @see https://on.cypress.io/session
986-
*/
987-
session(id: string|object, setup?: SessionOptions['validate'], options?: SessionOptions): Chainable<null>
980+
/**
981+
* Save/Restore browser Cookies, LocalStorage, and SessionStorage data resulting from the supplied `setup` function.
982+
*
983+
* Only available if the `experimentalSessionSupport` config option is enabled.
984+
*
985+
* @see https://on.cypress.io/session
986+
*/
987+
session(id: string | object, setup?: SessionOptions['validate'], options?: SessionOptions): Chainable<null>
988988

989989
/**
990990
* Get the window.document of the page that is currently active.
@@ -1648,17 +1648,11 @@ declare namespace Cypress {
16481648
scrollTo(x: number | string, y: number | string, options?: Partial<ScrollToOptions>): Chainable<Subject>
16491649

16501650
/**
1651-
* Select an `<option>` with specific text within a `<select>`.
1652-
*
1653-
* @see https://on.cypress.io/select
1654-
*/
1655-
select(text: string | string[], options?: Partial<SelectOptions>): Chainable<Subject>
1656-
/**
1657-
* Select an `<option>` with specific value(s) within a `<select>`.
1651+
* Select an `<option>` with specific text, value, or index within a `<select>`.
16581652
*
16591653
* @see https://on.cypress.io/select
16601654
*/
1661-
select(value: string | string[], options?: Partial<SelectOptions>): Chainable<Subject>
1655+
select(valueOrTextOrIndex: string | number | Array<string | number>, options?: Partial<SelectOptions>): Chainable<Subject>
16621656

16631657
/**
16641658
* @deprecated Use `cy.intercept()` instead.
@@ -1909,13 +1903,13 @@ declare namespace Cypress {
19091903
*
19101904
* @see https://on.cypress.io/then
19111905
*/
1912-
then<S extends HTMLElement>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S>>
1913-
/**
1914-
* Enables you to work with the subject yielded from the previous command / promise.
1915-
*
1916-
* @see https://on.cypress.io/then
1917-
*/
1918-
then<S extends ArrayLike<HTMLElement>>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S extends ArrayLike<infer T> ? T : never>>
1906+
then<S extends HTMLElement>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S>>
1907+
/**
1908+
* Enables you to work with the subject yielded from the previous command / promise.
1909+
*
1910+
* @see https://on.cypress.io/then
1911+
*/
1912+
then<S extends ArrayLike<HTMLElement>>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S extends ArrayLike<infer T> ? T : never>>
19191913
/**
19201914
* Enables you to work with the subject yielded from the previous command / promise.
19211915
*
@@ -2754,7 +2748,7 @@ declare namespace Cypress {
27542748
* To enable test retries only in runMode, set e.g. `{ openMode: null, runMode: 2 }`
27552749
* @default null
27562750
*/
2757-
retries: Nullable<number | {runMode?: Nullable<number>, openMode?: Nullable<number>}>
2751+
retries: Nullable<number | { runMode?: Nullable<number>, openMode?: Nullable<number> }>
27582752
/**
27592753
* Enables including elements within the shadow DOM when using querying
27602754
* commands (e.g. cy.get(), cy.find()). Can be set globally in cypress.json,
@@ -2891,7 +2885,7 @@ declare namespace Cypress {
28912885
* All configuration items are optional.
28922886
*/
28932887
type CoreConfigOptions = Partial<Omit<ResolvedConfigOptions, TestingType>>
2894-
type ConfigOptions = CoreConfigOptions & {e2e?: CoreConfigOptions, component?: CoreConfigOptions }
2888+
type ConfigOptions = CoreConfigOptions & { e2e?: CoreConfigOptions, component?: CoreConfigOptions }
28952889

28962890
interface PluginConfigOptions extends ResolvedConfigOptions {
28972891
/**
@@ -2998,6 +2992,7 @@ declare namespace Cypress {
29982992
disableTimersAndAnimations: boolean
29992993
padding: Padding
30002994
scale: boolean
2995+
overwrite: boolean
30012996
onBeforeScreenshot: ($el: JQuery) => void
30022997
onAfterScreenshot: ($el: JQuery, props: {
30032998
path: string
@@ -5703,48 +5698,48 @@ declare namespace Cypress {
57035698
}
57045699
```
57055700
*/
5706-
interface cy extends Chainable<undefined> {}
5701+
interface cy extends Chainable<undefined> { }
57075702
}
57085703

57095704
declare namespace Mocha {
57105705
interface TestFunction {
5711-
/**
5712-
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5713-
* as a thunk.
5714-
*/
5715-
(title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
5716-
5717-
/**
5718-
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5719-
* as a thunk.
5720-
*/
5721-
(title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
5706+
/**
5707+
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5708+
* as a thunk.
5709+
*/
5710+
(title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
5711+
5712+
/**
5713+
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5714+
* as a thunk.
5715+
*/
5716+
(title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
57225717
}
57235718
interface ExclusiveTestFunction {
5724-
/**
5725-
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5726-
* as a thunk.
5727-
*/
5728-
(title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
5729-
5730-
/**
5731-
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5732-
* as a thunk.
5733-
*/
5734-
(title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
5719+
/**
5720+
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5721+
* as a thunk.
5722+
*/
5723+
(title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
5724+
5725+
/**
5726+
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5727+
* as a thunk.
5728+
*/
5729+
(title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
57355730
}
57365731
interface PendingTestFunction {
5737-
/**
5738-
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5739-
* as a thunk.
5740-
*/
5741-
(title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
5742-
5743-
/**
5744-
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5745-
* as a thunk.
5746-
*/
5747-
(title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
5732+
/**
5733+
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5734+
* as a thunk.
5735+
*/
5736+
(title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
5737+
5738+
/**
5739+
* Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
5740+
* as a thunk.
5741+
*/
5742+
(title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
57485743
}
57495744

57505745
interface SuiteFunction {

0 commit comments

Comments
 (0)