cypress 8.1.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/types/cypress.d.ts +106 -12
- package/types/net-stubbing.ts +3 -1
package/package.json
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "cypress",
|
3
|
-
"version": "8.
|
3
|
+
"version": "8.4.0",
|
4
4
|
"main": "index.js",
|
5
5
|
"scripts": {
|
6
6
|
"postinstall": "node index.js --exec install",
|
7
7
|
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
|
-
"@cypress/request": "^2.88.
|
10
|
+
"@cypress/request": "^2.88.6",
|
11
11
|
"@cypress/xvfb": "^1.2.4",
|
12
12
|
"@types/node": "^14.14.31",
|
13
13
|
"@types/sinonjs__fake-timers": "^6.0.2",
|
package/types/cypress.d.ts
CHANGED
@@ -22,6 +22,19 @@ declare namespace Cypress {
|
|
22
22
|
password: string
|
23
23
|
}
|
24
24
|
|
25
|
+
interface RemoteState {
|
26
|
+
auth?: {
|
27
|
+
username: string
|
28
|
+
password: string
|
29
|
+
}
|
30
|
+
domainName: string
|
31
|
+
strategy: 'file' | 'http'
|
32
|
+
origin: string
|
33
|
+
fileServer: string
|
34
|
+
props: Record<string, any>
|
35
|
+
visiting: string
|
36
|
+
}
|
37
|
+
|
25
38
|
interface Backend {
|
26
39
|
/**
|
27
40
|
* Firefox only: Force Cypress to run garbage collection routines.
|
@@ -258,6 +271,14 @@ declare namespace Cypress {
|
|
258
271
|
*/
|
259
272
|
spec: Spec
|
260
273
|
|
274
|
+
/**
|
275
|
+
* Currently executing test runnable instance.
|
276
|
+
*/
|
277
|
+
currentTest: {
|
278
|
+
title: string,
|
279
|
+
titlePath: string[]
|
280
|
+
}
|
281
|
+
|
261
282
|
/**
|
262
283
|
* Information about the browser currently running the tests
|
263
284
|
*/
|
@@ -557,6 +578,10 @@ declare namespace Cypress {
|
|
557
578
|
onSpecWindow: (window: Window, specList: string[] | Array<() => Promise<void>>) => void
|
558
579
|
}
|
559
580
|
|
581
|
+
interface SessionOptions {
|
582
|
+
validate?: () => false|void
|
583
|
+
}
|
584
|
+
|
560
585
|
type CanReturnChainable = void | Chainable | Promise<unknown>
|
561
586
|
type ThenReturn<S, R> =
|
562
587
|
R extends void ? Chainable<S> :
|
@@ -952,6 +977,15 @@ declare namespace Cypress {
|
|
952
977
|
*/
|
953
978
|
debug(options?: Partial<Loggable>): Chainable<Subject>
|
954
979
|
|
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>
|
988
|
+
|
955
989
|
/**
|
956
990
|
* Get the window.document of the page that is currently active.
|
957
991
|
*
|
@@ -961,7 +995,7 @@ declare namespace Cypress {
|
|
961
995
|
* .its('contentType')
|
962
996
|
* .should('eq', 'text/html')
|
963
997
|
*/
|
964
|
-
document(options?: Partial<Loggable>): Chainable<Document>
|
998
|
+
document(options?: Partial<Loggable & Timeoutable>): Chainable<Document>
|
965
999
|
|
966
1000
|
/**
|
967
1001
|
* Iterate through an array like structure (arrays or objects with a length property).
|
@@ -1937,7 +1971,7 @@ declare namespace Cypress {
|
|
1937
1971
|
*
|
1938
1972
|
* @see https://on.cypress.io/title
|
1939
1973
|
*/
|
1940
|
-
title(options?: Partial<Loggable>): Chainable<string>
|
1974
|
+
title(options?: Partial<Loggable & Timeoutable>): Chainable<string>
|
1941
1975
|
|
1942
1976
|
/**
|
1943
1977
|
* Trigger an event on a DOM element.
|
@@ -2039,7 +2073,7 @@ declare namespace Cypress {
|
|
2039
2073
|
* @alias cy.location('href')
|
2040
2074
|
* @see https://on.cypress.io/url
|
2041
2075
|
*/
|
2042
|
-
url(options?: Partial<
|
2076
|
+
url(options?: Partial<UrlOptions>): Chainable<string>
|
2043
2077
|
|
2044
2078
|
/**
|
2045
2079
|
* Control the size and orientation of the screen for your application.
|
@@ -2467,6 +2501,47 @@ declare namespace Cypress {
|
|
2467
2501
|
cmdKey: boolean
|
2468
2502
|
}
|
2469
2503
|
|
2504
|
+
interface PEMCert {
|
2505
|
+
/**
|
2506
|
+
* Path to the certificate file, relative to project root.
|
2507
|
+
*/
|
2508
|
+
cert: string
|
2509
|
+
/**
|
2510
|
+
* Path to the private key file, relative to project root.
|
2511
|
+
*/
|
2512
|
+
key: string
|
2513
|
+
/**
|
2514
|
+
* Path to a text file containing the passphrase, relative to project root.
|
2515
|
+
*/
|
2516
|
+
passphrase?: string
|
2517
|
+
}
|
2518
|
+
|
2519
|
+
interface PFXCert {
|
2520
|
+
/**
|
2521
|
+
* Path to the certificate container, relative to project root.
|
2522
|
+
*/
|
2523
|
+
pfx: string
|
2524
|
+
/**
|
2525
|
+
* Path to a text file containing the passphrase, relative to project root.
|
2526
|
+
*/
|
2527
|
+
passphrase?: string
|
2528
|
+
}
|
2529
|
+
|
2530
|
+
interface ClientCertificate {
|
2531
|
+
/**
|
2532
|
+
* URL to match requests against. Wildcards following [minimatch](https://github.com/isaacs/minimatch) rules are supported.
|
2533
|
+
*/
|
2534
|
+
url: string
|
2535
|
+
/**
|
2536
|
+
* Paths to one or more CA files to validate certs against, relative to project root.
|
2537
|
+
*/
|
2538
|
+
ca?: string[]
|
2539
|
+
/**
|
2540
|
+
* A PEM format certificate/private key pair or PFX certificate container
|
2541
|
+
*/
|
2542
|
+
certs: PEMCert[] | PFXCert[]
|
2543
|
+
}
|
2544
|
+
|
2470
2545
|
interface ResolvedConfigOptions {
|
2471
2546
|
/**
|
2472
2547
|
* Url used as prefix for [cy.visit()](https://on.cypress.io/visit) or [cy.request()](https://on.cypress.io/request) command’s url
|
@@ -2653,6 +2728,11 @@ declare namespace Cypress {
|
|
2653
2728
|
* @default 'top'
|
2654
2729
|
*/
|
2655
2730
|
scrollBehavior: scrollBehaviorOptions
|
2731
|
+
/**
|
2732
|
+
* Enable experimental session support. See https://on.cypress.io/session
|
2733
|
+
* @default false
|
2734
|
+
*/
|
2735
|
+
experimentalSessionSupport: boolean
|
2656
2736
|
/**
|
2657
2737
|
* Allows listening to the `before:run`, `after:run`, `before:spec`, and `after:spec` events in the plugins file during interactive mode.
|
2658
2738
|
* @default false
|
@@ -2724,6 +2804,11 @@ declare namespace Cypress {
|
|
2724
2804
|
* @default {}
|
2725
2805
|
*/
|
2726
2806
|
e2e: Omit<ResolvedConfigOptions, TestingType>
|
2807
|
+
|
2808
|
+
/**
|
2809
|
+
* An array of objects defining the certificates
|
2810
|
+
*/
|
2811
|
+
clientCertificates: ClientCertificate[]
|
2727
2812
|
}
|
2728
2813
|
|
2729
2814
|
/**
|
@@ -2784,19 +2869,15 @@ declare namespace Cypress {
|
|
2784
2869
|
projectName: string
|
2785
2870
|
projectRoot: string
|
2786
2871
|
proxyUrl: string
|
2872
|
+
remote: RemoteState
|
2787
2873
|
report: boolean
|
2788
2874
|
reporterRoute: string
|
2789
2875
|
reporterUrl: string
|
2790
2876
|
socketId: null | string
|
2791
2877
|
socketIoCookie: string
|
2792
2878
|
socketIoRoute: string
|
2793
|
-
spec:
|
2794
|
-
|
2795
|
-
name: string
|
2796
|
-
relative: string
|
2797
|
-
specFilter: null | string
|
2798
|
-
specType: 'integration' | 'component'
|
2799
|
-
}
|
2879
|
+
spec: Cypress['spec']
|
2880
|
+
specs: Array<Cypress['spec']>
|
2800
2881
|
xhrRoute: string
|
2801
2882
|
xhrUrl: string
|
2802
2883
|
}
|
@@ -3147,6 +3228,18 @@ declare namespace Cypress {
|
|
3147
3228
|
eventConstructor: string
|
3148
3229
|
}
|
3149
3230
|
|
3231
|
+
/**
|
3232
|
+
* Options to change the default behavior of .url()
|
3233
|
+
*/
|
3234
|
+
interface UrlOptions extends Loggable, Timeoutable {
|
3235
|
+
/**
|
3236
|
+
* Whether the url is decoded
|
3237
|
+
*
|
3238
|
+
* @default false
|
3239
|
+
*/
|
3240
|
+
decode: boolean
|
3241
|
+
}
|
3242
|
+
|
3150
3243
|
/** Options to change the default behavior of .writeFile */
|
3151
3244
|
interface WriteFileOptions extends Loggable {
|
3152
3245
|
flag: string
|
@@ -5237,7 +5330,7 @@ declare namespace Cypress {
|
|
5237
5330
|
tag?: string
|
5238
5331
|
}
|
5239
5332
|
|
5240
|
-
interface
|
5333
|
+
interface DevServerConfig {
|
5241
5334
|
specs: Spec[]
|
5242
5335
|
config: ResolvedConfigOptions & RuntimeConfigOptions
|
5243
5336
|
devServerEvents: NodeJS.EventEmitter
|
@@ -5256,7 +5349,7 @@ declare namespace Cypress {
|
|
5256
5349
|
(action: 'before:spec', fn: (spec: Spec) => void | Promise<void>): void
|
5257
5350
|
(action: 'before:browser:launch', fn: (browser: Browser, browserLaunchOptions: BrowserLaunchOptions) => void | BrowserLaunchOptions | Promise<BrowserLaunchOptions>): void
|
5258
5351
|
(action: 'file:preprocessor', fn: (file: FileObject) => string | Promise<string>): void
|
5259
|
-
(action: 'dev-server:start', fn: (file:
|
5352
|
+
(action: 'dev-server:start', fn: (file: DevServerConfig) => Promise<ResolvedDevServerConfig>): void
|
5260
5353
|
(action: 'task', tasks: Tasks): void
|
5261
5354
|
}
|
5262
5355
|
|
@@ -5509,6 +5602,7 @@ declare namespace Cypress {
|
|
5509
5602
|
|
5510
5603
|
interface Log {
|
5511
5604
|
end(): Log
|
5605
|
+
error(error: Error): Log
|
5512
5606
|
finish(): void
|
5513
5607
|
get<K extends keyof LogConfig>(attr: K): LogConfig[K]
|
5514
5608
|
get(): LogConfig
|
package/types/net-stubbing.ts
CHANGED
@@ -267,9 +267,11 @@ interface RequestEvents {
|
|
267
267
|
*/
|
268
268
|
export interface Interception {
|
269
269
|
id: string
|
270
|
+
/* @internal */
|
271
|
+
browserRequestId?: string
|
270
272
|
routeId: string
|
271
273
|
/* @internal */
|
272
|
-
|
274
|
+
setLogFlag: (flag: 'spied' | 'stubbed' | 'reqModified' | 'resModified') => void
|
273
275
|
request: CyHttpMessages.IncomingRequest
|
274
276
|
/**
|
275
277
|
* Was `cy.wait()` used to wait on this request?
|