cypress 9.6.1 → 10.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.mjs +15 -0
- package/lib/cli.js +72 -23
- package/lib/errors.js +16 -1
- package/lib/exec/open.js +45 -10
- package/lib/exec/run.js +17 -10
- package/lib/exec/shared.js +30 -9
- package/lib/exec/spawn.js +4 -0
- package/lib/exec/xvfb.js +1 -0
- package/lib/util.js +10 -3
- package/mount-utils/CHANGELOG.md +20 -0
- package/mount-utils/README.md +14 -0
- package/mount-utils/dist/index.d.ts +54 -0
- package/mount-utils/dist/index.js +134 -0
- package/mount-utils/package.json +31 -0
- package/package.json +39 -4
- package/react/CHANGELOG.md +373 -0
- package/react/README.md +414 -0
- package/react/dist/cypress-react.browser.js +497 -0
- package/react/dist/cypress-react.cjs.js +495 -0
- package/react/dist/cypress-react.esm-bundler.js +467 -0
- package/react/dist/getDisplayName.d.ts +8 -0
- package/react/dist/index.d.ts +2 -0
- package/react/dist/mount.d.ts +143 -0
- package/react/dist/mountHook.d.ts +11 -0
- package/react/package.json +105 -0
- package/types/bluebird/index.d.ts +18 -4
- package/types/cypress-eventemitter.d.ts +1 -1
- package/types/cypress-global-vars.d.ts +2 -2
- package/types/cypress-npm-api.d.ts +4 -10
- package/types/cypress.d.ts +180 -120
- package/types/minimatch/index.d.ts +15 -5
- package/vue/CHANGELOG.md +380 -0
- package/vue/README.md +678 -0
- package/vue/dist/cypress-vue.cjs.js +13535 -0
- package/vue/dist/cypress-vue.esm-bundler.js +13511 -0
- package/vue/dist/index.d.ts +56 -0
- package/vue/package.json +86 -0
- package/vue2/CHANGELOG.md +5 -0
- package/vue2/README.md +693 -0
- package/vue2/dist/cypress-vue2.browser.js +20191 -0
- package/vue2/dist/cypress-vue2.cjs.js +20188 -0
- package/vue2/dist/cypress-vue2.esm-bundler.js +20179 -0
- package/vue2/dist/index.d.ts +171 -0
- package/vue2/package.json +59 -0
package/types/cypress.d.ts
CHANGED
@@ -56,6 +56,16 @@ declare namespace Cypress {
|
|
56
56
|
password: string
|
57
57
|
}
|
58
58
|
|
59
|
+
interface RemoteState {
|
60
|
+
auth?: Auth
|
61
|
+
domainName: string
|
62
|
+
strategy: 'file' | 'http'
|
63
|
+
origin: string
|
64
|
+
fileServer: string | null
|
65
|
+
props: Record<string, any>
|
66
|
+
visiting: string
|
67
|
+
}
|
68
|
+
|
59
69
|
interface Backend {
|
60
70
|
/**
|
61
71
|
* Firefox only: Force Cypress to run garbage collection routines.
|
@@ -164,7 +174,7 @@ declare namespace Cypress {
|
|
164
174
|
|
165
175
|
/**
|
166
176
|
* Spec type for the given test. "integration" is the default, but
|
167
|
-
* tests run using `open
|
177
|
+
* tests run using `open --component` will be "component"
|
168
178
|
*
|
169
179
|
* @see https://on.cypress.io/experiments
|
170
180
|
*/
|
@@ -194,7 +204,7 @@ declare namespace Cypress {
|
|
194
204
|
/**
|
195
205
|
* The configuration for Cypress.
|
196
206
|
*/
|
197
|
-
type Config = ResolvedConfigOptions & RuntimeConfigOptions
|
207
|
+
type Config = ResolvedConfigOptions & RuntimeConfigOptions & RuntimeServerConfigOptions
|
198
208
|
|
199
209
|
/**
|
200
210
|
* Several libraries are bundled with Cypress by default.
|
@@ -388,7 +398,7 @@ declare namespace Cypress {
|
|
388
398
|
|
389
399
|
// no real way to type without generics
|
390
400
|
/**
|
391
|
-
* Returns all environment variables set with CYPRESS_ prefix or in "env" object in "cypress.
|
401
|
+
* Returns all environment variables set with CYPRESS_ prefix or in "env" object in "cypress.config.{js,ts,mjs,cjs}"
|
392
402
|
*
|
393
403
|
* @see https://on.cypress.io/env
|
394
404
|
*/
|
@@ -397,7 +407,7 @@ declare namespace Cypress {
|
|
397
407
|
* Returns specific environment variable or undefined
|
398
408
|
* @see https://on.cypress.io/env
|
399
409
|
* @example
|
400
|
-
* // cypress.
|
410
|
+
* // cypress.config.js
|
401
411
|
* { "env": { "foo": "bar" } }
|
402
412
|
* Cypress.env("foo") // => bar
|
403
413
|
*/
|
@@ -482,7 +492,15 @@ declare namespace Cypress {
|
|
482
492
|
*/
|
483
493
|
Cookies: {
|
484
494
|
debug(enabled: boolean, options?: Partial<DebugOptions>): void
|
495
|
+
/**
|
496
|
+
* @deprecated Use `cy.session()` instead.
|
497
|
+
* @see https://on.cypress.io/session
|
498
|
+
*/
|
485
499
|
preserveOnce(...names: string[]): void
|
500
|
+
/**
|
501
|
+
* @deprecated Use `cy.session()` instead.
|
502
|
+
* @see https://on.cypress.io/session
|
503
|
+
*/
|
486
504
|
defaults(options: Partial<CookieDefaults>): CookieDefaults
|
487
505
|
}
|
488
506
|
|
@@ -668,7 +686,7 @@ declare namespace Cypress {
|
|
668
686
|
* @see https://on.cypress.io/get
|
669
687
|
* @example
|
670
688
|
```
|
671
|
-
// Get the aliased
|
689
|
+
// Get the aliased 'todos' elements
|
672
690
|
cy.get('ul#todos').as('todos')
|
673
691
|
//...hack hack hack...
|
674
692
|
// later retrieve the todos
|
@@ -716,9 +734,9 @@ declare namespace Cypress {
|
|
716
734
|
*
|
717
735
|
* @see https://on.cypress.io/check
|
718
736
|
* @example
|
719
|
-
* // Select the radio with the value of
|
737
|
+
* // Select the radio with the value of 'US'
|
720
738
|
* cy.get('[type="radio"]').check('US')
|
721
|
-
* // Check the checkboxes with the values
|
739
|
+
* // Check the checkboxes with the values 'ga' and 'ca'
|
722
740
|
* cy.get('[type="checkbox"]').check(['ga', 'ca'])
|
723
741
|
*/
|
724
742
|
check(value: string | string[], options?: Partial<CheckOptions>): Chainable<Subject>
|
@@ -742,7 +760,7 @@ declare namespace Cypress {
|
|
742
760
|
|
743
761
|
/**
|
744
762
|
* Clear a specific browser cookie.
|
745
|
-
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn
|
763
|
+
* 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.
|
746
764
|
*
|
747
765
|
* @see https://on.cypress.io/clearcookie
|
748
766
|
*/
|
@@ -750,7 +768,7 @@ declare namespace Cypress {
|
|
750
768
|
|
751
769
|
/**
|
752
770
|
* Clear all browser cookies.
|
753
|
-
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn
|
771
|
+
* 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.
|
754
772
|
*
|
755
773
|
* @see https://on.cypress.io/clearcookies
|
756
774
|
*/
|
@@ -759,7 +777,7 @@ declare namespace Cypress {
|
|
759
777
|
/**
|
760
778
|
* Clear data in local storage.
|
761
779
|
* Cypress automatically runs this command before each test to prevent state from being
|
762
|
-
* shared across tests. You shouldn
|
780
|
+
* shared across tests. You shouldn't need to use this command unless you're using it
|
763
781
|
* to clear localStorage inside a single test. Yields `localStorage` object.
|
764
782
|
*
|
765
783
|
* @see https://on.cypress.io/clearlocalstorage
|
@@ -791,7 +809,7 @@ declare namespace Cypress {
|
|
791
809
|
/**
|
792
810
|
* Clear data in local storage.
|
793
811
|
* Cypress automatically runs this command before each test to prevent state from being
|
794
|
-
* shared across tests. You shouldn
|
812
|
+
* shared across tests. You shouldn't need to use this command unless you're using it
|
795
813
|
* to clear localStorage inside a single test. Yields `localStorage` object.
|
796
814
|
*
|
797
815
|
* @see https://on.cypress.io/clearlocalstorage
|
@@ -806,7 +824,7 @@ declare namespace Cypress {
|
|
806
824
|
/**
|
807
825
|
* Clear data in local storage.
|
808
826
|
* Cypress automatically runs this command before each test to prevent state from being
|
809
|
-
* shared across tests. You shouldn
|
827
|
+
* shared across tests. You shouldn't need to use this command unless you're using it
|
810
828
|
* to clear localStorage inside a single test. Yields `localStorage` object.
|
811
829
|
*
|
812
830
|
* @see https://on.cypress.io/clearlocalstorage
|
@@ -843,8 +861,8 @@ declare namespace Cypress {
|
|
843
861
|
/**
|
844
862
|
* Click a DOM element at specific coordinates
|
845
863
|
*
|
846
|
-
* @param {number} x The distance in pixels from the element
|
847
|
-
* @param {number} y The distance in pixels from the element
|
864
|
+
* @param {number} x The distance in pixels from the element's left to issue the click.
|
865
|
+
* @param {number} y The distance in pixels from the element's top to issue the click.
|
848
866
|
* @see https://on.cypress.io/click
|
849
867
|
* @example
|
850
868
|
```
|
@@ -999,8 +1017,8 @@ declare namespace Cypress {
|
|
999
1017
|
/**
|
1000
1018
|
* Double-click a DOM element at specific coordinates
|
1001
1019
|
*
|
1002
|
-
* @param {number} x The distance in pixels from the element
|
1003
|
-
* @param {number} y The distance in pixels from the element
|
1020
|
+
* @param {number} x The distance in pixels from the element's left to issue the click.
|
1021
|
+
* @param {number} y The distance in pixels from the element's top to issue the click.
|
1004
1022
|
* @see https://on.cypress.io/dblclick
|
1005
1023
|
* @example
|
1006
1024
|
```
|
@@ -1029,8 +1047,8 @@ declare namespace Cypress {
|
|
1029
1047
|
/**
|
1030
1048
|
* Right-click a DOM element at specific coordinates
|
1031
1049
|
*
|
1032
|
-
* @param {number} x The distance in pixels from the element
|
1033
|
-
* @param {number} y The distance in pixels from the element
|
1050
|
+
* @param {number} x The distance in pixels from the element's left to issue the click.
|
1051
|
+
* @param {number} y The distance in pixels from the element's top to issue the click.
|
1034
1052
|
* @see https://on.cypress.io/rightclick
|
1035
1053
|
* @example
|
1036
1054
|
```
|
@@ -1133,7 +1151,7 @@ declare namespace Cypress {
|
|
1133
1151
|
*
|
1134
1152
|
* @see https://on.cypress.io/find
|
1135
1153
|
* @example
|
1136
|
-
* // Find the li
|
1154
|
+
* // Find the li's within the nav
|
1137
1155
|
* cy.get('.left-nav>.nav').find('>li')
|
1138
1156
|
*/
|
1139
1157
|
find<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable & Shadow>): Chainable<JQuery<E>>
|
@@ -1205,7 +1223,7 @@ declare namespace Cypress {
|
|
1205
1223
|
* Get one or more DOM elements by alias.
|
1206
1224
|
* @see https://on.cypress.io/get#Alias
|
1207
1225
|
* @example
|
1208
|
-
* // Get the aliased
|
1226
|
+
* // Get the aliased 'todos' elements
|
1209
1227
|
* cy.get('ul#todos').as('todos')
|
1210
1228
|
* //...hack hack hack...
|
1211
1229
|
* //later retrieve the todos
|
@@ -1228,7 +1246,7 @@ declare namespace Cypress {
|
|
1228
1246
|
getCookies(options?: Partial<Loggable & Timeoutable>): Chainable<Cookie[]>
|
1229
1247
|
|
1230
1248
|
/**
|
1231
|
-
* Navigate back or forward to the previous or next URL in the browser
|
1249
|
+
* Navigate back or forward to the previous or next URL in the browser's history.
|
1232
1250
|
*
|
1233
1251
|
* @see https://on.cypress.io/go
|
1234
1252
|
*/
|
@@ -1273,7 +1291,7 @@ declare namespace Cypress {
|
|
1273
1291
|
invoke(propertyPath: string, ...args: any[]): Chainable
|
1274
1292
|
|
1275
1293
|
/**
|
1276
|
-
* Get a property
|
1294
|
+
* Get a property's value on the previously yielded subject.
|
1277
1295
|
*
|
1278
1296
|
* @see https://on.cypress.io/its
|
1279
1297
|
* @example
|
@@ -1870,7 +1888,7 @@ declare namespace Cypress {
|
|
1870
1888
|
*/
|
1871
1889
|
stub(): Agent<sinon.SinonStub>
|
1872
1890
|
/**
|
1873
|
-
* Stubs all the object
|
1891
|
+
* Stubs all the object's methods.
|
1874
1892
|
*
|
1875
1893
|
* @see https://on.cypress.io/stub
|
1876
1894
|
* @example
|
@@ -2128,11 +2146,11 @@ declare namespace Cypress {
|
|
2128
2146
|
* @example
|
2129
2147
|
* // Unchecks checkbox element
|
2130
2148
|
* cy.get('[type="checkbox"]').uncheck()
|
2131
|
-
* // Uncheck element with the id
|
2149
|
+
* // Uncheck element with the id 'saveUserName'
|
2132
2150
|
* cy.get('#saveUserName').uncheck()
|
2133
2151
|
* // Uncheck all checkboxes
|
2134
2152
|
* cy.get(':checkbox').uncheck()
|
2135
|
-
* // Uncheck the checkbox with the value of
|
2153
|
+
* // Uncheck the checkbox with the value of 'ga'
|
2136
2154
|
* cy.get('input[type="checkbox"]').uncheck(['ga'])
|
2137
2155
|
*/
|
2138
2156
|
uncheck(options?: Partial<CheckOptions>): Chainable<Subject>
|
@@ -2141,7 +2159,7 @@ declare namespace Cypress {
|
|
2141
2159
|
*
|
2142
2160
|
* @see https://on.cypress.io/uncheck
|
2143
2161
|
* @example
|
2144
|
-
* // Uncheck the checkbox with the value of
|
2162
|
+
* // Uncheck the checkbox with the value of 'ga'
|
2145
2163
|
* cy.get('input[type="checkbox"]').uncheck('ga')
|
2146
2164
|
*/
|
2147
2165
|
uncheck(value: string, options?: Partial<CheckOptions>): Chainable<Subject>
|
@@ -2150,7 +2168,7 @@ declare namespace Cypress {
|
|
2150
2168
|
*
|
2151
2169
|
* @see https://on.cypress.io/uncheck
|
2152
2170
|
* @example
|
2153
|
-
* // Uncheck the checkbox with the value of
|
2171
|
+
* // Uncheck the checkbox with the value of 'ga', 'ma'
|
2154
2172
|
* cy.get('input[type="checkbox"]').uncheck(['ga', 'ma'])
|
2155
2173
|
*/
|
2156
2174
|
uncheck(values: string[], options?: Partial<CheckOptions>): Chainable<Subject>
|
@@ -2640,9 +2658,9 @@ declare namespace Cypress {
|
|
2640
2658
|
certs: PEMCert[] | PFXCert[]
|
2641
2659
|
}
|
2642
2660
|
|
2643
|
-
interface ResolvedConfigOptions {
|
2661
|
+
interface ResolvedConfigOptions<ComponentDevServerOpts = any> {
|
2644
2662
|
/**
|
2645
|
-
* Url used as prefix for [cy.visit()](https://on.cypress.io/visit) or [cy.request()](https://on.cypress.io/request) command
|
2663
|
+
* Url used as prefix for [cy.visit()](https://on.cypress.io/visit) or [cy.request()](https://on.cypress.io/request) command's url
|
2646
2664
|
* @default null
|
2647
2665
|
*/
|
2648
2666
|
baseUrl: string | null
|
@@ -2655,7 +2673,7 @@ declare namespace Cypress {
|
|
2655
2673
|
* 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.
|
2656
2674
|
* @default "*.hot-update.js"
|
2657
2675
|
*/
|
2658
|
-
|
2676
|
+
excludeSpecPattern: string | string[]
|
2659
2677
|
/**
|
2660
2678
|
* 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.
|
2661
2679
|
* @default 50
|
@@ -2726,11 +2744,6 @@ declare namespace Cypress {
|
|
2726
2744
|
* @default "cypress/fixtures"
|
2727
2745
|
*/
|
2728
2746
|
fixturesFolder: string | false
|
2729
|
-
/**
|
2730
|
-
* Path to folder containing integration test files
|
2731
|
-
* @default "cypress/integration"
|
2732
|
-
*/
|
2733
|
-
integrationFolder: string
|
2734
2747
|
/**
|
2735
2748
|
* Path to folder where files downloaded during a test are saved
|
2736
2749
|
* @default "cypress/downloads"
|
@@ -2741,11 +2754,6 @@ declare namespace Cypress {
|
|
2741
2754
|
* @default "bundled"
|
2742
2755
|
*/
|
2743
2756
|
nodeVersion: 'system' | 'bundled'
|
2744
|
-
/**
|
2745
|
-
* Path to plugins file. (Pass false to disable)
|
2746
|
-
* @default "cypress/plugins/index.js"
|
2747
|
-
*/
|
2748
|
-
pluginsFile: string | false
|
2749
2757
|
/**
|
2750
2758
|
* The application under test cannot redirect more than this limit.
|
2751
2759
|
* @default 20
|
@@ -2767,13 +2775,13 @@ declare namespace Cypress {
|
|
2767
2775
|
*/
|
2768
2776
|
screenshotOnRunFailure: boolean
|
2769
2777
|
/**
|
2770
|
-
* Path to folder where screenshots will be saved from [cy.screenshot()](https://on.cypress.io/screenshot) command or after a headless or CI run
|
2778
|
+
* Path to folder where screenshots will be saved from [cy.screenshot()](https://on.cypress.io/screenshot) command or after a headless or CI run's test failure
|
2771
2779
|
* @default "cypress/screenshots"
|
2772
2780
|
*/
|
2773
2781
|
screenshotsFolder: string | false
|
2774
2782
|
/**
|
2775
2783
|
* Path to file to load before test files load. This file is compiled and bundled. (Pass false to disable)
|
2776
|
-
* @default "cypress/support/
|
2784
|
+
* @default "cypress/support/{e2e|component}.js"
|
2777
2785
|
*/
|
2778
2786
|
supportFile: string | false
|
2779
2787
|
/**
|
@@ -2797,7 +2805,7 @@ declare namespace Cypress {
|
|
2797
2805
|
*/
|
2798
2806
|
video: boolean
|
2799
2807
|
/**
|
2800
|
-
* Whether Cypress will upload the video to the Dashboard even if all tests are passing. This applies only when recording your runs to the Dashboard. Turn this off if you
|
2808
|
+
* Whether Cypress will upload the video to the Dashboard even if all tests are passing. This applies only when recording your runs to the Dashboard. Turn this off if you'd like the video uploaded only when there are failing tests.
|
2801
2809
|
* @default true
|
2802
2810
|
*/
|
2803
2811
|
videoUploadOnPasses: boolean
|
@@ -2807,12 +2815,12 @@ declare namespace Cypress {
|
|
2807
2815
|
*/
|
2808
2816
|
chromeWebSecurity: boolean
|
2809
2817
|
/**
|
2810
|
-
* Default height in pixels for the application under tests
|
2818
|
+
* Default height in pixels for the application under tests' viewport (Override with [cy.viewport()](https://on.cypress.io/viewport) command)
|
2811
2819
|
* @default 660
|
2812
2820
|
*/
|
2813
2821
|
viewportHeight: number
|
2814
2822
|
/**
|
2815
|
-
* Default width in pixels for the application under tests
|
2823
|
+
* Default width in pixels for the application under tests' viewport. (Override with [cy.viewport()](https://on.cypress.io/viewport) command)
|
2816
2824
|
* @default 1000
|
2817
2825
|
*/
|
2818
2826
|
viewportWidth: number
|
@@ -2846,11 +2854,6 @@ declare namespace Cypress {
|
|
2846
2854
|
* @default false
|
2847
2855
|
*/
|
2848
2856
|
experimentalSourceRewriting: boolean
|
2849
|
-
/**
|
2850
|
-
* Generate and save commands directly to your test suite by interacting with your app as an end user would.
|
2851
|
-
* @default false
|
2852
|
-
*/
|
2853
|
-
experimentalStudio: boolean
|
2854
2857
|
/**
|
2855
2858
|
* Number of times to retry a failed test.
|
2856
2859
|
* If a number is set, tests will retry in both runMode and openMode.
|
@@ -2860,7 +2863,7 @@ declare namespace Cypress {
|
|
2860
2863
|
retries: Nullable<number | { runMode?: Nullable<number>, openMode?: Nullable<number> }>
|
2861
2864
|
/**
|
2862
2865
|
* Enables including elements within the shadow DOM when using querying
|
2863
|
-
* commands (e.g. cy.get(), cy.find()). Can be set globally in cypress.
|
2866
|
+
* commands (e.g. cy.get(), cy.find()). Can be set globally in cypress.config.{js,ts,mjs,cjs},
|
2864
2867
|
* per-suite or per-test in the test configuration object, or programmatically
|
2865
2868
|
* with Cypress.config()
|
2866
2869
|
* @default false
|
@@ -2871,10 +2874,6 @@ declare namespace Cypress {
|
|
2871
2874
|
* The list of hosts to be blocked
|
2872
2875
|
*/
|
2873
2876
|
blockHosts: null | string | string[]
|
2874
|
-
/**
|
2875
|
-
* Path to folder containing component test files.
|
2876
|
-
*/
|
2877
|
-
componentFolder: false | string
|
2878
2877
|
/**
|
2879
2878
|
* A unique ID for the project used for recording
|
2880
2879
|
*/
|
@@ -2886,7 +2885,7 @@ declare namespace Cypress {
|
|
2886
2885
|
/**
|
2887
2886
|
* Glob pattern to determine what test files to load.
|
2888
2887
|
*/
|
2889
|
-
|
2888
|
+
specPattern: string | string[]
|
2890
2889
|
/**
|
2891
2890
|
* The user agent the browser sends in all request headers.
|
2892
2891
|
*/
|
@@ -2900,34 +2899,41 @@ declare namespace Cypress {
|
|
2900
2899
|
* Override default config options for Component Testing runner.
|
2901
2900
|
* @default {}
|
2902
2901
|
*/
|
2903
|
-
component:
|
2902
|
+
component: ComponentConfigOptions<ComponentDevServerOpts>
|
2904
2903
|
|
2905
2904
|
/**
|
2906
2905
|
* Override default config options for E2E Testing runner.
|
2907
2906
|
* @default {}
|
2908
2907
|
*/
|
2909
|
-
e2e: Omit<
|
2908
|
+
e2e: Omit<CoreConfigOptions, 'indexHtmlFile'>
|
2910
2909
|
|
2911
2910
|
/**
|
2912
2911
|
* An array of objects defining the certificates
|
2913
2912
|
*/
|
2914
2913
|
clientCertificates: ClientCertificate[]
|
2914
|
+
|
2915
|
+
/**
|
2916
|
+
* Handle Cypress plugins
|
2917
|
+
*/
|
2918
|
+
setupNodeEvents: (on: PluginEvents, config: PluginConfigOptions) => Promise<PluginConfigOptions | void> | PluginConfigOptions | void
|
2919
|
+
|
2920
|
+
indexHtmlFile: string
|
2915
2921
|
}
|
2916
2922
|
|
2917
2923
|
/**
|
2918
2924
|
* Options appended to config object on runtime.
|
2919
2925
|
*/
|
2920
|
-
interface RuntimeConfigOptions {
|
2926
|
+
interface RuntimeConfigOptions extends Partial<RuntimeServerConfigOptions> {
|
2927
|
+
/**
|
2928
|
+
* Absolute path to the config file (default: <projectRoot>/cypress.config.{js,ts,mjs,cjs})
|
2929
|
+
*/
|
2930
|
+
configFile: string
|
2921
2931
|
/**
|
2922
2932
|
* CPU architecture, from Node `os.arch()`
|
2923
2933
|
*
|
2924
2934
|
* @see https://nodejs.org/api/os.html#os_os_arch
|
2925
2935
|
*/
|
2926
2936
|
arch: string
|
2927
|
-
/**
|
2928
|
-
* The browser Cypress is running on.
|
2929
|
-
*/
|
2930
|
-
browser: Browser
|
2931
2937
|
/**
|
2932
2938
|
* Available browsers found on your system.
|
2933
2939
|
*/
|
@@ -2951,27 +2957,40 @@ declare namespace Cypress {
|
|
2951
2957
|
* The platform Cypress is running on.
|
2952
2958
|
*/
|
2953
2959
|
platform: 'linux' | 'darwin' | 'win32'
|
2960
|
+
remote: RemoteState
|
2954
2961
|
/**
|
2955
2962
|
* The Cypress version being used.
|
2956
2963
|
*/
|
2957
2964
|
version: string
|
2958
2965
|
|
2966
|
+
// Internal or Unlisted at server/lib/config_options
|
2967
|
+
namespace: string
|
2968
|
+
projectRoot: string
|
2969
|
+
devServerPublicPathRoute: string
|
2970
|
+
cypressBinaryRoot: string
|
2971
|
+
}
|
2972
|
+
|
2973
|
+
/**
|
2974
|
+
* Optional options added before the server starts
|
2975
|
+
*/
|
2976
|
+
interface RuntimeServerConfigOptions {
|
2977
|
+
/**
|
2978
|
+
* The browser Cypress is running on.
|
2979
|
+
*/
|
2980
|
+
browser: Browser
|
2959
2981
|
// Internal or Unlisted at server/lib/config_options
|
2960
2982
|
autoOpen: boolean
|
2961
2983
|
browserUrl: string
|
2962
2984
|
clientRoute: string
|
2963
|
-
configFile: string
|
2964
2985
|
cypressEnv: string
|
2965
|
-
devServerPublicPathRoute: string
|
2966
2986
|
isNewProject: boolean
|
2967
2987
|
isTextTerminal: boolean
|
2968
2988
|
morgan: boolean
|
2969
|
-
namespace: string
|
2970
2989
|
parentTestsFolder: string
|
2971
2990
|
parentTestsFolderDisplay: string
|
2972
2991
|
projectName: string
|
2973
|
-
projectRoot: string
|
2974
2992
|
proxyUrl: string
|
2993
|
+
remote: RemoteState
|
2975
2994
|
report: boolean
|
2976
2995
|
reporterRoute: string
|
2977
2996
|
reporterUrl: string
|
@@ -2984,7 +3003,7 @@ declare namespace Cypress {
|
|
2984
3003
|
xhrUrl: string
|
2985
3004
|
}
|
2986
3005
|
|
2987
|
-
interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | '
|
3006
|
+
interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations' | 'experimentalSessionAndOrigin'>> {
|
2988
3007
|
browser?: IsBrowserMatcher | IsBrowserMatcher[]
|
2989
3008
|
keystrokeDelay?: number
|
2990
3009
|
}
|
@@ -2993,13 +3012,54 @@ declare namespace Cypress {
|
|
2993
3012
|
* All configuration items are optional.
|
2994
3013
|
*/
|
2995
3014
|
type CoreConfigOptions = Partial<Omit<ResolvedConfigOptions, TestingType>>
|
2996
|
-
type ConfigOptions = CoreConfigOptions & { e2e?: CoreConfigOptions, component?: CoreConfigOptions }
|
2997
3015
|
|
2998
|
-
interface
|
2999
|
-
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3016
|
+
interface DefineDevServerConfig {
|
3017
|
+
// This interface can be extended by the user, to inject the types for their
|
3018
|
+
// preferred bundler: e.g.
|
3019
|
+
//
|
3020
|
+
// import type * as webpack from 'webpack'
|
3021
|
+
//
|
3022
|
+
// declare global {
|
3023
|
+
// namespace Cypress {
|
3024
|
+
// interface DefineDevServerConfig {
|
3025
|
+
// webpackConfig?: webpack.Configuration
|
3026
|
+
// }
|
3027
|
+
// }
|
3028
|
+
// }
|
3029
|
+
[key: string]: any
|
3030
|
+
}
|
3031
|
+
|
3032
|
+
type PickConfigOpt<T> = T extends keyof DefineDevServerConfig ? DefineDevServerConfig[T] : any
|
3033
|
+
|
3034
|
+
type DevServerFn<ComponentDevServerOpts = any> = (cypressDevServerConfig: DevServerConfig, devServerConfig: ComponentDevServerOpts) => ResolvedDevServerConfig | Promise<ResolvedDevServerConfig>
|
3035
|
+
|
3036
|
+
type DevServerConfigOptions = {
|
3037
|
+
bundler: 'webpack'
|
3038
|
+
framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app' | 'next'
|
3039
|
+
webpackConfig?: PickConfigOpt<'webpackConfig'>
|
3040
|
+
} | {
|
3041
|
+
bundler: 'vite'
|
3042
|
+
framework: 'react' | 'vue'
|
3043
|
+
viteConfig?: Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>
|
3044
|
+
}
|
3045
|
+
|
3046
|
+
interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalSessionAndOrigin'> {
|
3047
|
+
devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
|
3048
|
+
devServerConfig?: ComponentDevServerOpts
|
3049
|
+
}
|
3050
|
+
|
3051
|
+
/**
|
3052
|
+
* Config options that can be assigned on cypress.config.{js,ts,mjs,cjs} file
|
3053
|
+
*/
|
3054
|
+
type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern' | 'indexHtmlFile'>
|
3055
|
+
|
3056
|
+
/**
|
3057
|
+
* Takes ComponentDevServerOpts to track the signature of the devServerConfig for the provided `devServer`,
|
3058
|
+
* so we have proper completion for `devServerConfig`
|
3059
|
+
*/
|
3060
|
+
type ConfigOptions<ComponentDevServerOpts = any> = Partial<UserConfigOptions<ComponentDevServerOpts>>
|
3061
|
+
|
3062
|
+
interface PluginConfigOptions extends ResolvedConfigOptions, RuntimeConfigOptions {
|
3003
3063
|
/**
|
3004
3064
|
* Absolute path to the root of the project
|
3005
3065
|
*/
|
@@ -3293,7 +3353,7 @@ declare namespace Cypress {
|
|
3293
3353
|
|
3294
3354
|
/**
|
3295
3355
|
* Cypress will automatically apply the right authorization headers
|
3296
|
-
* if you
|
3356
|
+
* if you're attempting to visit an application that requires
|
3297
3357
|
* Basic Authentication.
|
3298
3358
|
*
|
3299
3359
|
* @example
|
@@ -3364,7 +3424,7 @@ declare namespace Cypress {
|
|
3364
3424
|
interface Chainer<Subject> {
|
3365
3425
|
// chai
|
3366
3426
|
/**
|
3367
|
-
* Asserts that the target
|
3427
|
+
* Asserts that the target's `type` is equal to the given string type.
|
3368
3428
|
* Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
3369
3429
|
* https://github.com/chaijs/type-detect.
|
3370
3430
|
* @example
|
@@ -3383,7 +3443,7 @@ declare namespace Cypress {
|
|
3383
3443
|
*/
|
3384
3444
|
(chainer: 'be.above', value: number | Date): Chainable<Subject>
|
3385
3445
|
/**
|
3386
|
-
* Asserts that the target
|
3446
|
+
* Asserts that the target's `type` is equal to the given string type.
|
3387
3447
|
* Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
3388
3448
|
* https://github.com/chaijs/type-detect.
|
3389
3449
|
* @example
|
@@ -3420,7 +3480,7 @@ declare namespace Cypress {
|
|
3420
3480
|
*/
|
3421
3481
|
(chainer: 'be.arguments'): Chainable<Subject>
|
3422
3482
|
/**
|
3423
|
-
* Asserts that the target is a number that
|
3483
|
+
* Asserts that the target is a number that's within a given +/- `delta` range of the given number `expected`. However, it's often best to assert that the target is equal to its expected value.
|
3424
3484
|
* @example
|
3425
3485
|
* cy.wrap(5.1).should('be.approximately', 5, 0.5)
|
3426
3486
|
* @alias closeTo
|
@@ -3429,7 +3489,7 @@ declare namespace Cypress {
|
|
3429
3489
|
*/
|
3430
3490
|
(chainer: 'be.approximately', value: number, delta: number): Chainable<Subject>
|
3431
3491
|
/**
|
3432
|
-
* Asserts that the target is a number that
|
3492
|
+
* Asserts that the target is a number that's within a given +/- `delta` range of the given number `expected`. However, it's often best to assert that the target is equal to its expected value.
|
3433
3493
|
* @example
|
3434
3494
|
* cy.wrap(5.1).should('be.closeTo', 5, 0.5)
|
3435
3495
|
* @see http://chaijs.com/api/bdd/#method_closeto
|
@@ -3437,7 +3497,7 @@ declare namespace Cypress {
|
|
3437
3497
|
*/
|
3438
3498
|
(chainer: 'be.closeTo', value: number, delta: number): Chainable<Subject>
|
3439
3499
|
/**
|
3440
|
-
* When the target is a string or array, .empty asserts that the target
|
3500
|
+
* When the target is a string or array, .empty asserts that the target's length property is strictly (===) equal to 0
|
3441
3501
|
* @example
|
3442
3502
|
* cy.wrap([]).should('be.empty')
|
3443
3503
|
* cy.wrap('').should('be.empty')
|
@@ -3604,7 +3664,7 @@ declare namespace Cypress {
|
|
3604
3664
|
(chainer: 'contain', value: any): Chainable<Subject>
|
3605
3665
|
/**
|
3606
3666
|
* When one argument is provided, `.decrease` asserts that the given function `subject` returns a lesser number when it's invoked after invoking the target function compared to when it's invoked beforehand.
|
3607
|
-
* `.decrease` also causes all `.by` assertions that follow in the chain to assert how much lesser of a number is returned.
|
3667
|
+
* `.decrease` also causes all `.by` assertions that follow in the chain to assert how much lesser of a number is returned. It's often best to assert that the return value decreased by the expected amount, rather than asserting it decreased by any amount.
|
3608
3668
|
* @example
|
3609
3669
|
* let val = 1
|
3610
3670
|
* function subtractTwo() { val -= 2 }
|
@@ -3715,7 +3775,7 @@ declare namespace Cypress {
|
|
3715
3775
|
*/
|
3716
3776
|
(chainer: 'have.deep.property', value: string, obj: object): Chainable<Subject>
|
3717
3777
|
/**
|
3718
|
-
* Asserts that the target
|
3778
|
+
* Asserts that the target's `length` property is equal to the given number `n`.
|
3719
3779
|
* @example
|
3720
3780
|
* cy.wrap([1, 2, 3]).should('have.length', 3)
|
3721
3781
|
* cy.wrap('foo').should('have.length', 3)
|
@@ -3725,7 +3785,7 @@ declare namespace Cypress {
|
|
3725
3785
|
*/
|
3726
3786
|
(chainer: 'have.length' | 'have.lengthOf', value: number): Chainable<Subject>
|
3727
3787
|
/**
|
3728
|
-
* Asserts that the target
|
3788
|
+
* Asserts that the target's `length` property is greater than to the given number `n`.
|
3729
3789
|
* @example
|
3730
3790
|
* cy.wrap([1, 2, 3]).should('have.length.greaterThan', 2)
|
3731
3791
|
* cy.wrap('foo').should('have.length.greaterThan', 2)
|
@@ -3734,7 +3794,7 @@ declare namespace Cypress {
|
|
3734
3794
|
*/
|
3735
3795
|
(chainer: 'have.length.greaterThan' | 'have.lengthOf.greaterThan', value: number): Chainable<Subject>
|
3736
3796
|
/**
|
3737
|
-
* Asserts that the target
|
3797
|
+
* Asserts that the target's `length` property is greater than to the given number `n`.
|
3738
3798
|
* @example
|
3739
3799
|
* cy.wrap([1, 2, 3]).should('have.length.gt', 2)
|
3740
3800
|
* cy.wrap('foo').should('have.length.gt', 2)
|
@@ -3743,7 +3803,7 @@ declare namespace Cypress {
|
|
3743
3803
|
*/
|
3744
3804
|
(chainer: 'have.length.gt' | 'have.lengthOf.gt' | 'have.length.above' | 'have.lengthOf.above', value: number): Chainable<Subject>
|
3745
3805
|
/**
|
3746
|
-
* Asserts that the target
|
3806
|
+
* Asserts that the target's `length` property is greater than or equal to the given number `n`.
|
3747
3807
|
* @example
|
3748
3808
|
* cy.wrap([1, 2, 3]).should('have.length.gte', 2)
|
3749
3809
|
* cy.wrap('foo').should('have.length.gte', 2)
|
@@ -3752,7 +3812,7 @@ declare namespace Cypress {
|
|
3752
3812
|
*/
|
3753
3813
|
(chainer: 'have.length.gte' | 'have.lengthOf.gte' | 'have.length.at.least' | 'have.lengthOf.at.least', value: number): Chainable<Subject>
|
3754
3814
|
/**
|
3755
|
-
* Asserts that the target
|
3815
|
+
* Asserts that the target's `length` property is less than to the given number `n`.
|
3756
3816
|
* @example
|
3757
3817
|
* cy.wrap([1, 2, 3]).should('have.length.lessThan', 4)
|
3758
3818
|
* cy.wrap('foo').should('have.length.lessThan', 4)
|
@@ -3761,7 +3821,7 @@ declare namespace Cypress {
|
|
3761
3821
|
*/
|
3762
3822
|
(chainer: 'have.length.lessThan' | 'have.lengthOf.lessThan', value: number): Chainable<Subject>
|
3763
3823
|
/**
|
3764
|
-
* Asserts that the target
|
3824
|
+
* Asserts that the target's `length` property is less than to the given number `n`.
|
3765
3825
|
* @example
|
3766
3826
|
* cy.wrap([1, 2, 3]).should('have.length.lt', 4)
|
3767
3827
|
* cy.wrap('foo').should('have.length.lt', 4)
|
@@ -3770,7 +3830,7 @@ declare namespace Cypress {
|
|
3770
3830
|
*/
|
3771
3831
|
(chainer: 'have.length.lt' | 'have.lengthOf.lt' | 'have.length.below' | 'have.lengthOf.below', value: number): Chainable<Subject>
|
3772
3832
|
/**
|
3773
|
-
* Asserts that the target
|
3833
|
+
* Asserts that the target's `length` property is less than or equal to the given number `n`.
|
3774
3834
|
* @example
|
3775
3835
|
* cy.wrap([1, 2, 3]).should('have.length.lte', 4)
|
3776
3836
|
* cy.wrap('foo').should('have.length.lte', 4)
|
@@ -3779,7 +3839,7 @@ declare namespace Cypress {
|
|
3779
3839
|
*/
|
3780
3840
|
(chainer: 'have.length.lte' | 'have.lengthOf.lte' | 'have.length.at.most' | 'have.lengthOf.at.most', value: number): Chainable<Subject>
|
3781
3841
|
/**
|
3782
|
-
* Asserts that the target
|
3842
|
+
* Asserts that the target's `length` property is within `start` and `finish`.
|
3783
3843
|
* @example
|
3784
3844
|
* cy.wrap([1, 2, 3]).should('have.length.within', 1, 5)
|
3785
3845
|
* @see http://chaijs.com/api/bdd/#method_lengthof
|
@@ -3856,9 +3916,9 @@ declare namespace Cypress {
|
|
3856
3916
|
* When one argument is provided, `.increase` asserts that the given function `subject` returns a greater number when it's
|
3857
3917
|
* invoked after invoking the target function compared to when it's invoked beforehand.
|
3858
3918
|
* `.increase` also causes all `.by` assertions that follow in the chain to assert how much greater of a number is returned.
|
3859
|
-
*
|
3919
|
+
* It's often best to assert that the return value increased by the expected amount, rather than asserting it increased by any amount.
|
3860
3920
|
*
|
3861
|
-
* When two arguments are provided, `.increase` asserts that the value of the given object `subject
|
3921
|
+
* When two arguments are provided, `.increase` asserts that the value of the given object `subject`'s `prop` property is greater after
|
3862
3922
|
* invoking the target function compared to beforehand.
|
3863
3923
|
*
|
3864
3924
|
* @example
|
@@ -3943,7 +4003,7 @@ declare namespace Cypress {
|
|
3943
4003
|
*/
|
3944
4004
|
(chainer: 'be.extensible'): Chainable<Subject>
|
3945
4005
|
/**
|
3946
|
-
* Asserts that the target is sealed, which means that new properties can
|
4006
|
+
* Asserts that the target is sealed, which means that new properties can't be added to it, and its existing properties can't be reconfigured or deleted.
|
3947
4007
|
* @example
|
3948
4008
|
* let sealedObject = Object.seal({})
|
3949
4009
|
* let frozenObject = Object.freeze({})
|
@@ -3954,7 +4014,7 @@ declare namespace Cypress {
|
|
3954
4014
|
*/
|
3955
4015
|
(chainer: 'be.sealed'): Chainable<Subject>
|
3956
4016
|
/**
|
3957
|
-
* Asserts that the target is frozen, which means that new properties can
|
4017
|
+
* Asserts that the target is frozen, which means that new properties can't be added to it, and its existing properties can't be reassigned to different values, reconfigured, or deleted.
|
3958
4018
|
* @example
|
3959
4019
|
* let frozenObject = Object.freeze({})
|
3960
4020
|
* cy.wrap(frozenObject).should('be.frozen')
|
@@ -3963,7 +4023,7 @@ declare namespace Cypress {
|
|
3963
4023
|
*/
|
3964
4024
|
(chainer: 'be.frozen'): Chainable<Subject>
|
3965
4025
|
/**
|
3966
|
-
* Asserts that the target is a number, and isn
|
4026
|
+
* Asserts that the target is a number, and isn't `NaN` or positive/negative `Infinity`.
|
3967
4027
|
* @example
|
3968
4028
|
* cy.wrap(1).should('be.finite')
|
3969
4029
|
* @see http://chaijs.com/api/bdd/#method_finite
|
@@ -3973,7 +4033,7 @@ declare namespace Cypress {
|
|
3973
4033
|
|
3974
4034
|
// chai.not
|
3975
4035
|
/**
|
3976
|
-
* Asserts that the target
|
4036
|
+
* Asserts that the target's `type` is not equal to the given string type.
|
3977
4037
|
* Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
3978
4038
|
* https://github.com/chaijs/type-detect.
|
3979
4039
|
* @example
|
@@ -3992,7 +4052,7 @@ declare namespace Cypress {
|
|
3992
4052
|
*/
|
3993
4053
|
(chainer: 'not.be.above', value: number | Date): Chainable<Subject>
|
3994
4054
|
/**
|
3995
|
-
* Asserts that the target
|
4055
|
+
* Asserts that the target's `type` is not equal to the given string type.
|
3996
4056
|
* Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
3997
4057
|
* https://github.com/chaijs/type-detect.
|
3998
4058
|
* @example
|
@@ -4029,7 +4089,7 @@ declare namespace Cypress {
|
|
4029
4089
|
*/
|
4030
4090
|
(chainer: 'not.be.arguments'): Chainable<Subject>
|
4031
4091
|
/**
|
4032
|
-
* Asserts that the target is a not number that
|
4092
|
+
* Asserts that the target is a not number that's within a given +/- `delta` range of the given number `expected`. However, it's often best to assert that the target is equal to its expected value.
|
4033
4093
|
* @example
|
4034
4094
|
* cy.wrap(5.1).should('not.be.approximately', 6, 0.5)
|
4035
4095
|
* @alias closeTo
|
@@ -4038,7 +4098,7 @@ declare namespace Cypress {
|
|
4038
4098
|
*/
|
4039
4099
|
(chainer: 'not.be.approximately', value: number, delta: number): Chainable<Subject>
|
4040
4100
|
/**
|
4041
|
-
* Asserts that the target is not a number that
|
4101
|
+
* Asserts that the target is not a number that's within a given +/- `delta` range of the given number `expected`. However, it's often best to assert that the target is equal to its expected value.
|
4042
4102
|
* @example
|
4043
4103
|
* cy.wrap(5.1).should('not.be.closeTo', 6, 0.5)
|
4044
4104
|
* @see http://chaijs.com/api/bdd/#method_closeto
|
@@ -4046,7 +4106,7 @@ declare namespace Cypress {
|
|
4046
4106
|
*/
|
4047
4107
|
(chainer: 'not.be.closeTo', value: number, delta: number): Chainable<Subject>
|
4048
4108
|
/**
|
4049
|
-
* When the target is a not string or array, .empty asserts that the target
|
4109
|
+
* When the target is a not string or array, .empty asserts that the target's length property is strictly (===) equal to 0
|
4050
4110
|
* @example
|
4051
4111
|
* cy.wrap([1]).should('not.be.empty')
|
4052
4112
|
* cy.wrap('foo').should('not.be.empty')
|
@@ -4213,7 +4273,7 @@ declare namespace Cypress {
|
|
4213
4273
|
(chainer: 'not.contain', value: any): Chainable<Subject>
|
4214
4274
|
/**
|
4215
4275
|
* When one argument is provided, `.decrease` asserts that the given function `subject` does not returns a lesser number when it's invoked after invoking the target function compared to when it's invoked beforehand.
|
4216
|
-
* `.decrease` also causes all `.by` assertions that follow in the chain to assert how much lesser of a number is returned.
|
4276
|
+
* `.decrease` also causes all `.by` assertions that follow in the chain to assert how much lesser of a number is returned. It's often best to assert that the return value decreased by the expected amount, rather than asserting it decreased by any amount.
|
4217
4277
|
* @example
|
4218
4278
|
* let val = 1
|
4219
4279
|
* function subtractTwo() { val -= 2 }
|
@@ -4299,7 +4359,7 @@ declare namespace Cypress {
|
|
4299
4359
|
*/
|
4300
4360
|
(chainer: 'not.have.deep.property', value: string, obj: object): Chainable<Subject>
|
4301
4361
|
/**
|
4302
|
-
* Asserts that the target
|
4362
|
+
* Asserts that the target's `length` property is not equal to the given number `n`.
|
4303
4363
|
* @example
|
4304
4364
|
* cy.wrap([1, 2, 3]).should('not.have.length', 2)
|
4305
4365
|
* cy.wrap('foo').should('not.have.length', 2)
|
@@ -4309,7 +4369,7 @@ declare namespace Cypress {
|
|
4309
4369
|
*/
|
4310
4370
|
(chainer: 'not.have.length' | 'not.have.lengthOf', value: number): Chainable<Subject>
|
4311
4371
|
/**
|
4312
|
-
* Asserts that the target
|
4372
|
+
* Asserts that the target's `length` property is not greater than to the given number `n`.
|
4313
4373
|
* @example
|
4314
4374
|
* cy.wrap([1, 2, 3]).should('not.have.length.greaterThan', 4)
|
4315
4375
|
* cy.wrap('foo').should('not.have.length.greaterThan', 4)
|
@@ -4318,7 +4378,7 @@ declare namespace Cypress {
|
|
4318
4378
|
*/
|
4319
4379
|
(chainer: 'not.have.length.greaterThan' | 'not.have.lengthOf.greaterThan', value: number): Chainable<Subject>
|
4320
4380
|
/**
|
4321
|
-
* Asserts that the target
|
4381
|
+
* Asserts that the target's `length` property is not greater than to the given number `n`.
|
4322
4382
|
* @example
|
4323
4383
|
* cy.wrap([1, 2, 3]).should('not.have.length.gt', 4)
|
4324
4384
|
* cy.wrap('foo').should('not.have.length.gt', 4)
|
@@ -4327,7 +4387,7 @@ declare namespace Cypress {
|
|
4327
4387
|
*/
|
4328
4388
|
(chainer: 'not.have.length.gt' | 'not.have.lengthOf.gt' | 'not.have.length.above' | 'not.have.lengthOf.above', value: number): Chainable<Subject>
|
4329
4389
|
/**
|
4330
|
-
* Asserts that the target
|
4390
|
+
* Asserts that the target's `length` property is not greater than or equal to the given number `n`.
|
4331
4391
|
* @example
|
4332
4392
|
* cy.wrap([1, 2, 3]).should('not.have.length.gte', 4)
|
4333
4393
|
* cy.wrap('foo').should('not.have.length.gte', 4)
|
@@ -4336,7 +4396,7 @@ declare namespace Cypress {
|
|
4336
4396
|
*/
|
4337
4397
|
(chainer: 'not.have.length.gte' | 'not.have.lengthOf.gte' | 'not.have.length.at.least' | 'not.have.lengthOf.at.least', value: number): Chainable<Subject>
|
4338
4398
|
/**
|
4339
|
-
* Asserts that the target
|
4399
|
+
* Asserts that the target's `length` property is less than to the given number `n`.
|
4340
4400
|
* @example
|
4341
4401
|
* cy.wrap([1, 2, 3]).should('have.length.lessThan', 2)
|
4342
4402
|
* cy.wrap('foo').should('have.length.lessThan', 2)
|
@@ -4345,7 +4405,7 @@ declare namespace Cypress {
|
|
4345
4405
|
*/
|
4346
4406
|
(chainer: 'not.have.length.lessThan' | 'not.have.lengthOf.lessThan', value: number): Chainable<Subject>
|
4347
4407
|
/**
|
4348
|
-
* Asserts that the target
|
4408
|
+
* Asserts that the target's `length` property is not less than to the given number `n`.
|
4349
4409
|
* @example
|
4350
4410
|
* cy.wrap([1, 2, 3]).should('not.have.length.lt', 2)
|
4351
4411
|
* cy.wrap('foo').should('not.have.length.lt', 2)
|
@@ -4354,7 +4414,7 @@ declare namespace Cypress {
|
|
4354
4414
|
*/
|
4355
4415
|
(chainer: 'not.have.length.lt' | 'not.have.lengthOf.lt' | 'not.have.length.below' | 'not.have.lengthOf.below', value: number): Chainable<Subject>
|
4356
4416
|
/**
|
4357
|
-
* Asserts that the target
|
4417
|
+
* Asserts that the target's `length` property is not less than or equal to the given number `n`.
|
4358
4418
|
* @example
|
4359
4419
|
* cy.wrap([1, 2, 3]).should('not.have.length.lte', 2)
|
4360
4420
|
* cy.wrap('foo').should('not.have.length.lte', 2)
|
@@ -4363,7 +4423,7 @@ declare namespace Cypress {
|
|
4363
4423
|
*/
|
4364
4424
|
(chainer: 'not.have.length.lte' | 'not.have.lengthOf.lte' | 'not.have.length.at.most' | 'not.have.lengthOf.at.most', value: number): Chainable<Subject>
|
4365
4425
|
/**
|
4366
|
-
* Asserts that the target
|
4426
|
+
* Asserts that the target's `length` property is within `start` and `finish`.
|
4367
4427
|
* @example
|
4368
4428
|
* cy.wrap([1, 2, 3]).should('not.have.length.within', 6, 12)
|
4369
4429
|
* @see http://chaijs.com/api/bdd/#method_lengthof
|
@@ -4440,9 +4500,9 @@ declare namespace Cypress {
|
|
4440
4500
|
* When one argument is provided, `.increase` asserts that the given function `subject` returns a greater number when it's
|
4441
4501
|
* invoked after invoking the target function compared to when it's invoked beforehand.
|
4442
4502
|
* `.increase` also causes all `.by` assertions that follow in the chain to assert how much greater of a number is returned.
|
4443
|
-
*
|
4503
|
+
* It's often best to assert that the return value increased by the expected amount, rather than asserting it increased by any amount.
|
4444
4504
|
*
|
4445
|
-
* When two arguments are provided, `.increase` asserts that the value of the given object `subject
|
4505
|
+
* When two arguments are provided, `.increase` asserts that the value of the given object `subject`'s `prop` property is greater after
|
4446
4506
|
* invoking the target function compared to beforehand.
|
4447
4507
|
*
|
4448
4508
|
* @example
|
@@ -4528,7 +4588,7 @@ declare namespace Cypress {
|
|
4528
4588
|
*/
|
4529
4589
|
(chainer: 'not.be.extensible'): Chainable<Subject>
|
4530
4590
|
/**
|
4531
|
-
* Asserts that the target is sealed, which means that new properties can
|
4591
|
+
* Asserts that the target is sealed, which means that new properties can't be added to it, and its existing properties can't be reconfigured or deleted.
|
4532
4592
|
* @example
|
4533
4593
|
* cy.wrap({a: 1}).should('be.sealed')
|
4534
4594
|
* cy.wrap({a: 1}).should('be.sealed')
|
@@ -4537,7 +4597,7 @@ declare namespace Cypress {
|
|
4537
4597
|
*/
|
4538
4598
|
(chainer: 'not.be.sealed'): Chainable<Subject>
|
4539
4599
|
/**
|
4540
|
-
* Asserts that the target is frozen, which means that new properties can
|
4600
|
+
* Asserts that the target is frozen, which means that new properties can't be added to it, and its existing properties can't be reassigned to different values, reconfigured, or deleted.
|
4541
4601
|
* @example
|
4542
4602
|
* cy.wrap({a: 1}).should('not.be.frozen')
|
4543
4603
|
* @see http://chaijs.com/api/bdd/#method_frozen
|
@@ -4545,7 +4605,7 @@ declare namespace Cypress {
|
|
4545
4605
|
*/
|
4546
4606
|
(chainer: 'not.be.frozen'): Chainable<Subject>
|
4547
4607
|
/**
|
4548
|
-
* Asserts that the target is a number, and isn
|
4608
|
+
* Asserts that the target is a number, and isn't `NaN` or positive/negative `Infinity`.
|
4549
4609
|
* @example
|
4550
4610
|
* cy.wrap(NaN).should('not.be.finite')
|
4551
4611
|
* cy.wrap(Infinity).should('not.be.finite')
|
@@ -4557,7 +4617,7 @@ declare namespace Cypress {
|
|
4557
4617
|
// sinon-chai
|
4558
4618
|
/**
|
4559
4619
|
* Assert spy/stub was called the `new` operator.
|
4560
|
-
* Beware that this is inferred based on the value of the this object and the spy function
|
4620
|
+
* Beware that this is inferred based on the value of the this object and the spy function's prototype, so it may give false positives if you actively return the right kind of object.
|
4561
4621
|
* @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
4562
4622
|
* @see https://on.cypress.io/assertions
|
4563
4623
|
*/
|
@@ -4630,7 +4690,7 @@ declare namespace Cypress {
|
|
4630
4690
|
(chainer: 'be.calledWithMatch' | 'have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
|
4631
4691
|
/**
|
4632
4692
|
* Assert spy/stub was called the `new` operator.
|
4633
|
-
* Beware that this is inferred based on the value of the this object and the spy function
|
4693
|
+
* Beware that this is inferred based on the value of the this object and the spy function's prototype, so it may give false positives if you actively return the right kind of object.
|
4634
4694
|
* @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
4635
4695
|
* @see https://on.cypress.io/assertions
|
4636
4696
|
*/
|
@@ -4717,7 +4777,7 @@ declare namespace Cypress {
|
|
4717
4777
|
// sinon-chai.not
|
4718
4778
|
/**
|
4719
4779
|
* Assert spy/stub was not called the `new` operator.
|
4720
|
-
* Beware that this is inferred based on the value of the this object and the spy function
|
4780
|
+
* Beware that this is inferred based on the value of the this object and the spy function's prototype, so it may give false positives if you actively return the right kind of object.
|
4721
4781
|
* @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
4722
4782
|
* @see https://on.cypress.io/assertions
|
4723
4783
|
*/
|
@@ -4790,7 +4850,7 @@ declare namespace Cypress {
|
|
4790
4850
|
(chainer: 'not.be.calledWithMatch' | 'not.have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
|
4791
4851
|
/**
|
4792
4852
|
* Assert spy/stub was not called the `new` operator.
|
4793
|
-
* Beware that this is inferred based on the value of the this object and the spy function
|
4853
|
+
* Beware that this is inferred based on the value of the this object and the spy function's prototype, so it may give false positives if you actively return the right kind of object.
|
4794
4854
|
* @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
4795
4855
|
* @see https://on.cypress.io/assertions
|
4796
4856
|
*/
|
@@ -5341,7 +5401,7 @@ declare namespace Cypress {
|
|
5341
5401
|
|
5342
5402
|
/**
|
5343
5403
|
* Create an assertion. Assertions are automatically retried until they pass or time out.
|
5344
|
-
* Passing a function to `.should()` enables you to make multiple assertions on the yielded subject. This also gives you the opportunity to massage what you
|
5404
|
+
* Passing a function to `.should()` enables you to make multiple assertions on the yielded subject. This also gives you the opportunity to massage what you'd like to assert on.
|
5345
5405
|
* Just be sure _not_ to include any code that has side effects in your callback function. The callback function will be retried over and over again until no assertions within it throw.
|
5346
5406
|
* @example
|
5347
5407
|
* cy
|
@@ -5446,7 +5506,7 @@ declare namespace Cypress {
|
|
5446
5506
|
|
5447
5507
|
interface ResolvedDevServerConfig {
|
5448
5508
|
port: number
|
5449
|
-
close: (done?: () => any) => void
|
5509
|
+
close: (done?: (err?: Error) => any) => void
|
5450
5510
|
}
|
5451
5511
|
|
5452
5512
|
interface PluginEvents {
|
@@ -5494,7 +5554,7 @@ declare namespace Cypress {
|
|
5494
5554
|
```
|
5495
5555
|
// likely want to do this in a support file
|
5496
5556
|
// so it's applied to all spec files
|
5497
|
-
// cypress/support/
|
5557
|
+
// cypress/support/{e2e|component}.js
|
5498
5558
|
|
5499
5559
|
Cypress.on('uncaught:exception', (err, runnable) => {
|
5500
5560
|
// returning false here prevents Cypress from
|