UNPKG

261 kBTypeScriptView Raw
1/* eslint-disable @typescript-eslint/no-unused-vars */
2/// <reference path="./cypress-npm-api.d.ts" />
3/// <reference path="./cypress-eventemitter.d.ts" />
4/// <reference path="./cypress-type-helpers.d.ts" />
5
6declare namespace Cypress {
7 type FileContents = string | any[] | object
8 type HistoryDirection = 'back' | 'forward'
9 type HttpMethod = string
10 type RequestBody = string | object | boolean | null
11 type ViewportOrientation = 'portrait' | 'landscape'
12 type PrevSubject = keyof PrevSubjectMap
13 type TestingType = 'e2e' | 'component'
14 type PluginConfig = (on: PluginEvents, config: PluginConfigOptions) => void | ConfigOptions | Promise<ConfigOptions>
15 interface JQueryWithSelector<TElement = HTMLElement> extends JQuery<TElement> {
16 selector?: string | null
17 }
18
19 interface PrevSubjectMap<O = unknown> {
20 optional: O
21 element: JQueryWithSelector
22 document: Document
23 window: Window
24 }
25
26 interface CommandOptions {
27 prevSubject: boolean | PrevSubject | PrevSubject[]
28 }
29 interface CommandFn<T extends keyof ChainableMethods> {
30 (this: Mocha.Context, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]> | void
31 }
32 interface CommandFns {
33 [name: string]: (this: Mocha.Context, ...args: any) => any
34 }
35 interface CommandFnWithSubject<T extends keyof ChainableMethods, S> {
36 (this: Mocha.Context, prevSubject: S, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]> | void
37 }
38 interface CommandFnsWithSubject<S> {
39 [name: string]: (this: Mocha.Context, prevSubject: S, ...args: any) => any
40 }
41 interface CommandOriginalFn<T extends keyof ChainableMethods> extends CallableFunction {
42 (...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]>
43 }
44 interface CommandOriginalFnWithSubject<T extends keyof ChainableMethods, S> extends CallableFunction {
45 (prevSubject: S, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]>
46 }
47 interface CommandFnWithOriginalFn<T extends keyof Chainable> {
48 (this: Mocha.Context, originalFn: CommandOriginalFn<T>, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]> | void
49 }
50 interface CommandFnWithOriginalFnAndSubject<T extends keyof Chainable, S> {
51 (this: Mocha.Context, originalFn: CommandOriginalFnWithSubject<T, S>, prevSubject: S, ...args: Parameters<ChainableMethods[T]>): ReturnType<ChainableMethods[T]> | void
52 }
53 interface QueryFn<T extends keyof ChainableMethods> {
54 (this: Command, ...args: Parameters<ChainableMethods[T]>): (subject: any) => any
55 }
56 interface QueryFnWithOriginalFn<T extends keyof Chainable> {
57 (this: Command, originalFn: QueryFn<T>, ...args: Parameters<ChainableMethods[T]>): (subject: any) => any
58 }
59 interface ObjectLike {
60 [key: string]: any
61 }
62 interface Auth {
63 username: string
64 password: string
65 }
66
67 interface RemoteState {
68 auth?: Auth
69 domainName: string
70 strategy: 'file' | 'http'
71 origin: string
72 fileServer: string | null
73 props: Record<string, any>
74 visiting: string
75 }
76
77 interface Backend {
78 /**
79 * Firefox only: Force Cypress to run garbage collection routines.
80 * No-op if not running in Firefox.
81 *
82 * @see https://on.cypress.io/firefox-gc-issue
83 */
84 (task: 'firefox:force:gc'): Promise<void>
85 (task: 'net', eventName: string, frame: any): Promise<void>
86 }
87
88 type BrowserName = 'electron' | 'chrome' | 'chromium' | 'firefox' | 'edge' | string
89
90 type BrowserChannel = 'stable' | 'canary' | 'beta' | 'dev' | 'nightly' | string
91
92 type BrowserFamily = 'chromium' | 'firefox' | 'webkit'
93
94 /**
95 * Describes a browser Cypress can control
96 */
97 interface Browser {
98 /**
99 * Short browser name.
100 */
101 name: BrowserName
102 /**
103 * The underlying engine for this browser.
104 */
105 family: BrowserFamily
106 /**
107 * The release channel of the browser.
108 */
109 channel: BrowserChannel
110 /**
111 * Human-readable browser name.
112 */
113 displayName: string
114 version: string
115 majorVersion: number | string
116 path: string
117 isHeaded: boolean
118 isHeadless: boolean
119 /**
120 * Informational text to accompany this browser. Shown in desktop-gui.
121 */
122 info?: string
123 /**
124 * Warning text to accompany this browser. Shown in desktop-gui.
125 */
126 warning?: string
127 /**
128 * The minimum majorVersion of this browser supported by Cypress.
129 */
130 minSupportedVersion?: number
131 /**
132 * If `true`, this browser is too old to be supported by Cypress.
133 */
134 unsupportedVersion?: boolean
135 }
136
137 /**
138 * Browser that's exposed in public APIs
139 */
140 interface PublicBrowser {
141 channel: BrowserChannel
142 displayName: string
143 family: string
144 majorVersion?: string | number | null
145 name: BrowserName
146 path: string
147 version: string
148 }
149
150 interface Ensure {
151 /**
152 * Throws an error if `subject` is not one of the passed in `type`s.
153 */
154 isType(subject: any, type: PrevSubject[], commandName: string, cy: Chainable): void
155
156 /**
157 * Throws an error if `subject` is not a DOM element.
158 */
159 isElement(subject: any, commandName: string, cy: Chainable): void
160
161 /**
162 * Throws an error if `subject` is not a `document`.
163 */
164 isDocument(subject: any, commandName: string, cy: Chainable): void
165
166 /**
167 * Throws an error if `subject` is not a `window`.
168 */
169 isWindow(subject: any, commandName: string, cy: Chainable): void
170
171 /**
172 * Throws an error if `subject` is not a DOM element attached to the application under test.
173 */
174 isAttached(subject: any, commandName: string, cy: Chainable, onFail?: Log): void
175
176 /**
177 * Throws an error if `subject` is a disabled DOM element.
178 */
179 isNotDisabled(subject: any, commandName: string, onFail?: Log): void
180
181 /**
182 * Throws an error if `subject` is a DOM element hidden by any of its parent elements.
183 */
184 isNotHiddenByAncestors(subject: any, commandName: string, onFail?: Log): void
185
186 /**
187 * Throws an error if `subject` is a read-only form element.
188 */
189 isNotReadonly(subject: any, commandName: string, onFail?: Log): void
190
191 /**
192 * Throws an error if `subject` is a read-only form element.
193 */
194 isScrollable(subject: any, commandName: string, onFail?: Log): void
195
196 /**
197 * Throws an error if `subject` is not a DOM element visible in the AUT.
198 */
199 isVisible(subject: any, commandName: string, onFail?: Log): void
200 }
201
202 interface LocalStorage {
203 /**
204 * Called internally to clear `localStorage` in two situations.
205 *
206 * 1. Before every test, this is called with no argument to clear all keys.
207 * 2. On `cy.clearLocalStorage(keys)` this is called with `keys` as an argument.
208 *
209 * You should not call this method directly to clear `localStorage`; instead, use `cy.clearLocalStorage(key)`.
210 *
211 * @see https://on.cypress.io/clearlocalstorage
212 */
213 clear: (keys?: string[]) => void
214 }
215
216 // TODO: raise minimum required TypeScript version to 3.7
217 // and make this recursive
218 // https://github.com/cypress-io/cypress/issues/24875
219 type Storable =
220 | string
221 | number
222 | boolean
223 | null
224 | StorableObject
225 | StorableArray
226
227 interface StorableObject {
228 [key: string]: Storable
229 }
230
231 interface StorableArray extends Array<Storable> { }
232
233 type StorableRecord = Record<string, Storable>
234
235 interface OriginStorage {
236 origin: string
237 value: StorableRecord
238 }
239
240 interface Storages {
241 localStorage: OriginStorage[]
242 sessionStorage: OriginStorage[]
243 }
244
245 interface StorageByOrigin {
246 [key: string]: StorableRecord
247 }
248
249 type IsBrowserMatcher = BrowserName | Partial<Browser> | Array<BrowserName | Partial<Browser>>
250
251 interface ViewportPosition extends WindowPosition {
252 right: number
253 bottom: number
254 }
255
256 interface WindowPosition {
257 top: number
258 left: number
259 topCenter: number
260 leftCenter: number
261 }
262
263 interface ElementPositioning {
264 scrollTop: number
265 scrollLeft: number
266 width: number
267 height: number
268 fromElViewport: ViewportPosition
269 fromElWindow: WindowPosition
270 fromAutWindow: WindowPosition
271 }
272
273 interface ElementCoordinates {
274 width: number
275 height: number
276 fromElViewport: ViewportPosition & { x: number, y: number }
277 fromElWindow: WindowPosition & { x: number, y: number }
278 fromAutWindow: WindowPosition & { x: number, y: number }
279 }
280
281 /**
282 * Spec type for the given test. "integration" is the default, but
283 * tests run using `open --component` will be "component"
284 *
285 * @see https://on.cypress.io/experiments
286 */
287 type CypressSpecType = 'integration' | 'component'
288
289 /**
290 * A Cypress spec.
291 */
292 interface Spec {
293 name: string // "config_passing_spec.js"
294 relative: string // "cypress/e2e/config_passing_spec.cy.js" or "__all" if clicked all specs button
295 absolute: string // "/Users/janelane/app/cypress/e2e/config_passing_spec.cy.js"
296 specFilter?: string // optional spec filter used by the user
297 specType?: CypressSpecType
298 baseName?: string // "config_passing_spec.cy.js"
299 fileExtension?: string // ".js"
300 fileName?: string // "config_passing_spec.cy"
301 id?: string // "U3BlYzovVXNlcnMvamFuZWxhbmUvYXBwL2N5cHJlc3MvZTJlL2NvbmZpZ19wYXNzaW5nX3NwZWMuY3kuanM="
302 }
303
304 /**
305 * Window type for Application Under Test(AUT)
306 */
307 type AUTWindow = Window & typeof globalThis & ApplicationWindow
308
309 /**
310 * The interface for user-defined properties in Window object under test.
311 */
312 interface ApplicationWindow { } // tslint:disable-line
313
314 /**
315 * The configuration for Cypress.
316 */
317 type Config = ResolvedConfigOptions & RuntimeConfigOptions & RuntimeServerConfigOptions
318
319 /**
320 * Several libraries are bundled with Cypress by default.
321 *
322 * @see https://on.cypress.io/api
323 */
324 interface Cypress {
325 /**
326 * Lodash library
327 *
328 * @see https://on.cypress.io/_
329 * @example
330 * Cypress._.keys(obj)
331 */
332 _: _.LoDashStatic
333 /**
334 * jQuery library
335 *
336 * @see https://on.cypress.io/$
337 * @example
338 * Cypress.$('p')
339 */
340 $: JQueryStatic
341 /**
342 * Cypress automatically includes a Blob library and exposes it as Cypress.Blob.
343 *
344 * @see https://on.cypress.io/blob
345 * @see https://github.com/nolanlawson/blob-util
346 * @example
347 * Cypress.Blob.method()
348 */
349 Blob: BlobUtil.BlobUtilStatic
350 /**
351 * Cypress automatically includes a Buffer library and exposes it as Cypress.Buffer.
352 *
353 * @see https://on.cypress.io/buffer
354 * @see https://github.com/feross/buffer
355 * @example
356 * Cypress.Buffer.method()
357 */
358 Buffer: BufferType
359 /**
360 * Cypress automatically includes minimatch and exposes it as Cypress.minimatch.
361 *
362 * @see https://on.cypress.io/minimatch
363 */
364 minimatch: typeof Minimatch.minimatch
365 /**
366 * Cypress automatically includes Bluebird and exposes it as Cypress.Promise.
367 *
368 * @see https://on.cypress.io/promise
369 * @see https://github.com/petkaantonov/bluebird
370 * @example
371 * new Cypress.Promise((resolve, reject) => { ... })
372 */
373 Promise: Bluebird.BluebirdStatic
374 /**
375 * Cypress includes Sinon.js library used in `cy.spy` and `cy.stub`.
376 *
377 * @see https://sinonjs.org/
378 * @see https://on.cypress.io/stubs-spies-and-clocks
379 * @see https://example.cypress.io/commands/spies-stubs-clocks
380 */
381 sinon: sinon.SinonStatic
382
383 /**
384 * Utility functions for ensuring various properties about a subject.
385 * @see https://on.cypress.io/api/custom-queries
386 */
387 ensure: Ensure
388
389 /**
390 * Cypress version string. i.e. "1.1.2"
391 * @see https://on.cypress.io/version
392 * @example
393 ```
394 expect(Cypress.version).to.be.a('string')
395 if (Cypress.version === '1.2.0') {
396 // test something specific
397 }
398 ```
399 */
400 version: string
401
402 /**
403 * OS platform name, from Node `os.platform()`
404 *
405 * @see https://nodejs.org/api/os.html#os_os_platform
406 * @example
407 * Cypress.platform // "darwin"
408 */
409 platform: string
410
411 /**
412 * CPU architecture, from Node `os.arch()`
413 *
414 * @see https://nodejs.org/api/os.html#os_os_arch
415 * @example
416 * Cypress.arch // "x64"
417 */
418 arch: string
419
420 /**
421 * Currently executing spec file.
422 * @example
423 * ```
424 * Cypress.spec
425 * // {
426 * // name: "config_passing_spec.coffee",
427 * // relative: "cypress/integration/config_passing_spec.coffee",
428 * // absolute: "/users/smith/projects/web/cypress/integration/config_passing_spec.coffee"
429 * // specType: "integration"
430 * // }
431 * ```
432 */
433 spec: Spec
434
435 /**
436 * Currently executing test runnable instance.
437 */
438 currentTest: {
439 title: string
440 titlePath: string[]
441 }
442
443 /**
444 * Information about current test retry
445 */
446 currentRetry: number
447
448 /**
449 * Information about the browser currently running the tests
450 */
451 browser: Browser
452
453 /**
454 * Internal class for LocalStorage management.
455 */
456 LocalStorage: LocalStorage
457
458 /**
459 * Internal class for session management.
460 */
461 session: Session
462
463 /**
464 * Current testing type, determined by the Test Runner chosen to run.
465 */
466 testingType: TestingType
467
468 /**
469 * Fire automation:request event for internal use.
470 */
471 automation(eventName: string, ...args: any[]): Bluebird.Promise<any>
472
473 /**
474 * Promise wrapper for certain internal tasks.
475 */
476 backend: Backend
477
478 /**
479 * Returns all configuration objects.
480 * @see https://on.cypress.io/config
481 * @example
482 ```
483 Cypress.config()
484 // {defaultCommandTimeout: 10000, pageLoadTimeout: 30000, ...}
485 ```
486 */
487 config(): Config
488 /**
489 * Returns one configuration value.
490 * @see https://on.cypress.io/config
491 * @example
492 ```
493 Cypress.config('pageLoadTimeout')
494 // 60000
495 ```
496 */
497 config<K extends keyof Config>(key: K): Config[K]
498 /**
499 * Sets one configuration value.
500 * @see https://on.cypress.io/config
501 * @example
502 ```
503 Cypress.config('viewportWidth', 800)
504 ```
505 */
506 config<K extends keyof TestConfigOverrides>(key: K, value: TestConfigOverrides[K]): void
507 /**
508 * Sets multiple configuration values at once.
509 * @see https://on.cypress.io/config
510 * @example
511 ```
512 Cypress.config({
513 defaultCommandTimeout: 10000,
514 viewportHeight: 900
515 })
516 ```
517 */
518 config(Object: TestConfigOverrides): void
519
520 // no real way to type without generics
521 /**
522 * Returns all environment variables set with CYPRESS_ prefix or in "env" object in "cypress.config.{js,ts,mjs,cjs}"
523 *
524 * @see https://on.cypress.io/env
525 */
526 env(): ObjectLike
527 /**
528 * Returns specific environment variable or undefined
529 * @see https://on.cypress.io/env
530 * @example
531 * // cypress.config.js
532 * { "env": { "foo": "bar" } }
533 * Cypress.env("foo") // => bar
534 */
535 env(key: string): any
536 /**
537 * Set value for a variable.
538 * Any value you change will be permanently changed for the remainder of your tests.
539 * @see https://on.cypress.io/env
540 * @example
541 * Cypress.env("host", "http://server.dev.local")
542 */
543 env(key: string, value: any): void
544 /**
545 * Set values for multiple variables at once. Values are merged with existing values.
546 * @see https://on.cypress.io/env
547 * @example
548 * Cypress.env({ host: "http://server.dev.local", foo: "foo" })
549 */
550 env(object: ObjectLike): void
551
552 /**
553 * @returns the number of test retries currently enabled for the run
554 */
555 getTestRetries(): number | null
556
557 /**
558 * Checks if a variable is a valid instance of `cy` or a `cy` chainable.
559 *
560 * @see https://on.cypress.io/iscy
561 * @example
562 * Cypress.isCy(cy) // => true
563 */
564 isCy<TSubject = any>(obj: Chainable<TSubject>): obj is Chainable<TSubject>
565 isCy(obj: any): obj is Chainable
566
567 /**
568 * Returns true if currently running the supplied browser name or matcher object. Also accepts an array of matchers.
569 * @example isBrowser('chrome') will be true for the browser 'chrome:canary' and 'chrome:stable'
570 * @example isBrowser({ name: 'firefox', channel: 'dev' }) will be true only for the browser 'firefox:dev' (Firefox Developer Edition)
571 * @example isBrowser(['firefox', 'edge']) will be true only for the browsers 'firefox' and 'edge'
572 * @example isBrowser('!firefox') will be true for every browser other than 'firefox'
573 * @example isBrowser({ family: '!chromium'}) will be true for every browser not matching { family: 'chromium' }
574 * @param matcher browser name or matcher object to check.
575 */
576 isBrowser(name: IsBrowserMatcher): boolean
577
578 /**
579 * Internal options for "cy.log" used in custom commands.
580 *
581 * @see https://on.cypress.io/cypress-log
582 */
583 log(options: Partial<LogConfig>): Log
584
585 Commands: {
586 /**
587 * Add a custom command
588 * @see https://on.cypress.io/api/commands
589 */
590 add<T extends keyof Chainable>(name: T, fn: CommandFn<T>): void
591
592 /**
593 * Add a custom parent command
594 * @see https://on.cypress.io/api/commands#Parent-Commands
595 */
596 add<T extends keyof Chainable>(name: T, options: CommandOptions & { prevSubject: false }, fn: CommandFn<T>): void
597
598 /**
599 * Add a custom child command
600 * @see https://on.cypress.io/api/commands#Child-Commands
601 */
602 add<T extends keyof Chainable, S = any>(name: T, options: CommandOptions & { prevSubject: true }, fn: CommandFnWithSubject<T, S>): void
603
604 /**
605 * Add a custom child or dual command
606 * @see https://on.cypress.io/api/commands#Validations
607 */
608 add<T extends keyof Chainable, S extends PrevSubject>(
609 name: T, options: CommandOptions & { prevSubject: S | ['optional'] }, fn: CommandFnWithSubject<T, PrevSubjectMap[S]>,
610 ): void
611
612 /**
613 * Add a custom command that allows multiple types as the prevSubject
614 * @see https://on.cypress.io/api/commands#Validations#Allow-Multiple-Types
615 */
616 add<T extends keyof Chainable, S extends PrevSubject>(
617 name: T, options: CommandOptions & { prevSubject: S[] }, fn: CommandFnWithSubject<T, PrevSubjectMap<void>[S]>,
618 ): void
619
620 /**
621 * Add one or more custom commands
622 * @see https://on.cypress.io/api/commands
623 */
624 addAll<T extends keyof Chainable>(fns: CommandFns): void
625
626 /**
627 * Add one or more custom parent commands
628 * @see https://on.cypress.io/api/commands#Parent-Commands
629 */
630 addAll<T extends keyof Chainable>(options: CommandOptions & { prevSubject: false }, fns: CommandFns): void
631
632 /**
633 * Add one or more custom child commands
634 * @see https://on.cypress.io/api/commands#Child-Commands
635 */
636 addAll<T extends keyof Chainable, S = any>(options: CommandOptions & { prevSubject: true }, fns: CommandFnsWithSubject<S>): void
637
638 /**
639 * Add one or more custom commands that validate their prevSubject
640 * @see https://on.cypress.io/api/commands#Validations
641 */
642 addAll<T extends keyof Chainable, S extends PrevSubject>(
643 options: CommandOptions & { prevSubject: S | ['optional'] }, fns: CommandFnsWithSubject<PrevSubjectMap[S]>,
644 ): void
645
646 /**
647 * Add one or more custom commands that allow multiple types as their prevSubject
648 * @see https://on.cypress.io/api/commands#Allow-Multiple-Types
649 */
650 addAll<T extends keyof Chainable, S extends PrevSubject>(
651 options: CommandOptions & { prevSubject: S[] }, fns: CommandFnsWithSubject<PrevSubjectMap<void>[S]>,
652 ): void
653
654 /**
655 * Overwrite an existing Cypress command with a new implementation
656 * @see https://on.cypress.io/api/commands#Overwrite-Existing-Commands
657 */
658 overwrite<T extends keyof Chainable>(name: T, fn: CommandFnWithOriginalFn<T>): void
659
660 /**
661 * Overwrite an existing Cypress command with a new implementation
662 * @see https://on.cypress.io/api/commands#Overwrite-Existing-Commands
663 */
664 overwrite<T extends keyof Chainable, S extends PrevSubject>(name: T, fn: CommandFnWithOriginalFnAndSubject<T, PrevSubjectMap[S]>): void
665
666 /**
667 * Add a custom query
668 * @see https://on.cypress.io/api/custom-queries
669 */
670 addQuery<T extends keyof Chainable>(name: T, fn: QueryFn<T>): void
671
672 /**
673 * Overwrite an existing Cypress query with a new implementation
674 * @see https://on.cypress.io/api/custom-queries
675 */
676 overwriteQuery<T extends keyof Chainable>(name: T, fn: QueryFnWithOriginalFn<T>): void
677 }
678
679 /**
680 * @see https://on.cypress.io/cookies
681 */
682 Cookies: {
683 debug(enabled: boolean, options?: Partial<DebugOptions>): void
684 }
685
686 /**
687 * @see https://on.cypress.io/dom
688 */
689 dom: {
690 /**
691 * Returns a jQuery object obtained by wrapping an object in jQuery.
692 */
693 wrap(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((index: number) => string | JQuery)): JQuery
694 query(selector: JQuery.Selector, context?: Element | JQuery): JQuery
695 /**
696 * Returns an array of raw elements pulled out from a jQuery object.
697 */
698 unwrap(obj: any): any
699 /**
700 * Returns a boolean indicating whether an object is a DOM object.
701 */
702 isDom(obj: any): boolean
703 isType(element: JQuery | HTMLElement, type: string): boolean
704 /**
705 * Returns a boolean indicating whether an element is visible.
706 */
707 isVisible(element: JQuery | HTMLElement): boolean
708 /**
709 * Returns a boolean indicating whether an element is hidden.
710 */
711 isHidden(element: JQuery | HTMLElement, methodName?: string, options?: object): boolean
712 /**
713 * Returns a boolean indicating whether an element can receive focus.
714 */
715 isFocusable(element: JQuery | HTMLElement): boolean
716 isTextLike(element: JQuery | HTMLElement): boolean
717 /**
718 * Returns a boolean indicating whether an element is scrollable.
719 */
720 isScrollable(element: Window | JQuery | HTMLElement): boolean
721 /**
722 * Returns a boolean indicating whether an element currently has focus.
723 */
724 isFocused(element: JQuery | HTMLElement): boolean
725 /**
726 * Returns a boolean indicating whether an element is detached from the DOM.
727 */
728 isDetached(element: JQuery | HTMLElement): boolean
729 /**
730 * Returns a boolean indicating whether an element is attached to the DOM.
731 */
732 isAttached(element: JQuery | HTMLElement | Window | Document): boolean
733 isSelector(element: JQuery | HTMLElement, selector: JQuery.Selector): boolean
734 /**
735 * Returns a boolean indicating whether an element is a descendent of another element.
736 */
737 isDescendent(element1: JQuery | HTMLElement, element2: JQuery | HTMLElement): boolean
738 /**
739 * Returns a boolean indicating whether object is undefined or html, body, or document.
740 */
741 isUndefinedOrHTMLBodyDoc(obj: any): boolean
742 /**
743 * Returns a boolean indicating whether an object is a DOM element.
744 */
745 isElement(obj: any): boolean
746 /**
747 * Returns a boolean indicating whether a node is of document type.
748 */
749 isDocument(obj: any): boolean
750 /**
751 * Returns a boolean indicating whether an object is a window object.
752 */
753 isWindow(obj: any): obj is Window
754 /**
755 * Returns a boolean indicating whether an object is a jQuery object.
756 */
757 isJquery(obj: any): obj is JQuery
758 isInputType(element: JQuery | HTMLElement, type: string | string[]): boolean
759 stringify(element: JQuery | HTMLElement, form: string): string
760 getElements(element: JQuery): JQuery | HTMLElement[]
761 getContainsSelector(text: string, filter?: string, options?: CaseMatchable): JQuery.Selector
762 getFirstDeepestElement(elements: HTMLElement[], index?: number): HTMLElement
763 getWindowByElement(element: JQuery | HTMLElement): JQuery | HTMLElement
764 getReasonIsHidden(element: JQuery | HTMLElement, options?: object): string
765 getFirstScrollableParent(element: JQuery | HTMLElement): JQuery | HTMLElement
766 getFirstFixedOrStickyPositionParent(element: JQuery | HTMLElement): JQuery | HTMLElement
767 getFirstStickyPositionParent(element: JQuery | HTMLElement): JQuery | HTMLElement
768 getCoordsByPosition(left: number, top: number, xPosition?: string, yPosition?: string): number
769 getElementPositioning(element: JQuery | HTMLElement): ElementPositioning
770 getElementAtPointFromViewport(doc: Document, x: number, y: number): Element | null
771 getElementCoordinatesByPosition(element: JQuery | HTMLElement, position: string): ElementCoordinates
772 getElementCoordinatesByPositionRelativeToXY(element: JQuery | HTMLElement, x: number, y: number): ElementPositioning
773 }
774
775 /**
776 * @see https://on.cypress.io/keyboard-api
777 */
778 Keyboard: {
779 defaults(options: Partial<KeyboardDefaultsOptions>): void
780 }
781
782 /**
783 * @see https://on.cypress.io/screenshot-api
784 */
785 Screenshot: {
786 defaults(options: Partial<ScreenshotDefaultsOptions>): void
787 }
788
789 /**
790 * @see https://on.cypress.io/selector-playground-api
791 */
792 SelectorPlayground: {
793 defaults(options: Partial<SelectorPlaygroundDefaultsOptions>): void
794 getSelector($el: JQuery): JQuery.Selector
795 }
796
797 /**
798 * These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
799 * @see https://on.cypress.io/catalog-of-events#App-Events
800 */
801 on: Actions
802
803 /**
804 * These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
805 * @see https://on.cypress.io/catalog-of-events#App-Events
806 */
807 once: Actions
808
809 /**
810 * These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
811 * @see https://on.cypress.io/catalog-of-events#App-Events
812 */
813 off: Actions
814
815 /**
816 * Used to include dependencies within the cy.origin() callback
817 * @see https://on.cypress.io/origin
818 */
819 require: <T = any>(id: string) => T
820
821 /**
822 * Trigger action
823 * @private
824 */
825 action: <T = (any[] | void) >(action: string, ...args: any[]) => T
826
827 /**
828 * Load files
829 * @private
830 */
831 onSpecWindow: (window: Window, specList: string[] | Array<() => Promise<void>>) => void
832 }
833
834 type CanReturnChainable = void | Chainable | Promise<unknown>
835 type ThenReturn<S, R> =
836 R extends void ? Chainable<S> :
837 R extends R | undefined ? Chainable<S | Exclude<R, undefined>> :
838 Chainable<S>
839
840 /**
841 * Chainable interface for non-array Subjects
842 */
843 interface Chainable<Subject = any> {
844 /**
845 * Create an assertion. Assertions are automatically retried until they pass or time out.
846 *
847 * @alias should
848 * @see https://on.cypress.io/and
849 */
850 and: Chainer<Subject>
851
852 /**
853 * Assign an alias for later use. Reference the alias later within a
854 * [cy.get()](https://on.cypress.io/get) or
855 * [cy.wait()](https://on.cypress.io/wait) command with a `@` prefix.
856 * You can alias DOM elements, routes, stubs and spies.
857 *
858 * @see https://on.cypress.io/as
859 * @see https://on.cypress.io/variables-and-aliases
860 * @see https://on.cypress.io/get
861 * @example
862 * // Get the aliased 'todos' elements
863 * cy.get('ul#todos').as('todos')
864 *
865 * // later retrieve the todos
866 * cy.get('@todos')
867 */
868 as(alias: string, options?: Partial<AsOptions>): Chainable<Subject>
869
870 /**
871 * Blur a focused element. This element must currently be in focus.
872 * If you want to ensure an element is focused before blurring,
873 * try using .focus() before .blur().
874 *
875 * @see https://on.cypress.io/blur
876 */
877 blur(options?: Partial<BlurOptions>): Chainable<Subject>
878
879 /**
880 * Check checkbox(es) or radio(s). This element must be an `<input>` with type `checkbox` or `radio`.
881 *
882 * @see https://on.cypress.io/check
883 * @example
884 * // Check checkbox element
885 * cy.get('[type="checkbox"]').check()
886 * // Check first radio element
887 * cy.get('[type="radio"]').first().check()
888 */
889 check(options?: Partial<CheckOptions>): Chainable<Subject>
890 /**
891 * Check checkbox(es) or radio(s). This element must be an `<input>` with type `checkbox` or `radio`.
892 *
893 * @see https://on.cypress.io/check
894 * @example
895 * // Select the radio with the value of 'US'
896 * cy.get('[type="radio"]').check('US')
897 * // Check the checkboxes with the values 'ga' and 'ca'
898 * cy.get('[type="checkbox"]').check(['ga', 'ca'])
899 */
900 check(value: string | string[], options?: Partial<CheckOptions>): Chainable<Subject>
901
902 /**
903 * Get the children of each DOM element within a set of DOM elements.
904 *
905 * @see https://on.cypress.io/children
906 */
907 children<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
908 children<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
909 children<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
910
911 /**
912 * Clear the value of an `input` or `textarea`.
913 * An alias for `.type({selectall}{del})`
914 *
915 * @see https://on.cypress.io/clear
916 */
917 clear(options?: Partial<ClearOptions>): Chainable<Subject>
918
919 /**
920 * Clear a specific browser cookie for a domain.
921 *
922 * Cypress automatically clears all cookies _before_ each test to prevent
923 * state from being shared across tests when test isolation is enabled.
924 * You shouldn't need to use this command unless you're using it to clear
925 * a specific cookie inside a single test or test isolation is disabled.
926 *
927 * @see https://on.cypress.io/clearcookie
928 */
929 clearCookie(name: string, options?: CookieOptions): Chainable<null>
930
931 /**
932 * Clear browser cookies for a domain.
933 *
934 * Cypress automatically clears all cookies _before_ each test to prevent
935 * state from being shared across tests when test isolation is enabled.
936 * You shouldn't need to use this command unless you're using it to clear
937 * specific cookies inside a single test or test isolation is disabled.
938 *
939 * @see https://on.cypress.io/clearcookies
940 */
941 clearCookies(options?: CookieOptions): Chainable<null>
942
943 /**
944 * Clear all browser cookies.
945 *
946 * Cypress automatically clears all cookies _before_ each test to prevent
947 * state from being shared across tests when test isolation is enabled.
948 * You shouldn't need to use this command unless you're using it to clear
949 * all cookie inside a single test or test isolation is disabled.
950 *
951 * @see https://on.cypress.io/clearallcookies
952 */
953 clearAllCookies(options?: Partial<Loggable & Timeoutable>): Chainable<null>
954
955 /**
956 * Get local storage for all origins.
957 *
958 * @see https://on.cypress.io/getalllocalstorage
959 */
960 getAllLocalStorage(options?: Partial<Loggable>): Chainable<StorageByOrigin>
961
962 /**
963 * Clear local storage for all origins.
964 *
965 * Cypress automatically clears all local storage _before_ each test to
966 * prevent state from being shared across tests when test isolation
967 * is enabled. You shouldn't need to use this command unless you're using it
968 * to clear localStorage inside a single test or test isolation is disabled.
969 *
970 * @see https://on.cypress.io/clearalllocalstorage
971 */
972 clearAllLocalStorage(options?: Partial<Loggable>): Chainable<null>
973
974 /**
975 * Get session storage for all origins.
976 *
977 * @see https://on.cypress.io/getallsessionstorage
978 */
979 getAllSessionStorage(options?: Partial<Loggable>): Chainable<StorageByOrigin>
980
981 /**
982 * Clear session storage for all origins.
983 *
984 * @see https://on.cypress.io/clearallsessionstorage
985 */
986 clearAllSessionStorage(options?: Partial<Loggable>): Chainable<null>
987
988 /**
989 * Clear data in local storage for the current origin.
990 *
991 * Cypress automatically clears all local storage _before_ each test to
992 * prevent state from being shared across tests when test isolation
993 * is enabled. You shouldn't need to use this command unless you're using it
994 * to clear localStorage inside a single test or test isolation is disabled.
995 *
996 * @see https://on.cypress.io/clearlocalstorage
997 * @param {string} [key] - name of a particular item to remove (optional).
998 * @example
999 ```
1000 // Removes all local storage keys
1001 cy.clearLocalStorage()
1002 .should(ls => {
1003 expect(ls.getItem('prop1')).to.be.null
1004 })
1005 // Removes item "todos"
1006 cy.clearLocalStorage("todos")
1007 ```
1008 */
1009 clearLocalStorage(key?: string): Chainable<Storage>
1010 /**
1011 * Clear keys in local storage that match given regular expression.
1012 *
1013 * @see https://on.cypress.io/clearlocalstorage
1014 * @param {RegExp} re - regular expression to match.
1015 * @example
1016 ```
1017 // Clears all local storage matching /app-/
1018 cy.clearLocalStorage(/app-/)
1019 ```
1020 */
1021 clearLocalStorage(re: RegExp): Chainable<Storage>
1022 /**
1023 * Clear data in local storage.
1024 * Cypress automatically runs this command before each test to prevent state from being
1025 * shared across tests. You shouldn't need to use this command unless you're using it
1026 * to clear localStorage inside a single test. Yields `localStorage` object.
1027 *
1028 * @see https://on.cypress.io/clearlocalstorage
1029 * @param {options} [object] - options object
1030 * @example
1031 ```
1032 // Removes all local storage items, without logging
1033 cy.clearLocalStorage({ log: false })
1034 ```
1035 */
1036 clearLocalStorage(options: Partial<Loggable>): Chainable<Storage>
1037 /**
1038 * Clear data in local storage.
1039 * Cypress automatically runs this command before each test to prevent state from being
1040 * shared across tests. You shouldn't need to use this command unless you're using it
1041 * to clear localStorage inside a single test. Yields `localStorage` object.
1042 *
1043 * @see https://on.cypress.io/clearlocalstorage
1044 * @param {string} [key] - name of a particular item to remove (optional).
1045 * @param {options} [object] - options object
1046 * @example
1047 ```
1048 // Removes item "todos" without logging
1049 cy.clearLocalStorage("todos", { log: false })
1050 ```
1051 */
1052 clearLocalStorage(key: string, options: Partial<Loggable>): Chainable<Storage>
1053
1054 /**
1055 * Click a DOM element.
1056 *
1057 * @see https://on.cypress.io/click
1058 * @example
1059 * cy.get('button').click() // Click on button
1060 * cy.focused().click() // Click on el with focus
1061 * cy.contains('Welcome').click() // Click on first el containing 'Welcome'
1062 */
1063 click(options?: Partial<ClickOptions>): Chainable<Subject>
1064 /**
1065 * Click a DOM element at specific corner / side.
1066 *
1067 * @param {PositionType} position - The position where the click should be issued.
1068 * The `center` position is the default position.
1069 * @see https://on.cypress.io/click
1070 * @example
1071 * cy.get('button').click('topRight')
1072 */
1073 click(position: PositionType, options?: Partial<ClickOptions>): Chainable<Subject>
1074 /**
1075 * Click a DOM element at specific coordinates
1076 *
1077 * @param {number} x The distance in pixels from the element's left to issue the click.
1078 * @param {number} y The distance in pixels from the element's top to issue the click.
1079 * @see https://on.cypress.io/click
1080 * @example
1081 ```
1082 // The click below will be issued inside of the element
1083 // (15px from the left and 40px from the top).
1084 cy.get('button').click(15, 40)
1085 ```
1086 */
1087 click(x: number, y: number, options?: Partial<ClickOptions>): Chainable<Subject>
1088
1089 /**
1090 * `cy.clock()` overrides native global functions related to time allowing them to be controlled
1091 * synchronously via [cy.tick()](https://on.cypress.io/tick) or the yielded clock object.
1092 * This includes controlling:
1093 * * `setTimeout`
1094 * * `clearTimeout`
1095 * * `setInterval`
1096 * * `clearInterval`
1097 * * `Date` Objects
1098 *
1099 * The clock starts at the unix epoch (timestamp of 0).
1100 * This means that when you instantiate new Date in your application,
1101 * it will have a time of January 1st, 1970.
1102 *
1103 * To restore the real clock call `.restore()`
1104 *
1105 * @example
1106 * cy.clock()
1107 * ...
1108 * // restore the application clock
1109 * cy.clock().then(clock => {
1110 * clock.restore()
1111 * })
1112 * // or use this shortcut
1113 * cy.clock().invoke('restore')
1114 *
1115 * @see https://on.cypress.io/clock
1116 */
1117 clock(): Chainable<Clock>
1118 /**
1119 * Mocks global clock and sets current timestamp to the given value.
1120 * Overrides all functions that deal with time.
1121 *
1122 * @see https://on.cypress.io/clock
1123 * @example
1124 * // in your app code
1125 * $('#date').text(new Date().toJSON())
1126 * // in the spec file
1127 * // March 14, 2017 timestamp or Date object
1128 * const now = new Date(2017, 2, 14).getTime()
1129 * cy.clock(now)
1130 * cy.visit('/index.html')
1131 * cy.get('#date').contains('2017-03-14')
1132 * // to restore the real clock
1133 * cy.clock().then(clock => {
1134 * clock.restore()
1135 * })
1136 * // or use this shortcut
1137 * cy.clock().invoke('restore')
1138 */
1139 clock(now: number | Date, options?: Loggable): Chainable<Clock>
1140 /**
1141 * Mocks global clock but only overrides specific functions.
1142 *
1143 * @see https://on.cypress.io/clock
1144 * @example
1145 * // keep current date but override "setTimeout" and "clearTimeout"
1146 * cy.clock(null, ['setTimeout', 'clearTimeout'])
1147 */
1148 clock(now: number | Date, functions?: Array<'setTimeout' | 'clearTimeout' | 'setInterval' | 'clearInterval' | 'Date'>, options?: Loggable): Chainable<Clock>
1149 /**
1150 * Mocks global clock and all functions.
1151 *
1152 * @see https://on.cypress.io/clock
1153 * @example
1154 * // mock clock but do not log this command
1155 * cy.clock({ log: false })
1156 */
1157 clock(options: Loggable): Chainable<Clock>
1158
1159 /**
1160 * Get the first DOM element that matches the selector (whether it be itself or one of its ancestors).
1161 *
1162 * @see https://on.cypress.io/closest
1163 */
1164 closest<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1165 closest<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1166
1167 /**
1168 * Get the DOM element containing the text.
1169 * DOM elements can contain more than the desired text and still match.
1170 * Additionally, Cypress prefers some DOM elements over the deepest element found.
1171 *
1172 * @see https://on.cypress.io/contains
1173 * @example
1174 * // Yield el in .nav containing 'About'
1175 * cy.get('.nav').contains('About')
1176 * // Yield first el in document containing 'Hello'
1177 * cy.contains('Hello')
1178 * // you can use regular expression
1179 * cy.contains(/^b\w+/)
1180 * // yields <ul>...</ul>
1181 * cy.contains('ul', 'apples')
1182 * // tries to find the given text for up to 1 second
1183 * cy.contains('my text to find', {timeout: 1000})
1184 */
1185 contains(content: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable & Shadow>): Chainable<Subject>
1186 /**
1187 * Get the child DOM element that contains given text.
1188 *
1189 * @see https://on.cypress.io/contains
1190 * @example
1191 * // Yield el in .nav containing 'About'
1192 * cy.get('.nav').contains('About')
1193 */
1194 contains<E extends Node = HTMLElement>(content: string | number | RegExp): Chainable<JQuery<E>>
1195 /**
1196 * Get the DOM element with name "selector" containing the text or regular expression.
1197 *
1198 * @see https://on.cypress.io/contains
1199 * @example
1200 * // yields <ul>...</ul>
1201 * cy.contains('ul', 'apples')
1202 */
1203 contains<K extends keyof HTMLElementTagNameMap>(selector: K, text: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable & Shadow>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1204 /**
1205 * Get the DOM element using CSS "selector" containing the text or regular expression.
1206 *
1207 * @see https://on.cypress.io/contains
1208 * @example
1209 * // yields <... class="foo">... apples ...</...>
1210 * cy.contains('.foo', 'apples')
1211 */
1212 contains<E extends Node = HTMLElement>(selector: string, text: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable & Shadow>): Chainable<JQuery<E>>
1213
1214 /**
1215 * Double-click a DOM element.
1216 *
1217 * @see https://on.cypress.io/dblclick
1218 */
1219 dblclick(options?: Partial<ClickOptions>): Chainable<Subject>
1220 /**
1221 * Double-click a DOM element at specific corner / side.
1222 *
1223 * @param {PositionType} position - The position where the click should be issued.
1224 * The `center` position is the default position.
1225 * @see https://on.cypress.io/dblclick
1226 * @example
1227 * cy.get('button').dblclick('topRight')
1228 */
1229 dblclick(position: PositionType, options?: Partial<ClickOptions>): Chainable<Subject>
1230 /**
1231 * Double-click a DOM element at specific coordinates
1232 *
1233 * @param {number} x The distance in pixels from the element's left to issue the click.
1234 * @param {number} y The distance in pixels from the element's top to issue the click.
1235 * @see https://on.cypress.io/dblclick
1236 * @example
1237 ```
1238 // The click below will be issued inside of the element
1239 // (15px from the left and 40px from the top).
1240 cy.get('button').dblclick(15, 40)
1241 ```
1242 */
1243 dblclick(x: number, y: number, options?: Partial<ClickOptions>): Chainable<Subject>
1244 /**
1245 * Right-click a DOM element.
1246 *
1247 * @see https://on.cypress.io/rightclick
1248 */
1249 rightclick(options?: Partial<ClickOptions>): Chainable<Subject>
1250 /**
1251 * Right-click a DOM element at specific corner / side.
1252 *
1253 * @param {PositionType} position - The position where the click should be issued.
1254 * The `center` position is the default position.
1255 * @see https://on.cypress.io/click
1256 * @example
1257 * cy.get('button').rightclick('topRight')
1258 */
1259 rightclick(position: PositionType, options?: Partial<ClickOptions>): Chainable<Subject>
1260 /**
1261 * Right-click a DOM element at specific coordinates
1262 *
1263 * @param {number} x The distance in pixels from the element's left to issue the click.
1264 * @param {number} y The distance in pixels from the element's top to issue the click.
1265 * @see https://on.cypress.io/rightclick
1266 * @example
1267 ```
1268 // The click below will be issued inside of the element
1269 // (15px from the left and 40px from the top).
1270 cy.get('button').rightclick(15, 40)
1271 ```
1272 */
1273 rightclick(x: number, y: number, options?: Partial<ClickOptions>): Chainable<Subject>
1274
1275 /**
1276 * Set a debugger and log what the previous command yields.
1277 *
1278 * @see https://on.cypress.io/debug
1279 */
1280 debug(options?: Partial<Loggable>): Chainable<Subject>
1281
1282 /**
1283 * Save/Restore browser Cookies, LocalStorage, and SessionStorage data resulting from the supplied `setup` function.
1284 *
1285 * @see https://on.cypress.io/session
1286 */
1287 session(id: string | object, setup: () => void, options?: SessionOptions): Chainable<null>
1288
1289 /**
1290 * Get the window.document of the page that is currently active.
1291 *
1292 * @see https://on.cypress.io/document
1293 * @example
1294 * cy.document()
1295 * .its('contentType')
1296 * .should('eq', 'text/html')
1297 */
1298 document(options?: Partial<Loggable & Timeoutable>): Chainable<Document>
1299
1300 /**
1301 * Iterate through an array like structure (arrays or objects with a length property).
1302 *
1303 * @see https://on.cypress.io/each
1304 */
1305 each<E extends Node = HTMLElement>(fn: (element: JQuery<E>, index: number, $list: E[]) => void): Chainable<JQuery<E>> // Can't properly infer type without breaking down Chainable
1306 each(fn: (item: any, index: number, $list: any[]) => void): Chainable<Subject>
1307
1308 /**
1309 * End a chain of commands
1310 *
1311 * @see https://on.cypress.io/end
1312 */
1313 end(): Chainable<null>
1314
1315 /**
1316 * Get A DOM element at a specific index in an array of elements.
1317 *
1318 * @see https://on.cypress.io/eq
1319 * @param {Number} index A number indicating the index to find the element at within an array of elements. A negative number counts index from the end of the list.
1320 * @example
1321 * cy.get('tbody>tr').eq(0) // Yield first 'tr' in 'tbody'
1322 * cy.get('ul>li').eq('4') // Yield fifth 'li' in 'ul'
1323 * cy.get('li').eq(-2) // Yields second from last 'li' element
1324 */
1325 eq<E extends Node = HTMLElement>(index: number, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1326
1327 /**
1328 * Execute a system command.
1329 * @see https://on.cypress.io/exec
1330 */
1331 exec(command: string, options?: Partial<ExecOptions>): Chainable<Exec>
1332
1333 /**
1334 * Get the DOM elements that match a specific selector. Opposite of `.not()`
1335 *
1336 * @see https://on.cypress.io/filter
1337 */
1338 filter<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>> // automatically returns the correct HTMLElement type
1339 /**
1340 * Get the DOM elements that match a specific selector. Opposite of `.not()`
1341 *
1342 * @see https://on.cypress.io/filter
1343 */
1344 filter<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1345 /**
1346 * Get the DOM elements that match a specific selector. Opposite of `.not()`
1347 *
1348 * @see https://on.cypress.io/filter
1349 */
1350 filter<E extends Node = HTMLElement>(fn: (index: number, element: E) => boolean, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1351
1352 /**
1353 * Get the descendent DOM elements of a specific selector.
1354 *
1355 * @see https://on.cypress.io/find
1356 * @example
1357 * cy.get('.article').find('footer') // Yield 'footer' within '.article'
1358 */
1359 find<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable & Shadow>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1360 /**
1361 * Finds the descendent DOM elements with the given selector.
1362 *
1363 * @see https://on.cypress.io/find
1364 * @example
1365 * // Find the li's within the nav
1366 * cy.get('.left-nav>.nav').find('>li')
1367 */
1368 find<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable & Shadow>): Chainable<JQuery<E>>
1369
1370 /**
1371 * Get the first DOM element within a set of DOM elements.
1372 *
1373 * @see https://on.cypress.io/first
1374 */
1375 first(options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
1376
1377 /**
1378 * Load a fixed set of data located in a file.
1379 *
1380 * @see https://on.cypress.io/fixture
1381 */
1382 fixture<Contents = any>(path: string, options?: Partial<Timeoutable>): Chainable<Contents> // no log?
1383 /**
1384 * Load a fixed set of data located in a file with given encoding.
1385 *
1386 * @see https://on.cypress.io/fixture
1387 */
1388 fixture<Contents = any>(path: string, encoding: Encodings, options?: Partial<Timeoutable>): Chainable<Contents> // no log?
1389
1390 /**
1391 * Focus on a DOM element.
1392 *
1393 * @see https://on.cypress.io/focus
1394 * @example
1395 * cy.get('input').first().focus() // Focus on the first input
1396 */
1397 focus(options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
1398
1399 /**
1400 * Get the DOM element that is currently focused.
1401 *
1402 * @see https://on.cypress.io/focused
1403 * @example
1404 * // Get the element that is focused
1405 * cy.focused().then(function($el) {
1406 * // do something with $el
1407 * })
1408 * // Blur the element with focus
1409 * cy.focused().blur()
1410 * // Make an assertion on the focused element
1411 * cy.focused().should('have.attr', 'name', 'username')
1412 */
1413 focused(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery>
1414
1415 /**
1416 * Get one or more DOM elements by node name: input, button, etc.
1417 * @see https://on.cypress.io/get
1418 * @example
1419 * cy.get('input').should('be.disabled')
1420 * cy.get('button').should('be.visible')
1421 */
1422 get<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1423 /**
1424 * Get one or more DOM elements by selector.
1425 * The querying behavior of this command matches exactly how $() works in jQuery.
1426 * @see https://on.cypress.io/get
1427 * @example
1428 * cy.get('.list>li') // Yield the <li>'s in <.list>
1429 * cy.get('ul li:first').should('have.class', 'active')
1430 * cy.get('.dropdown-menu').click()
1431 */
1432 get<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<JQuery<E>>
1433 /**
1434 * Get one or more DOM elements by alias.
1435 * @see https://on.cypress.io/get#Alias
1436 * @example
1437 * // Get the aliased 'todos' elements
1438 * cy.get('ul#todos').as('todos')
1439 * //...hack hack hack...
1440 * //later retrieve the todos
1441 * cy.get('@todos')
1442 */
1443 get<S = any>(alias: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<S>
1444
1445 /**
1446 * Get a browser cookie by its name.
1447 *
1448 * @see https://on.cypress.io/getcookie
1449 */
1450 getCookie(name: string, options?: CookieOptions): Chainable<Cookie | null>
1451
1452 /**
1453 * Get browser cookies for a domain.
1454 *
1455 * @see https://on.cypress.io/getcookies
1456 */
1457 getCookies(options?: CookieOptions): Chainable<Cookie[]>
1458
1459 /**
1460 * Get all browser cookies.
1461 *
1462 * @see https://on.cypress.io/getallcookies
1463 */
1464 getAllCookies(options?: Partial<Loggable & Timeoutable>): Chainable<Cookie[]>
1465
1466 /**
1467 * Navigate back or forward to the previous or next URL in the browser's history.
1468 *
1469 * @see https://on.cypress.io/go
1470 */
1471 go(direction: HistoryDirection | number, options?: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
1472
1473 /**
1474 * Get the current URL hash of the page that is currently active.
1475 *
1476 * @see https://on.cypress.io/hash
1477 */
1478 hash(options?: Partial<Loggable & Timeoutable>): Chainable<string>
1479
1480 /**
1481 * Invoke a function on the previously yielded subject.
1482 *
1483 * @see https://on.cypress.io/invoke
1484 */
1485 invoke<K extends keyof Subject, F extends ((...args: any[]) => any) & Subject[K], R = ReturnType<F>>(
1486 functionName: K,
1487 ...args: any[]
1488 ): Chainable<R>
1489 invoke<K extends keyof Subject, F extends ((...args: any[]) => any) & Subject[K], R = ReturnType<F>>(
1490 options: Partial<Loggable & Timeoutable>,
1491 functionName: K,
1492 ...args: any[]
1493 ): Chainable<R>
1494
1495 /**
1496 * Invoke a function in an array of functions.
1497 * @see https://on.cypress.io/invoke
1498 */
1499 invoke<T extends (...args: any[]) => any, Subject extends T[]>(index: number): Chainable<ReturnType<T>>
1500 invoke<T extends (...args: any[]) => any, Subject extends T[]>(options: Partial<Loggable & Timeoutable>, index: number): Chainable<ReturnType<T>>
1501
1502 /**
1503 * Invoke a function on the previously yielded subject by a property path.
1504 * Property path invocation cannot be strongly-typed.
1505 * Invoking by a property path will always result in any.
1506 *
1507 * @see https://on.cypress.io/invoke
1508 */
1509 invoke(propertyPath: string, ...args: any[]): Chainable
1510
1511 /**
1512 * Get a property's value on the previously yielded subject.
1513 *
1514 * @see https://on.cypress.io/its
1515 * @example
1516 * // Get the 'width' property
1517 * cy.wrap({width: '50'}).its('width')
1518 * // Drill into nested properties by using dot notation
1519 * cy.wrap({foo: {bar: {baz: 1}}}).its('foo.bar.baz')
1520 */
1521 its<K extends keyof Subject>(propertyName: K, options?: Partial<Loggable & Timeoutable>): Chainable<NonNullable<Subject[K]>>
1522 its(propertyPath: string, options?: Partial<Loggable & Timeoutable>): Chainable
1523
1524 /**
1525 * Get a value by index from an array yielded from the previous command.
1526 * @see https://on.cypress.io/its
1527 * @example
1528 * cy.wrap(['a', 'b']).its(1).should('equal', 'b')
1529 */
1530 its<T, Subject extends T[]>(index: number, options?: Partial<Loggable & Timeoutable>): Chainable<T>
1531
1532 /**
1533 * Get the last DOM element within a set of DOM elements.
1534 *
1535 * @see https://on.cypress.io/last
1536 */
1537 last<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1538
1539 /**
1540 * Get the global `window.location` object of the page that is currently active.
1541 *
1542 * @see https://on.cypress.io/location
1543 * @example
1544 * cy.location() // Get location object
1545 */
1546 location(options?: Partial<Loggable & Timeoutable>): Chainable<Location>
1547 /**
1548 * Get a part of the global `window.location` object of the page that is currently active.
1549 *
1550 * @see https://on.cypress.io/location
1551 * @example
1552 * cy.location('host') // Get the host of the location object
1553 * cy.location('port') // Get the port of the location object
1554 * // Assert on the href of the location
1555 * cy.location('href').should('contain', '/tag/tutorials')
1556 */
1557 location<K extends keyof Location>(key: K, options?: Partial<Loggable & Timeoutable>): Chainable<Location[K]>
1558
1559 /**
1560 * Print a message to the Cypress Command Log.
1561 *
1562 * @see https://on.cypress.io/log
1563 */
1564 log(message: string, ...args: any[]): Chainable<null>
1565
1566 /**
1567 * Get the immediately following sibling of each DOM element within a set of DOM elements.
1568 *
1569 * @see https://on.cypress.io/next
1570 */
1571 next<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1572 /**
1573 * Get the immediately following sibling of each DOM element within a set of DOM elements.
1574 *
1575 * @see https://on.cypress.io/next
1576 * @example
1577 * cy.get('nav a:first').next()
1578 */
1579 next<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1580 /**
1581 * Get the immediately following sibling of each DOM element within a set of DOM elements that match selector
1582 *
1583 * @see https://on.cypress.io/next
1584 * @example
1585 * cy.get('nav a:first').next('.menu-item)
1586 */
1587 next<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1588
1589 /**
1590 * Get all following siblings of each DOM element in a set of matched DOM elements.
1591 *
1592 * @see https://on.cypress.io/nextall
1593 */
1594 nextAll<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1595 /**
1596 * Get all following siblings of each DOM element in a set of matched DOM elements.
1597 *
1598 * @see https://on.cypress.io/nextall
1599 */
1600 nextAll<E extends HTMLElement = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1601 /**
1602 * Get all following siblings of each DOM element in a set of matched DOM elements.
1603 *
1604 * @see https://on.cypress.io/nextall
1605 */
1606 nextAll<E extends HTMLElement = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1607
1608 /**
1609 * Get all following siblings of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1610 *
1611 * @see https://on.cypress.io/nextuntil
1612 */
1613 nextUntil<K extends keyof HTMLElementTagNameMap>(selector: K, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1614 /**
1615 * Get all following siblings of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1616 *
1617 * @see https://on.cypress.io/nextuntil
1618 */
1619 nextUntil<E extends Node = HTMLElement>(selector: string, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1620 /**
1621 * Get all following siblings of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1622 *
1623 * @see https://on.cypress.io/nextuntil
1624 */
1625 nextUntil<E extends Node = HTMLElement>(element: E | JQuery<E>, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1626
1627 /**
1628 * Filter DOM element(s) from a set of DOM elements. Opposite of `.filter()`
1629 *
1630 * @see https://on.cypress.io/not
1631 */
1632 not(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery>
1633
1634 /**
1635 * Invoke a command synchronously, without using the command queue.
1636 *
1637 * @see https://on.cypress.io/api/custom-queries
1638 */
1639 now(name: string, ...args: any[]): Promise<any> | ((subject: any) => any)
1640
1641 /**
1642 * These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
1643 * @see https://on.cypress.io/catalog-of-events#App-Events
1644 */
1645 on: Actions
1646
1647 /**
1648 * These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
1649 * @see https://on.cypress.io/catalog-of-events#App-Events
1650 */
1651 once: Actions
1652
1653 /**
1654 * These events come from Cypress as it issues commands and reacts to their state. These are all useful to listen to for debugging purposes.
1655 * @see https://on.cypress.io/catalog-of-events#App-Events
1656 */
1657 off: Actions
1658
1659 /**
1660 * Enables running Cypress commands in a secondary origin.
1661 * @see https://on.cypress.io/origin
1662 * @example
1663 * cy.origin('example.com', () => {
1664 * cy.get('h1').should('equal', 'Example Domain')
1665 * })
1666 */
1667 origin<T extends any>(urlOrDomain: string, fn: () => void): Chainable<T>
1668
1669 /**
1670 * Enables running Cypress commands in a secondary origin.
1671 * @see https://on.cypress.io/origin
1672 * @example
1673 * cy.origin('example.com', { args: { key: 'value', foo: 'foo' } }, ({ key, foo }) => {
1674 * expect(key).to.equal('value')
1675 * expect(foo).to.equal('foo')
1676 * })
1677 */
1678 origin<T, S extends any>(urlOrDomain: string, options: {
1679 args: T
1680 }, fn: (args: T) => void): Chainable<S>
1681
1682 /**
1683 * Get the parent DOM element of a set of DOM elements.
1684 *
1685 * @see https://on.cypress.io/parent
1686 */
1687 parent<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1688 /**
1689 * Get the parent DOM element of a set of DOM elements.
1690 *
1691 * @see https://on.cypress.io/parent
1692 */
1693 parent<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1694 /**
1695 * Get the parent DOM element of a set of DOM elements.
1696 *
1697 * @see https://on.cypress.io/parent
1698 */
1699 parent<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1700
1701 /**
1702 * Get the parent DOM elements of a set of DOM elements.
1703 *
1704 * @see https://on.cypress.io/parents
1705 */
1706 parents<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1707 /**
1708 * Get the parent DOM elements of a set of DOM elements.
1709 *
1710 * @see https://on.cypress.io/parents
1711 */
1712 parents<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1713 /**
1714 * Get the parent DOM elements of a set of DOM elements.
1715 *
1716 * @see https://on.cypress.io/parents
1717 */
1718 parents<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1719
1720 /**
1721 * Get all ancestors of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1722 *
1723 * @see https://on.cypress.io/parentsuntil
1724 */
1725 parentsUntil<K extends keyof HTMLElementTagNameMap>(selector: K, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1726 /**
1727 * Get all ancestors of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1728 *
1729 * @see https://on.cypress.io/parentsuntil
1730 */
1731 parentsUntil<E extends Node = HTMLElement>(selector: string, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1732 /**
1733 * Get all ancestors of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1734 *
1735 * @see https://on.cypress.io/parentsuntil
1736 */
1737 parentsUntil<E extends Node = HTMLElement>(element: E | JQuery<E>, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1738
1739 /**
1740 * Stop cy commands from running and allow interaction with the application under test. You can then "resume" running all commands or choose to step through the "next" commands from the Command Log.
1741 * This does not set a `debugger` in your code, unlike `.debug()`
1742 *
1743 * @see https://on.cypress.io/pause
1744 */
1745 pause(options?: Partial<Loggable>): Chainable<Subject>
1746
1747 /**
1748 * Get the immediately preceding sibling of each element in a set of the elements.
1749 *
1750 * @example
1751 * cy.get('nav').prev('a') // Yield previous 'a'
1752 * @see https://on.cypress.io/prev
1753 */
1754 prev<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1755 /**
1756 * Get the immediately preceding sibling of each element in a set of the elements.
1757 *
1758 * @example
1759 * cy.get('li').prev() // Yield previous 'li'
1760 * @see https://on.cypress.io/prev
1761 */
1762 prev<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1763 /**
1764 * Get the immediately preceding sibling of each element in a set of the elements that match selector.
1765 *
1766 * @example
1767 * cy.get('nav').prev('.menu-item') // Yield previous '.menu-item'
1768 * @see https://on.cypress.io/prev
1769 */
1770 prev<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1771
1772 /**
1773 * Get all previous siblings of each DOM element in a set of matched DOM elements.
1774 * > The querying behavior of this command matches exactly how [.prevAll()](http://api.jquery.com/prevAll) works in jQuery.
1775 *
1776 * @see https://on.cypress.io/prevall
1777 */
1778 prevAll<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1779 /**
1780 * Get all previous siblings of each DOM element in a set of matched DOM elements.
1781 * > The querying behavior of this command matches exactly how [.prevAll()](http://api.jquery.com/prevAll) works in jQuery.
1782 *
1783 * @see https://on.cypress.io/prevall
1784 */
1785 prevAll<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1786 /**
1787 * Get all previous siblings of each DOM element in a set of matched DOM elements.
1788 * > The querying behavior of this command matches exactly how [.prevAll()](http://api.jquery.com/prevAll) works in jQuery.
1789 *
1790 * @see https://on.cypress.io/prevall
1791 */
1792 prevAll<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1793
1794 /**
1795 * Get all previous siblings of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1796 * > The querying behavior of this command matches exactly how [.prevUntil()](http://api.jquery.com/prevUntil) works in jQuery.
1797 *
1798 * @see https://on.cypress.io/prevuntil
1799 */
1800 prevUntil<K extends keyof HTMLElementTagNameMap>(selector: K, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
1801 /**
1802 * Get all previous siblings of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1803 * > The querying behavior of this command matches exactly how [.prevUntil()](http://api.jquery.com/prevUntil) works in jQuery.
1804 *
1805 * @see https://on.cypress.io/prevuntil
1806 */
1807 prevUntil<E extends Node = HTMLElement>(selector: string, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1808 /**
1809 * Get all previous siblings of each DOM element in a set of matched DOM elements up to, but not including, the element provided.
1810 * > The querying behavior of this command matches exactly how [.prevUntil()](http://api.jquery.com/prevUntil) works in jQuery.
1811 *
1812 * @see https://on.cypress.io/prevuntil
1813 */
1814 prevUntil<E extends Node = HTMLElement>(element: E | JQuery<E>, filter?: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1815
1816 /**
1817 * Read a file and yield its contents.
1818 *
1819 * @see https://on.cypress.io/readfile
1820 */
1821 readFile<Contents = any>(filePath: string, options?: Partial<Loggable & Timeoutable>): Chainable<Contents>
1822 /**
1823 * Read a file with given encoding and yield its contents.
1824 *
1825 * @see https://on.cypress.io/readfile
1826 * @example
1827 * cy.readFile('foo.json', 'utf8')
1828 */
1829 readFile<Contents = any>(filePath: string, encoding: Encodings, options?: Partial<Loggable & Timeoutable>): Chainable<Contents>
1830
1831 /**
1832 * Reload the page.
1833 *
1834 * @see https://on.cypress.io/reload
1835 * @example
1836 * cy.visit('http://localhost:3000/admin')
1837 * cy.reload()
1838 */
1839 reload(): Chainable<AUTWindow>
1840 /**
1841 * Reload the page.
1842 *
1843 * @see https://on.cypress.io/reload
1844 * @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
1845 * @example
1846 * // Reload the page, do not log it in the command log and timeout after 15s
1847 * cy.visit('http://localhost:3000/admin')
1848 * cy.reload({log: false, timeout: 15000})
1849 */
1850 reload(options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
1851 /**
1852 * Reload the page without cache
1853 *
1854 * @see https://on.cypress.io/reload
1855 * @param {Boolean} forceReload Whether to reload the current page without using the cache. true forces the reload without cache.
1856 * @example
1857 * // Reload the page without using the cache
1858 * cy.visit('http://localhost:3000/admin')
1859 * cy.reload(true)
1860 */
1861 reload(forceReload: boolean): Chainable<AUTWindow>
1862 /**
1863 * Reload the page without cache and with log and timeout options
1864 *
1865 * @see https://on.cypress.io/reload
1866 * @param {Boolean} forceReload Whether to reload the current page without using the cache. true forces the reload without cache.
1867 * @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
1868 * @example
1869 * // Reload the page without using the cache, do not log it in the command log and timeout after 15s
1870 * cy.visit('http://localhost:3000/admin')
1871 * cy.reload(true, {log: false, timeout: 15000})
1872 */
1873 reload(forceReload: boolean, options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
1874
1875 /**
1876 * Make an HTTP GET request.
1877 *
1878 * @see https://on.cypress.io/request
1879 * @example
1880 * cy.request('http://dev.local/seed')
1881 */
1882 request<T = any>(url: string, body?: RequestBody): Chainable<Response<T>>
1883 /**
1884 * Make an HTTP request with specific method.
1885 *
1886 * @see https://on.cypress.io/request
1887 * @example
1888 * cy.request('POST', 'http://localhost:8888/users', {name: 'Jane'})
1889 */
1890 request<T = any>(method: HttpMethod, url: string, body?: RequestBody): Chainable<Response<T>>
1891 /**
1892 * Make an HTTP request with specific behavior.
1893 *
1894 * @see https://on.cypress.io/request
1895 * @example
1896 * cy.request({
1897 * url: '/dashboard',
1898 * followRedirect: false // turn off following redirects
1899 * })
1900 */
1901 request<T = any>(options: Partial<RequestOptions>): Chainable<Response<T>>
1902
1903 /**
1904 * Get the root DOM element.
1905 * The root element yielded is `<html>` by default.
1906 * However, when calling `.root()` from a `.within()` command,
1907 * the root element will point to the element you are "within".
1908 *
1909 * @see https://on.cypress.io/root
1910 */
1911 root<E extends Node = HTMLHtmlElement>(options?: Partial<Loggable>): Chainable<JQuery<E>> // can't do better typing unless we ignore the `.within()` case
1912
1913 /**
1914 * Take a screenshot of the application under test and the Cypress Command Log.
1915 *
1916 * @see https://on.cypress.io/screenshot
1917 * @example
1918 * cy.screenshot()
1919 * cy.get(".post").screenshot()
1920 */
1921 screenshot(options?: Partial<Loggable & Timeoutable & ScreenshotOptions>): Chainable<Subject>
1922
1923 /**
1924 * Take a screenshot of the application under test and the Cypress Command Log and save under given filename.
1925 *
1926 * @see https://on.cypress.io/screenshot
1927 * @example
1928 * cy.screenshot("post-element")
1929 * cy.get(".post").screenshot("post-element")
1930 */
1931 screenshot(fileName: string, options?: Partial<Loggable & Timeoutable & ScreenshotOptions>): Chainable<Subject>
1932
1933 /**
1934 * Scroll an element into view.
1935 *
1936 * @see https://on.cypress.io/scrollintoview
1937 */
1938 scrollIntoView(options?: Partial<ScrollIntoViewOptions>): Chainable<Subject>
1939
1940 /**
1941 * Scroll to a specific position.
1942 *
1943 * @see https://on.cypress.io/scrollto
1944 */
1945 scrollTo(position: PositionType, options?: Partial<ScrollToOptions>): Chainable<Subject>
1946 /**
1947 * Scroll to a specific X,Y position.
1948 *
1949 * @see https://on.cypress.io/scrollto
1950 */
1951 scrollTo(x: number | string, y: number | string, options?: Partial<ScrollToOptions>): Chainable<Subject>
1952
1953 /**
1954 * Select an `<option>` with specific text, value, or index within a `<select>`.
1955 *
1956 * @see https://on.cypress.io/select
1957 */
1958 select(valueOrTextOrIndex: string | number | Array<string | number>, options?: Partial<SelectOptions>): Chainable<Subject>
1959
1960 /**
1961 * Select a file with the given <input> element, or drag and drop a file over any DOM subject.
1962 *
1963 * @param {FileReference} files - The file(s) to select or drag onto this element.
1964 * @see https://on.cypress.io/selectfile
1965 * @example
1966 * cy.get('input[type=file]').selectFile(Cypress.Buffer.from('text'))
1967 * cy.get('input[type=file]').selectFile({
1968 * fileName: 'users.json',
1969 * contents: [{name: 'John Doe'}]
1970 * })
1971 */
1972 selectFile(files: FileReference | FileReference[], options?: Partial<SelectFileOptions>): Chainable<Subject>
1973
1974 /**
1975 * Set a browser cookie.
1976 *
1977 * @see https://on.cypress.io/setcookie
1978 */
1979 setCookie(name: string, value: string, options?: Partial<SetCookieOptions>): Chainable<Cookie>
1980
1981 /**
1982 * Traverse into an element's shadow root.
1983 *
1984 * @example
1985 * cy.get('my-component')
1986 * .shadow()
1987 * .find('.my-button')
1988 * .click()
1989 * @see https://on.cypress.io/shadow
1990 */
1991 shadow(): Chainable<Subject>
1992
1993 /**
1994 * Create an assertion. Assertions are automatically retried until they pass or time out.
1995 *
1996 * @see https://on.cypress.io/should
1997 * @example
1998 * // Assert on the href of the location
1999 * cy.location('href').should('contain', '/tag/tutorials/')
2000 */
2001 should: Chainer<Subject>
2002
2003 /**
2004 * Get sibling DOM elements.
2005 *
2006 * @see https://on.cypress.io/siblings
2007 * @example
2008 * cy.get('td').siblings('a') // Yield all link siblings of "td"
2009 */
2010 siblings<K extends keyof HTMLElementTagNameMap>(selector: K, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
2011 /**
2012 * Get all sibling DOM elements.
2013 *
2014 * @see https://on.cypress.io/siblings
2015 * @example
2016 * cy.get('td').siblings() // Yield all siblings of "td"
2017 */
2018 siblings<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
2019 /**
2020 * Get all sibling DOM elements that match given selector.
2021 *
2022 * @see https://on.cypress.io/siblings
2023 * @example
2024 * // Yield all elements with class "foo" that are siblings of "td"
2025 * cy.get('td').siblings('.foo')
2026 */
2027 siblings<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
2028
2029 /**
2030 * Returns a new spy function.
2031 * > Note: `.spy()` assumes you are already familiar with our guide: [Stubs, Spies, and Clocks](https://on.cypress.io/stubs-spies-and-clocks)
2032 *
2033 * @see https://on.cypress.io/spy
2034 * @example
2035 * const fn = cy.spy() // returns "dumb" spy function
2036 * fn(42)
2037 * expect(fn).to.have.been.calledOnce
2038 * expect(fn).to.have.always.been.calledWithExactly(42)
2039 */
2040 spy(): Agent<sinon.SinonSpy>
2041 /**
2042 * Wraps existing function and spies on it, while passing arguments and results.
2043 * @see https://on.cypress.io/spy
2044 * @example
2045 * const add = (a, b) => a + b
2046 * const spy = cy.spy(add)
2047 * expect(spy(2, 3)).to.equal(5)
2048 * expect(spy).to.have.been.calledWithExactly(2, 3)
2049 */
2050 spy(func: (...args: any[]) => any): Agent<sinon.SinonSpy>
2051 /**
2052 * Spy on a method.
2053 * @see https://on.cypress.io/spy
2054 * @example
2055 * // assume App.start calls util.addListeners
2056 * cy.spy(util, 'addListeners')
2057 * App.start()
2058 * expect(util.addListeners).to.be.called
2059 */
2060 spy<T>(obj: T, method: keyof T): Agent<sinon.SinonSpy>
2061
2062 /**
2063 * Replace a function, record its usage and control its behavior.
2064 * > Note: `.stub()` assumes you are already familiar with our guide:
2065 * [Stubs, Spies, and Clocks](https://on.cypress.io/stubs-spies-and-clocks)
2066 *
2067 * @see https://on.cypress.io/stub
2068 * @example
2069 * const fn = cy.stub() // stub without any arguments acts like a spy
2070 * fn(42)
2071 * expect(fn).to.have.been.calledOnce
2072 * expect(fn).to.have.always.been.calledWithExactly(42)
2073 */
2074 stub(): Agent<sinon.SinonStub>
2075 /**
2076 * Stubs all the object's methods.
2077 *
2078 * @see https://on.cypress.io/stub
2079 * @example
2080 * const o = {
2081 * toString () {
2082 * return 'foo'
2083 * }
2084 * }
2085 * expect(o.toString()).to.equal('foo')
2086 * cy.stub(o)
2087 * // because stub does not call original function
2088 * expect(o.toString()).to.equal(undefined)
2089 * expect(o.toString).to.have.been.calledOnce
2090 */
2091 stub(obj: any): Agent<sinon.SinonStub>
2092 /**
2093 * Stubs single method of an object.
2094 *
2095 * @see https://on.cypress.io/stub
2096 * @example
2097 * const o = {}
2098 * expect(o.toString()).to.equal('[object Object]')
2099 * cy.stub(o, 'toString').callsFake(() => 'foo')
2100 * expect(o.toString()).to.equal('foo')
2101 * expect(o.toString).to.have.been.calledOnce
2102 */
2103 stub<T>(obj: T, method: keyof T): Agent<sinon.SinonStub>
2104 /**
2105 * Stubs a method on an object
2106 *
2107 * @deprecated Use `cy.stub(object, name).callsFake(fn)` instead
2108 */
2109 stub<T>(obj: T, method: keyof T, func: (...args: any[]) => any): Agent<sinon.SinonStub>
2110
2111 /**
2112 * Submit a form.
2113 *
2114 * @see https://on.cypress.io/submit
2115 */
2116 submit(options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
2117
2118 /**
2119 * Expand an array into multiple arguments.
2120 * @see https://on.cypress.io/spread
2121 * @example
2122 * cy.getCookies().spread((cookie1, cookie2, cookie3) => {
2123 * // each cookie is now an individual argument
2124 * })
2125 */
2126 spread<S extends object | any[] | string | number | boolean>(fn: (...args: any[]) => S): Chainable<S>
2127 /**
2128 * Expand an array into multiple arguments.
2129 * @see https://on.cypress.io/spread
2130 * @example
2131 * cy.getCookies().spread((cookie1, cookie2, cookie3) => {
2132 * // each cookie is now an individual argument
2133 * })
2134 */
2135 spread(fn: (...args: any[]) => void): Chainable<Subject>
2136
2137 /**
2138 * Run a task in Node via the plugins file.
2139 *
2140 * @see https://on.cypress.io/api/task
2141 */
2142 task<S = unknown>(event: string, arg?: any, options?: Partial<Loggable & Timeoutable>): Chainable<S>
2143
2144 /**
2145 * Enables you to work with the subject yielded from the previous command.
2146 *
2147 * @see https://on.cypress.io/then
2148 */
2149 then<S>(fn: (this: ObjectLike, currentSubject: Subject) => Chainable<S>): Chainable<S>
2150 /**
2151 * Enables you to work with the subject yielded from the previous command.
2152 *
2153 * @see https://on.cypress.io/then
2154 */
2155 then<S>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => Chainable<S>): Chainable<S>
2156 /**
2157 * Enables you to work with the subject yielded from the previous command / promise.
2158 *
2159 * @see https://on.cypress.io/then
2160 */
2161 then<S>(fn: (this: ObjectLike, currentSubject: Subject) => PromiseLike<S>): Chainable<S>
2162 /**
2163 * Enables you to work with the subject yielded from the previous command / promise.
2164 *
2165 * @see https://on.cypress.io/then
2166 */
2167 then<S>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => PromiseLike<S>): Chainable<S>
2168 /**
2169 * Enables you to work with the subject yielded from the previous command / promise.
2170 *
2171 * @see https://on.cypress.io/then
2172 */
2173 then<S extends string | number | boolean>(fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<S>
2174 /**
2175 * Enables you to work with the subject yielded from the previous command / promise.
2176 *
2177 * @see https://on.cypress.io/then
2178 */
2179 then<S extends HTMLElement>(fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S>>
2180 /**
2181 * Enables you to work with the subject yielded from the previous command / promise.
2182 *
2183 * @see https://on.cypress.io/then
2184 */
2185 then<S extends ArrayLike<HTMLElement>>(fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S extends ArrayLike<infer T> ? T : never>>
2186 /**
2187 * Enables you to work with the subject yielded from the previous command / promise.
2188 *
2189 * @see https://on.cypress.io/then
2190 */
2191 then<S extends any[] | object>(fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<S>
2192 /**
2193 * Enables you to work with the subject yielded from the previous command / promise.
2194 *
2195 * @see https://on.cypress.io/then
2196 */
2197 then<S>(fn: (this: ObjectLike, currentSubject: Subject) => S): ThenReturn<Subject, S>
2198 /**
2199 * Enables you to work with the subject yielded from the previous command / promise.
2200 *
2201 * @see https://on.cypress.io/then
2202 */
2203 then<S extends HTMLElement>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S>>
2204 /**
2205 * Enables you to work with the subject yielded from the previous command / promise.
2206 *
2207 * @see https://on.cypress.io/then
2208 */
2209 then<S extends ArrayLike<HTMLElement>>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<JQuery<S extends ArrayLike<infer T> ? T : never>>
2210 /**
2211 * Enables you to work with the subject yielded from the previous command / promise.
2212 *
2213 * @see https://on.cypress.io/then
2214 */
2215 then<S extends object | any[] | string | number | boolean>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<S>
2216 /**
2217 * Enables you to work with the subject yielded from the previous command / promise.
2218 *
2219 * @see https://on.cypress.io/then
2220 */
2221 then<S>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => S): ThenReturn<Subject, S>
2222 /**
2223 * Enables you to work with the subject yielded from the previous command.
2224 *
2225 * @see https://on.cypress.io/then
2226 * @example
2227 * cy.get('.nav').then(($nav) => {}) // Yields .nav as first arg
2228 * cy.location().then((loc) => {}) // Yields location object as first arg
2229 */
2230 then(fn: (this: ObjectLike, currentSubject: Subject) => void): Chainable<Subject>
2231 /**
2232 * Enables you to work with the subject yielded from the previous command.
2233 *
2234 * @see https://on.cypress.io/then
2235 * @example
2236 * cy.get('.nav').then(($nav) => {}) // Yields .nav as first arg
2237 * cy.location().then((loc) => {}) // Yields location object as first arg
2238 */
2239 then(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => void): Chainable<Subject>
2240
2241 /**
2242 * Move time after overriding a native time function with [cy.clock()](https://on.cypress.io/clock).
2243 * `cy.clock()` must be called before `cy.tick()`
2244 *
2245 * @see https://on.cypress.io/clock
2246 * @example
2247 * cy.clock()
2248 * ...
2249 * // advance time by 10 minutes
2250 * cy.tick(600*1000)
2251 * // you can restore the real clock
2252 * cy.tick(1000).then(clock => {
2253 * clock.restore()
2254 * })
2255 * // or use this shortcut
2256 * cy.tick(5000).invoke('restore')
2257 */
2258 tick(milliseconds: number, options?: Partial<Loggable>): Chainable<Clock>
2259
2260 /**
2261 * Get the `document.title` property of the page that is currently active.
2262 *
2263 * @see https://on.cypress.io/title
2264 */
2265 title(options?: Partial<Loggable & Timeoutable>): Chainable<string>
2266
2267 /**
2268 * Trigger an event on a DOM element.
2269 *
2270 * @see https://on.cypress.io/trigger
2271 */
2272 trigger<K extends keyof DocumentEventMap>(eventName: K, options?: Partial<TriggerOptions & ObjectLike & DocumentEventMap[K]>): Chainable<Subject>
2273 /**
2274 * Trigger an event on a DOM element.
2275 *
2276 * @see https://on.cypress.io/trigger
2277 */
2278 trigger<K extends keyof DocumentEventMap>(eventName: K, position?: PositionType, options?: Partial<TriggerOptions & ObjectLike & DocumentEventMap[K]>): Chainable<Subject>
2279 /**
2280 * Trigger an event on a DOM element.
2281 *
2282 * @see https://on.cypress.io/trigger
2283 */
2284 trigger<K extends keyof DocumentEventMap>(eventName: K, x: number, y: number, options?: Partial<TriggerOptions & ObjectLike & DocumentEventMap[K]>): Chainable<Subject>
2285 /**
2286 * Trigger an event on a DOM element.
2287 * Custom events... If the following were `.triggerCustom`,
2288 * `.trigger` strongly typed with event data
2289 *
2290 * @see https://on.cypress.io/trigger
2291 * @example
2292 * cy.get('a').trigger('mousedown')
2293 */
2294 trigger(eventName: string, position?: PositionType, options?: Partial<TriggerOptions & ObjectLike>): Chainable<Subject>
2295 /**
2296 * Trigger an event on a DOM element.
2297 * Custom events... If the following were `.triggerCustom`,
2298 * `.trigger` strongly typed with event data
2299 *
2300 * @see https://on.cypress.io/trigger
2301 * @example
2302 * cy.get('a').trigger('mousedown')
2303 */
2304 trigger(eventName: string, options?: Partial<TriggerOptions & ObjectLike>): Chainable<Subject>
2305 /**
2306 * Trigger an event on a DOM element.
2307 * Custom events... If the following were `.triggerCustom`,
2308 * `.trigger` strongly typed with event data
2309 *
2310 * @see https://on.cypress.io/trigger
2311 * @example
2312 * cy.get('a').trigger('mousedown')
2313 */
2314 trigger(eventName: string, x: number, y: number, options?: Partial<TriggerOptions & ObjectLike>): Chainable<Subject>
2315
2316 /**
2317 * Type into a DOM element.
2318 *
2319 * @see https://on.cypress.io/type
2320 * @example
2321 * cy.get('input').type('Hello, World')
2322 * // type "hello" + press Enter
2323 * cy.get('input').type('hello{enter}')
2324 */
2325 type(text: string, options?: Partial<TypeOptions>): Chainable<Subject>
2326
2327 /**
2328 * Uncheck checkbox(es).
2329 *
2330 * @see https://on.cypress.io/uncheck
2331 * @example
2332 * // Unchecks checkbox element
2333 * cy.get('[type="checkbox"]').uncheck()
2334 * // Uncheck element with the id 'saveUserName'
2335 * cy.get('#saveUserName').uncheck()
2336 * // Uncheck all checkboxes
2337 * cy.get(':checkbox').uncheck()
2338 * // Uncheck the checkbox with the value of 'ga'
2339 * cy.get('input[type="checkbox"]').uncheck(['ga'])
2340 */
2341 uncheck(options?: Partial<CheckOptions>): Chainable<Subject>
2342 /**
2343 * Uncheck specific checkbox.
2344 *
2345 * @see https://on.cypress.io/uncheck
2346 * @example
2347 * // Uncheck the checkbox with the value of 'ga'
2348 * cy.get('input[type="checkbox"]').uncheck('ga')
2349 */
2350 uncheck(value: string, options?: Partial<CheckOptions>): Chainable<Subject>
2351 /**
2352 * Uncheck specific checkboxes.
2353 *
2354 * @see https://on.cypress.io/uncheck
2355 * @example
2356 * // Uncheck the checkbox with the value of 'ga', 'ma'
2357 * cy.get('input[type="checkbox"]').uncheck(['ga', 'ma'])
2358 */
2359 uncheck(values: string[], options?: Partial<CheckOptions>): Chainable<Subject>
2360
2361 /**
2362 * Get the current URL of the page that is currently active.
2363 *
2364 * @alias cy.location('href')
2365 * @see https://on.cypress.io/url
2366 */
2367 url(options?: Partial<UrlOptions>): Chainable<string>
2368
2369 /**
2370 * Control the size and orientation of the screen for your application.
2371 *
2372 * @see https://on.cypress.io/viewport
2373 * @example
2374 * // Set viewport to 550px x 750px
2375 * cy.viewport(550, 750)
2376 * // Set viewport to 357px x 667px
2377 * cy.viewport('iphone-6')
2378 */
2379 viewport(preset: ViewportPreset, orientation?: ViewportOrientation, options?: Partial<Loggable>): Chainable<null>
2380 /**
2381 * Set viewport to the given resolution.
2382 *
2383 * @see https://on.cypress.io/viewport
2384 * @example
2385 * // Set viewport to 550px x 750px
2386 * cy.viewport(550, 750)
2387 */
2388 viewport(width: number, height: number, options?: Partial<Loggable>): Chainable<null>
2389
2390 /**
2391 * Visit the given url
2392 *
2393 * @param {string} url The URL to visit. If relative uses `baseUrl`
2394 * @param {VisitOptions} [options] Pass in an options object to change the default behavior of `cy.visit()`
2395 * @see https://on.cypress.io/visit
2396 * @example
2397 * cy.visit('http://localhost:3000')
2398 * cy.visit('/somewhere') // opens ${baseUrl}/somewhere
2399 * cy.visit({
2400 * url: 'http://google.com',
2401 * method: 'POST'
2402 * })
2403 *
2404 */
2405 visit(url: string, options?: Partial<VisitOptions>): Chainable<AUTWindow>
2406 visit(options: Partial<VisitOptions> & { url: string }): Chainable<AUTWindow>
2407
2408 /**
2409 * Wait for a number of milliseconds.
2410 * You almost never need to wait for an arbitrary period of time.
2411 * There are always better ways to express this in Cypress, see the documentation.
2412 *
2413 * @see https://on.cypress.io/wait
2414 * @param {number} ms - Milliseconds to wait.
2415 * @example
2416 * cy.wait(1000) // wait for 1 second
2417 */
2418 wait(ms: number, options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
2419
2420 /**
2421 * Get the window object of the page that is currently active.
2422 *
2423 * @see https://on.cypress.io/window
2424 * @example
2425 ```
2426 cy.visit('http://localhost:8080/app')
2427 cy.window().then(function(win){
2428 // win is the remote window
2429 // of the page at: http://localhost:8080/app
2430 })
2431 ```
2432 */
2433 window(options?: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
2434
2435 /**
2436 * Scopes all subsequent cy commands to within this element.
2437 * Useful when working within a particular group of elements such as a `<form>`.
2438 * @see https://on.cypress.io/within
2439 * @example
2440 ```
2441 cy.get('form').within(($form) => {
2442 // cy.get() will only search for elements within form,
2443 // not within the entire document
2444 cy.get('input[name="username"]').type('john')
2445 cy.get('input[name="password"]').type('password')
2446 cy.root().submit()
2447 })
2448 ```
2449 */
2450 within(fn: (currentSubject: Subject) => void): Chainable<Subject>
2451 /**
2452 * Scopes all subsequent cy commands to within this element.
2453 * Useful when working within a particular group of elements such as a `<form>`.
2454 * @see https://on.cypress.io/within
2455 */
2456 within(options: Partial<Loggable>, fn: (currentSubject: Subject) => void): Chainable<Subject> // inconsistent argument order
2457
2458 /**
2459 * Yield the element passed into `.wrap()`.
2460 *
2461 * @see https://on.cypress.io/wrap
2462 * @example
2463 ```
2464 // wraps DOM element
2465 cy.get('form').within(($form) => {
2466 // more commands
2467 cy.wrap($form).should('have.class', 'form-container')
2468 })
2469 ```
2470 */
2471 wrap<E extends Node = HTMLElement>(element: E | JQuery<E>, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
2472 /**
2473 * Yield the element passed into `.wrap()` to the next command in the Cypress chain.
2474 *
2475 * @see https://on.cypress.io/wrap
2476 * @example
2477 ```
2478 cy.wrap(new Promise((resolve, reject) => {
2479 setTimeout(resolve, 1000);
2480 }).then(result => {})
2481 ```
2482 */
2483 wrap<F extends Promise<S>, S>(promise: F, options?: Partial<Loggable & Timeoutable>): Chainable<S>
2484 /**
2485 * Yields whatever is passed into `.wrap()` to the next command in the Cypress chain.
2486 *
2487 * @see https://on.cypress.io/wrap
2488 * @example
2489 ```
2490 // Make assertions about object
2491 cy.wrap({ amount: 10 })
2492 .should('have.property', 'amount')
2493 .and('eq', 10)
2494 ```
2495 */
2496 wrap<S>(object: S, options?: Partial<Loggable & Timeoutable>): Chainable<S>
2497
2498 /**
2499 * Write to a file with the specified contents.
2500 *
2501 * @see https://on.cypress.io/writefile
2502 ```
2503 cy.writeFile('path/to/message.txt', 'Hello World')
2504 ```
2505 */
2506 writeFile(filePath: string, contents: FileContents, encoding: Encodings): Chainable<null>
2507 /**
2508 * Write to a file with the specified encoding and contents.
2509 *
2510 * @see https://on.cypress.io/writefile
2511 ```
2512 cy.writeFile('path/to/ascii.txt', 'Hello World', {
2513 flag: 'a+',
2514 encoding: 'ascii'
2515 })
2516 ```
2517 */
2518 writeFile(filePath: string, contents: FileContents, options?: Partial<WriteFileOptions & Timeoutable>): Chainable<null>
2519 /**
2520 * Write to a file with the specified encoding and contents.
2521 *
2522 * An `encoding` option in `options` will override the `encoding` argument.
2523 *
2524 * @see https://on.cypress.io/writefile
2525 ```
2526 cy.writeFile('path/to/ascii.txt', 'Hello World', 'utf8', {
2527 flag: 'a+',
2528 })
2529 ```
2530 */
2531 writeFile(filePath: string, contents: FileContents, encoding: Encodings, options?: Partial<WriteFileOptions & Timeoutable>): Chainable<null>
2532
2533 /**
2534 * jQuery library bound to the AUT
2535 *
2536 * @see https://on.cypress.io/$
2537 * @example
2538 * cy.$$('p')
2539 */
2540 $$<TElement extends Element = HTMLElement>(selector: JQuery.Selector, context?: Element | Document | JQuery): JQuery<TElement>
2541 }
2542
2543 type ChainableMethods<Subject = any> = {
2544 [P in keyof Chainable<Subject>]: Chainable<Subject>[P] extends ((...args: any[]) => any)
2545 ? Chainable<Subject>[P]
2546 : never
2547 }
2548
2549 interface SinonSpyAgent<A extends sinon.SinonSpy> {
2550 log(shouldOutput?: boolean): Omit<A, 'withArgs'> & Agent<A>
2551
2552 /**
2553 * Saves current spy / stub under an alias.
2554 * @see https://on.cypress.io/stubs-spies-and-clocks
2555 * @see https://on.cypress.io/as
2556 * @example
2557 * cy.spy(win, 'fetch').as('winFetch') // Alias 'window.fetch' spy as "winFetch"
2558 */
2559 as(alias: string): Omit<A, 'withArgs'> & Agent<A>
2560
2561 /**
2562 * Creates a spy / stub but only for calls with given arguments.
2563 * @see https://on.cypress.io/stubs-spies-and-clocks
2564 * @see https://on.cypress.io/as
2565 * @example
2566 * const s = cy.stub(JSON, 'parse').withArgs('invalid').returns(42)
2567 * expect(JSON.parse('invalid')).to.equal(42)
2568 * expect(s).to.have.been.calledOnce
2569 */
2570 withArgs(...args: any[]): Omit<A, 'withArgs'> & Agent<A>
2571 }
2572
2573 type Agent<T extends sinon.SinonSpy> = SinonSpyAgent<T> & T
2574
2575 interface Failable {
2576 /**
2577 * Whether to fail on response codes other than 2xx and 3xx
2578 *
2579 * @default {true}
2580 */
2581 failOnStatusCode: boolean
2582
2583 /**
2584 * Whether Cypress should automatically retry status code errors under the hood
2585 *
2586 * @default {false}
2587 */
2588 retryOnStatusCodeFailure: boolean
2589
2590 /**
2591 * Whether Cypress should automatically retry transient network errors under the hood
2592 *
2593 * @default {true}
2594 */
2595 retryOnNetworkFailure: boolean
2596 }
2597
2598 /**
2599 * Options that control how a command behaves in the `within` scope.
2600 * These options will determine how nodes are selected.
2601 */
2602
2603 interface Withinable {
2604 /**
2605 * Element to search for children in. If null, search begins from root-level DOM element.
2606 *
2607 * @default depends on context, null if outside of within wrapper
2608 */
2609 withinSubject: JQuery | HTMLElement | null
2610 }
2611
2612 /**
2613 * Element traversal options for dealing with Shadow DOM
2614 */
2615 interface Shadow {
2616 /**
2617 * Include shadow DOM in search
2618 *
2619 * @default: false
2620 */
2621 includeShadowDom: boolean
2622 }
2623
2624 /**
2625 * Options that control how a command is logged in the Reporter
2626 */
2627 interface Loggable {
2628 /**
2629 * Displays the command in the Command Log
2630 *
2631 * @default true
2632 */
2633 log: boolean
2634 }
2635
2636 /**
2637 * Options that control how long Test Runner is waiting for command to succeed
2638 */
2639 interface Timeoutable {
2640 /**
2641 * Time to wait (ms)
2642 *
2643 * @default defaultCommandTimeout
2644 * @see https://on.cypress.io/configuration#Timeouts
2645 */
2646 timeout: number
2647 }
2648
2649 /**
2650 * Options that check case sensitivity
2651 */
2652 interface CaseMatchable {
2653 /**
2654 * Check case sensitivity
2655 *
2656 * @default true
2657 */
2658 matchCase: boolean
2659 }
2660
2661 /**
2662 * Options that control how long the Test Runner waits for an XHR request and response to succeed
2663 */
2664 interface TimeoutableXHR {
2665 /**
2666 * Time to wait for the request (ms)
2667 *
2668 * @default {@link Timeoutable#timeout}
2669 * @see https://on.cypress.io/configuration#Timeouts
2670 */
2671 requestTimeout: number
2672 /**
2673 * Time to wait for the response (ms)
2674 *
2675 * @default {@link Timeoutable#timeout}
2676 * @see https://on.cypress.io/configuration#Timeouts
2677 */
2678 responseTimeout: number
2679 }
2680
2681 /**
2682 * Options to force an event, skipping Actionability check
2683 * @see https://on.cypress.io/interacting-with-elements#Actionability
2684 */
2685 interface Forceable {
2686 /**
2687 * Forces the action, disables waiting for actionability
2688 *
2689 * @default false
2690 */
2691 force: boolean
2692 }
2693
2694 type experimentalCspAllowedDirectives = 'default-src' | 'child-src' | 'frame-src' | 'script-src' | 'script-src-elem' | 'form-action'
2695
2696 type scrollBehaviorOptions = false | 'center' | 'top' | 'bottom' | 'nearest'
2697
2698 /**
2699 * Options to affect Actionability checks
2700 * @see https://on.cypress.io/interacting-with-elements#Actionability
2701 */
2702 interface ActionableOptions extends Forceable {
2703 /**
2704 * Whether to wait for elements to finish animating before executing commands
2705 *
2706 * @default true
2707 */
2708 waitForAnimations: boolean
2709 /**
2710 * The distance in pixels an element must exceed over time to be considered animating
2711 *
2712 * @default 5
2713 */
2714 animationDistanceThreshold: number
2715 /**
2716 * Viewport position to which an element should be scrolled prior to action commands. Setting `false` disables scrolling.
2717 *
2718 * @default 'top'
2719 */
2720 scrollBehavior: scrollBehaviorOptions
2721 }
2722
2723 /**
2724 * Options to affect how an alias is stored
2725 *
2726 * @see https://on.cypress.io/as
2727 */
2728 interface AsOptions {
2729 /**
2730 * The type of alias to store, which impacts how the value is retrieved later in the test.
2731 * If an alias should be a 'query' (re-runs all queries leading up to the resulting value so it's alway up-to-date) or a
2732 * 'static' (read once when the alias is saved and is never updated). `type` has no effect when aliasing intercepts, spies, and stubs.
2733 *
2734 * @default 'query'
2735 */
2736 type: 'query' | 'static'
2737 }
2738
2739 interface BlurOptions extends Loggable, Timeoutable, Forceable { }
2740
2741 interface CheckOptions extends Loggable, Timeoutable, ActionableOptions {
2742 interval: number
2743 }
2744
2745 interface ClearOptions extends Loggable, Timeoutable, ActionableOptions {
2746 interval: number
2747 }
2748
2749 /**
2750 * Object to change the default behavior of .click().
2751 */
2752 interface ClickOptions extends Loggable, Timeoutable, ActionableOptions {
2753 /**
2754 * Serially click multiple elements
2755 *
2756 * @default false
2757 */
2758 multiple: boolean
2759 /**
2760 * Activates the control key during click
2761 *
2762 * @default false
2763 */
2764 ctrlKey: boolean
2765 /**
2766 * Activates the control key during click
2767 *
2768 * @default false
2769 */
2770 controlKey: boolean
2771 /**
2772 * Activates the alt key (option key for Mac) during click
2773 *
2774 * @default false
2775 */
2776 altKey: boolean
2777 /**
2778 * Activates the alt key (option key for Mac) during click
2779 *
2780 * @default false
2781 */
2782 optionKey: boolean
2783 /**
2784 * Activates the shift key during click
2785 *
2786 * @default false
2787 */
2788 shiftKey: boolean
2789 /**
2790 * Activates the meta key (Windows key or command key for Mac) during click
2791 *
2792 * @default false
2793 */
2794 metaKey: boolean
2795 /**
2796 * Activates the meta key (Windows key or command key for Mac) during click
2797 *
2798 * @default false
2799 */
2800 commandKey: boolean
2801 /**
2802 * Activates the meta key (Windows key or command key for Mac) during click
2803 *
2804 * @default false
2805 */
2806 cmdKey: boolean
2807 }
2808
2809 interface CookieOptions extends Partial<Loggable & Timeoutable> {
2810 /**
2811 * Domain to set cookies on or get cookies from
2812 * @default hostname of the current app under test
2813 */
2814 domain?: string
2815 }
2816
2817 interface PEMCert {
2818 /**
2819 * Path to the certificate file, relative to project root.
2820 */
2821 cert: string
2822 /**
2823 * Path to the private key file, relative to project root.
2824 */
2825 key: string
2826 /**
2827 * Path to a text file containing the passphrase, relative to project root.
2828 */
2829 passphrase?: string
2830 }
2831
2832 interface PFXCert {
2833 /**
2834 * Path to the certificate container, relative to project root.
2835 */
2836 pfx: string
2837 /**
2838 * Path to a text file containing the passphrase, relative to project root.
2839 */
2840 passphrase?: string
2841 }
2842
2843 interface ClientCertificate {
2844 /**
2845 * URL to match requests against. Wildcards following [minimatch](https://github.com/isaacs/minimatch) rules are supported.
2846 */
2847 url: string
2848 /**
2849 * Paths to one or more CA files to validate certs against, relative to project root.
2850 */
2851 ca?: string[]
2852 /**
2853 * A PEM format certificate/private key pair or PFX certificate container
2854 */
2855 certs: PEMCert[] | PFXCert[]
2856 }
2857
2858 type RetryStrategyWithModeSpecs = RetryStrategy & {
2859 openMode: boolean; // defaults to false
2860 runMode: boolean; // defaults to true
2861 }
2862
2863 type RetryStrategy =
2864 | RetryStrategyDetectFlakeAndPassOnThresholdType
2865 | RetryStrategyDetectFlakeButAlwaysFailType
2866
2867 interface RetryStrategyDetectFlakeAndPassOnThresholdType {
2868 experimentalStrategy: "detect-flake-and-pass-on-threshold"
2869 experimentalOptions?: {
2870 maxRetries: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0
2871 passesRequired: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0 and <= maxRetries
2872 }
2873 }
2874
2875 interface RetryStrategyDetectFlakeButAlwaysFailType {
2876 experimentalStrategy: "detect-flake-but-always-fail"
2877 experimentalOptions?: {
2878 maxRetries: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0
2879 stopIfAnyPassed: boolean; // defaults to false if experimentalOptions is not provided
2880 }
2881 }
2882 interface ResolvedConfigOptions<ComponentDevServerOpts = any> {
2883 /**
2884 * Url used as prefix for [cy.visit()](https://on.cypress.io/visit) or [cy.request()](https://on.cypress.io/request) command's url
2885 * @default null
2886 */
2887 baseUrl: string | null
2888 /**
2889 * Any values to be set as [environment variables](https://on.cypress.io/environment-variables)
2890 * @default {}
2891 */
2892 env: { [key: string]: any }
2893 /**
2894 * 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.
2895 * @default "*.hot-update.js"
2896 */
2897 excludeSpecPattern: string | string[]
2898 /**
2899 * 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.
2900 * @default 50
2901 */
2902 numTestsKeptInMemory: number
2903 /**
2904 * Port used to host Cypress. Normally this is a randomly generated port
2905 * @default null
2906 */
2907 port: number | null
2908 /**
2909 * The [reporter](https://on.cypress.io/reporters) used when running headlessly or in CI
2910 * @default "spec"
2911 */
2912 reporter: string
2913 /**
2914 * Some reporters accept [reporterOptions](https://on.cypress.io/reporters) that customize their behavior
2915 * @default "spec"
2916 */
2917 reporterOptions: { [key: string]: any }
2918 /**
2919 * Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold.
2920 * @default 10000
2921 */
2922 slowTestThreshold: number
2923 /**
2924 * Whether Cypress will watch and restart tests on test file changes
2925 * @default true
2926 */
2927 watchForFileChanges: boolean
2928 /**
2929 * Time, in milliseconds, to wait until most DOM based commands are considered timed out
2930 * @default 4000
2931 */
2932 defaultCommandTimeout: number
2933 /**
2934 * Time, in milliseconds, to wait for a system command to finish executing during a [cy.exec()](https://on.cypress.io/exec) command
2935 * @default 60000
2936 */
2937 execTimeout: number
2938 /**
2939 * Time, in milliseconds, to wait for page transition events or [cy.visit()](https://on.cypress.io/visit), [cy.go()](https://on.cypress.io/go), [cy.reload()](https://on.cypress.io/reload) commands to fire their page load events
2940 * @default 60000
2941 */
2942 pageLoadTimeout: number
2943 /**
2944 * Whether Cypress will search for and replace
2945 * obstructive JS code in .js or .html files.
2946 *
2947 * @see https://on.cypress.io/configuration#modifyObstructiveCode
2948 */
2949 modifyObstructiveCode: boolean
2950 /**
2951 * Time, in milliseconds, to wait for an XHR request to go out in a [cy.wait()](https://on.cypress.io/wait) command
2952 * @default 5000
2953 */
2954 requestTimeout: number
2955 /**
2956 * Time, in milliseconds, to wait until a response in a [cy.request()](https://on.cypress.io/request), [cy.wait()](https://on.cypress.io/wait), [cy.fixture()](https://on.cypress.io/fixture), [cy.getCookie()](https://on.cypress.io/getcookie), [cy.getCookies()](https://on.cypress.io/getcookies), [cy.setCookie()](https://on.cypress.io/setcookie), [cy.clearCookie()](https://on.cypress.io/clearcookie), [cy.clearCookies()](https://on.cypress.io/clearcookies), and [cy.screenshot()](https://on.cypress.io/screenshot) commands
2957 * @default 30000
2958 */
2959 responseTimeout: number
2960 /**
2961 * Time, in milliseconds, to wait for a task to finish executing during a cy.task() command
2962 * @default 60000
2963 */
2964 taskTimeout: number
2965 /**
2966 * Path to folder where application files will attempt to be served from
2967 * @default root project folder
2968 */
2969 fileServerFolder: string
2970 /**
2971 * Path to folder containing fixture files (Pass false to disable)
2972 * @default "cypress/fixtures"
2973 */
2974 fixturesFolder: string | false
2975 /**
2976 * Path to folder where files downloaded during a test are saved
2977 * @default "cypress/downloads"
2978 */
2979 downloadsFolder: string
2980 /**
2981 * The application under test cannot redirect more than this limit.
2982 * @default 20
2983 */
2984 redirectionLimit: number
2985 /**
2986 * If a `node` executable is found, this will be the full filesystem path to that executable.
2987 * @default null
2988 */
2989 resolvedNodePath: string
2990 /**
2991 * The version of `node` that is being used to execute plugins.
2992 * @example 1.2.3
2993 */
2994 resolvedNodeVersion: string
2995 /**
2996 * Whether Cypress will take a screenshot when a test fails during cypress run.
2997 * @default true
2998 */
2999 screenshotOnRunFailure: boolean
3000 /**
3001 * 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
3002 * @default "cypress/screenshots"
3003 */
3004 screenshotsFolder: string | false
3005 /**
3006 * Path to file to load before test files load. This file is compiled and bundled. (Pass false to disable)
3007 * @default "cypress/support/{e2e|component}.js"
3008 */
3009 supportFile: string | false
3010 /**
3011 * The test isolation ensures a clean browser context between tests.
3012 *
3013 * Cypress will always reset/clear aliases, intercepts, clock, and viewport before each test
3014 * to ensure a clean test slate; i.e. this configuration only impacts the browser context.
3015 *
3016 * Note: the [`cy.session()`](https://on.cypress.io/session) command will inherent this value to determine whether
3017 * or not the page is cleared when the command executes. This command is only available in end-to-end testing.
3018 *
3019 * - true - The page is cleared before each test. Cookies, local storage and session storage in all domains are cleared
3020 * before each test. The `cy.session()` command will also clear the page and current browser context when creating
3021 * or restoring the browser session.
3022 * - false - The current browser state will persist between tests. The page does not clear before the test and cookies, local
3023 * storage and session storage will be available in the next test. The `cy.session()` command will only clear the
3024 * current browser context when creating or restoring the browser session - the current page will not clear.
3025 *
3026 * Tradeoffs:
3027 * Turning test isolation off may improve performance of end-to-end tests, however, previous tests could impact the
3028 * browser state of the next test and cause inconsistency when using .only(). Be mindful to write isolated tests when
3029 * test isolation is false. If a test in the suite impacts the state of other tests and it were to fail, you could see
3030 * misleading errors in later tests which makes debugging clunky. See the [documentation](https://on.cypress.io/test-isolation)
3031 * for more information.
3032 *
3033 * @default true
3034 */
3035 testIsolation: boolean
3036 /**
3037 * Path to folder where videos will be saved after a headless or CI run
3038 * @default "cypress/videos"
3039 */
3040 videosFolder: string
3041 /**
3042 * Whether Cypress will trash assets within the screenshotsFolder and videosFolder before headless test runs.
3043 * @default true
3044 */
3045 trashAssetsBeforeRuns: boolean
3046 /**
3047 * The quality setting for the video compression, in Constant Rate Factor (CRF).
3048 * Enable compression by passing true to use the default CRF of 32.
3049 * Compress at custom CRF by passing a number between 1 and 51, where a lower value results in better quality (at the expense of a higher file size).
3050 * Disable compression by passing false or 0.
3051 * @default 32
3052 */
3053 videoCompression: number | boolean
3054 /**
3055 * Whether Cypress will record a video of the test run when executing in run mode.
3056 * @default false
3057 */
3058 video: boolean
3059 /**
3060 * Whether Chrome Web Security for same-origin policy and insecure mixed content is enabled. Read more about this [here](https://on.cypress.io/web-security#Disabling-Web-Security)
3061 * @default true
3062 */
3063 chromeWebSecurity: boolean
3064 /**
3065 * Default height in pixels for the application under tests' viewport (Override with [cy.viewport()](https://on.cypress.io/viewport) command)
3066 * @default 660
3067 */
3068 viewportHeight: number
3069 /**
3070 * Default width in pixels for the application under tests' viewport. (Override with [cy.viewport()](https://on.cypress.io/viewport) command)
3071 * @default 1000
3072 */
3073 viewportWidth: number
3074 /**
3075 * The distance in pixels an element must exceed over time to be considered animating
3076 * @default 5
3077 */
3078 animationDistanceThreshold: number
3079 /**
3080 * Whether to wait for elements to finish animating before executing commands
3081 * @default true
3082 */
3083 waitForAnimations: boolean
3084 /**
3085 * Viewport position to which an element should be scrolled prior to action commands. Setting `false` disables scrolling.
3086 * @default 'top'
3087 */
3088 scrollBehavior: scrollBehaviorOptions
3089 /**
3090 * Indicates whether Cypress should allow CSP header directives from the application under test.
3091 * - When this option is set to `false`, Cypress will strip the entire CSP header.
3092 * - When this option is set to `true`, Cypress will only to strip directives that would interfere
3093 * with or inhibit Cypress functionality.
3094 * - When this option to an array of allowable directives (`[ 'default-src', ... ]`), the directives
3095 * specified will remain in the response headers.
3096 *
3097 * Please see the documentation for more information.
3098 * @see https://on.cypress.io/experiments#Experimental-CSP-Allow-List
3099 * @default false
3100 */
3101 experimentalCspAllowList: boolean | experimentalCspAllowedDirectives[],
3102 /**
3103 * Allows listening to the `before:run`, `after:run`, `before:spec`, and `after:spec` events in the plugins file during interactive mode.
3104 * @default false
3105 */
3106 experimentalInteractiveRunEvents: boolean
3107 /**
3108 * Whether Cypress will search for and replace obstructive code in third party .js or .html files.
3109 * NOTE: Setting this flag to true removes Subresource Integrity (SRI).
3110 * Please see https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity.
3111 * This option has no impact on experimentalSourceRewriting and is only used with the
3112 * non-experimental source rewriter.
3113 * @see https://on.cypress.io/experiments#Configuration
3114 */
3115 experimentalModifyObstructiveThirdPartyCode: boolean
3116 /**
3117 * Disables setting document.domain to the applications super domain on injection.
3118 * This experiment is to be used for sites that do not work with setting document.domain
3119 * due to cross-origin issues. Enabling this option no longer allows for default subdomain
3120 * navigations, and will require the use of cy.origin(). This option takes an array of
3121 * strings/string globs.
3122 * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/domain
3123 * @see https://on.cypress.io/experiments#Experimental-Skip-Domain-Injection
3124 * @default null
3125 */
3126 experimentalSkipDomainInjection: string[] | null
3127 /**
3128 * Allows for just-in-time compiling of a component test, which will only compile assets related to the component.
3129 * This results in a smaller bundle under test, reducing resource constraints on a given machine. This option is recommended
3130 * for users with large component testing projects and those who are running into webpack 'chunk load error' issues.
3131 * Supported for vite and webpack. For component testing only.
3132 * @see https://on.cypress.io/experiments#Configuration
3133 */
3134 experimentalJustInTimeCompile: boolean
3135 /**
3136 * Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.
3137 * @default false
3138 */
3139 experimentalSourceRewriting: boolean
3140 /**
3141 * Generate and save commands directly to your test suite by interacting with your app as an end user would.
3142 * @default false
3143 */
3144 experimentalStudio: boolean
3145 /**
3146 * Adds support for testing in the WebKit browser engine used by Safari. See https://on.cypress.io/webkit-experiment for more information.
3147 * @default false
3148 */
3149 experimentalWebKitSupport: boolean
3150 /**
3151 * Enables support for improved memory management within Chromium-based browsers.
3152 * @default false
3153 */
3154 experimentalMemoryManagement: boolean
3155 /**
3156 * Number of times to retry a failed test.
3157 * If a number is set, tests will retry in both runMode and openMode.
3158 * To enable test retries only in runMode, set e.g. `{ openMode: null, runMode: 2 }`
3159 * @default null
3160 */
3161 retries: Nullable<number | ({ runMode?: Nullable<number>, openMode?: Nullable<number> }) | RetryStrategyWithModeSpecs>
3162 /**
3163 * Enables including elements within the shadow DOM when using querying
3164 * commands (e.g. cy.get(), cy.find()). Can be set globally in cypress.config.{js,ts,mjs,cjs},
3165 * per-suite or per-test in the test configuration object, or programmatically
3166 * with Cypress.config()
3167 * @default false
3168 */
3169 includeShadowDom: boolean
3170
3171 /**
3172 * The list of hosts to be blocked
3173 */
3174 blockHosts: null | string | string[]
3175 /**
3176 * A unique ID for the project used for recording
3177 */
3178 projectId: null | string
3179 /**
3180 * Path to the support folder.
3181 */
3182 supportFolder: string
3183 /**
3184 * Glob pattern to determine what test files to load.
3185 */
3186 specPattern: string | string[]
3187 /**
3188 * The user agent the browser sends in all request headers.
3189 */
3190 userAgent: null | string
3191 /**
3192 * Polyfills `window.fetch` to enable Network spying and stubbing
3193 */
3194 experimentalFetchPolyfill: boolean
3195
3196 /**
3197 * Override default config options for Component Testing runner.
3198 * @default {}
3199 */
3200 component: ComponentConfigOptions<ComponentDevServerOpts>
3201
3202 /**
3203 * Override default config options for E2E Testing runner.
3204 * @default {}
3205 */
3206 e2e: EndToEndConfigOptions
3207
3208 /**
3209 * An array of objects defining the certificates
3210 */
3211 clientCertificates: ClientCertificate[]
3212
3213 /**
3214 * Handle Cypress plugins
3215 */
3216 setupNodeEvents: (on: PluginEvents, config: PluginConfigOptions) => Promise<PluginConfigOptions | void> | PluginConfigOptions | void
3217
3218 indexHtmlFile: string
3219
3220 /**
3221 * The default browser to launch if the "--browser" command line option is not provided.
3222 */
3223 defaultBrowser: string
3224 }
3225
3226 interface EndToEndConfigOptions extends Omit<CoreConfigOptions, 'indexHtmlFile'> {
3227 /**
3228 * Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially.
3229 * @default false
3230 */
3231 experimentalRunAllSpecs?: boolean
3232 /**
3233 * Enables support for `Cypress.require()` for including dependencies within the `cy.origin()` callback.
3234 * @default false
3235 */
3236 experimentalOriginDependencies?: boolean
3237 }
3238
3239 /**
3240 * Options appended to config object on runtime.
3241 */
3242 interface RuntimeConfigOptions extends Partial<RuntimeServerConfigOptions> {
3243 /**
3244 * Absolute path to the config file (default: <projectRoot>/cypress.config.{js,ts,mjs,cjs})
3245 */
3246 configFile: string
3247 /**
3248 * CPU architecture, from Node `os.arch()`
3249 *
3250 * @see https://nodejs.org/api/os.html#os_os_arch
3251 */
3252 arch: string
3253 /**
3254 * Available browsers found on your system.
3255 */
3256 browsers: Browser[]
3257 /**
3258 * Hosts mappings to IP addresses.
3259 */
3260 hosts: null | { [key: string]: string }
3261 /**
3262 * Whether Cypress was launched via 'cypress open' (interactive mode)
3263 */
3264 isInteractive: boolean
3265 /**
3266 * The platform Cypress is running on.
3267 */
3268 platform: 'linux' | 'darwin' | 'win32'
3269 remote: RemoteState
3270 /**
3271 * The Cypress version being used.
3272 */
3273 version: string
3274
3275 // Internal or Unlisted at server/lib/config_options
3276 namespace: string
3277 projectRoot: string
3278 repoRoot: string | null
3279 devServerPublicPathRoute: string
3280 cypressBinaryRoot: string
3281 }
3282
3283 /**
3284 * Optional options added before the server starts
3285 */
3286 interface RuntimeServerConfigOptions {
3287 /**
3288 * The browser Cypress is running on.
3289 */
3290 browser: Browser
3291 // Internal or Unlisted at server/lib/config_options
3292 autoOpen: boolean
3293 browserUrl: string
3294 clientRoute: string
3295 cypressEnv: string
3296 isNewProject: boolean
3297 isTextTerminal: boolean
3298 morgan: boolean
3299 parentTestsFolder: string
3300 parentTestsFolderDisplay: string
3301 projectName: string
3302 proxyUrl: string
3303 remote: RemoteState
3304 report: boolean
3305 reporterRoute: string
3306 reporterUrl: string
3307 socketId: null | string
3308 socketIoCookie: string
3309 socketIoRoute: string
3310 spec: Cypress['spec'] | null
3311 specs: Array<Cypress['spec']>
3312 protocolEnabled: boolean
3313 hideCommandLog: boolean
3314 hideRunnerUi: boolean
3315 }
3316
3317 interface SuiteConfigOverrides extends Partial<
3318 Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>
3319 >, Partial<Pick<ResolvedConfigOptions, 'baseUrl' | 'testIsolation'>> {
3320 browser?: IsBrowserMatcher | IsBrowserMatcher[]
3321 keystrokeDelay?: number
3322 }
3323
3324 interface TestConfigOverrides extends Partial<
3325 Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>
3326 >, Partial<Pick<ResolvedConfigOptions, 'baseUrl'>> {
3327 browser?: IsBrowserMatcher | IsBrowserMatcher[]
3328 keystrokeDelay?: number
3329 }
3330
3331 /**
3332 * All configuration items are optional.
3333 */
3334 type CoreConfigOptions = Partial<Omit<ResolvedConfigOptions, TestingType>>
3335
3336 interface DefineDevServerConfig {
3337 // This interface can be extended by the user, to inject the types for their
3338 // preferred bundler: e.g.
3339 //
3340 // import type * as webpack from 'webpack'
3341 //
3342 // declare global {
3343 // namespace Cypress {
3344 // interface DefineDevServerConfig {
3345 // webpackConfig?: webpack.Configuration
3346 // }
3347 // }
3348 // }
3349 [key: string]: any
3350 }
3351
3352 type PickConfigOpt<T> = T extends keyof DefineDevServerConfig ? DefineDevServerConfig[T] : any
3353
3354 interface DependencyToInstall {
3355 dependency: CypressComponentDependency
3356 satisfied: boolean
3357 detectedVersion: string | null
3358 }
3359
3360 interface CypressComponentDependency {
3361 /**
3362 * Unique identifier.
3363 * @example 'reactscripts'
3364 */
3365 type: string
3366
3367 /**
3368 * Name to display in the user interface.
3369 * @example "React Scripts"
3370 */
3371 name: string
3372
3373 /**
3374 * Package name on npm.
3375 * @example react-scripts
3376 */
3377 package: string
3378
3379 /**
3380 * Code to run when installing. Version is optional.
3381 *
3382 * Should be <package_name>@<version>.
3383 *
3384 * @example `react`
3385 * @example `react@18`
3386 * @example `react-scripts`
3387 */
3388 installer: string
3389
3390 /**
3391 * Description shown in UI. It is recommended to use the same one the package uses on npm.
3392 * @example 'Create React apps with no build configuration'
3393 */
3394 description: string
3395
3396 /**
3397 * Minimum version supported. Should conform to Semantic Versioning as used in `package.json`.
3398 * @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#dependencies
3399 * @example '^=4.0.0 || ^=5.0.0'
3400 * @example '^2.0.0'
3401 */
3402 minVersion: string
3403 }
3404
3405 interface ResolvedComponentFrameworkDefinition {
3406 /**
3407 * A semantic, unique identifier.
3408 * Must begin with `cypress-ct-` or `@org/cypress-ct-` for third party implementations.
3409 * @example 'reactscripts'
3410 * @example 'nextjs'
3411 * @example 'cypress-ct-solid-js'
3412 */
3413 type: string
3414
3415 /**
3416 * Used as the flag for `getPreset` for meta framworks, such as finding the webpack config for CRA, Angular, etc.
3417 * It is also the name of the string added to `cypress.config`
3418 *
3419 * @example
3420 * export default {
3421 * component: {
3422 * devServer: {
3423 * framework: 'create-react-app' // can be 'next', 'create-react-app', etc etc.
3424 * }
3425 * }
3426 * }
3427 */
3428 configFramework: string
3429
3430 /**
3431 * Library (React, Vue) or template (aka "meta framework") (CRA, Next.js, Angular)
3432 */
3433 category: 'library' | 'template'
3434
3435 /**
3436 * Name displayed in Launchpad when doing initial setup.
3437 * @example 'Solid.js'
3438 * @example 'Create React App'
3439 */
3440 name: string
3441
3442 /**
3443 * Supported bundlers.
3444 */
3445 supportedBundlers: Array<'webpack' | 'vite'>
3446
3447 /**
3448 * Used to attempt to automatically select the correct framework/bundler from the dropdown.
3449 *
3450 * @example
3451 * const SOLID_DETECTOR: Dependency = {
3452 * type: 'solid',
3453 * name: 'Solid.js',
3454 * package: 'solid-js',
3455 * installer: 'solid-js',
3456 * description: 'Solid is a declarative JavaScript library for creating user interfaces',
3457 * minVersion: '^1.0.0',
3458 * }
3459 */
3460 detectors: CypressComponentDependency[]
3461
3462 /**
3463 * Array of required dependencies. This could be the bundler and JavaScript library.
3464 */
3465 dependencies: (bundler: 'webpack' | 'vite', projectPath: string) => Promise<DependencyToInstall[]>
3466
3467 /**
3468 * This is used interally by Cypress for the "Create From Component" feature.
3469 */
3470 codeGenFramework?: 'react' | 'vue' | 'svelte' | 'angular'
3471
3472 /**
3473 * This is used interally by Cypress for the "Create From Component" feature.
3474 * @example '*.{js,jsx,tsx}'
3475 */
3476 glob?: string
3477
3478 /**
3479 * This is the path to get mount, eg `import { mount } from <mount_module>,
3480 * @example: `cypress-ct-solidjs/src/mount`
3481 */
3482 mountModule: (projectPath: string) => Promise<string>
3483
3484 /**
3485 * Support status. Internally alpha | beta | full.
3486 * Community integrations are "community".
3487 */
3488 supportStatus: 'alpha' | 'beta' | 'full' | 'community'
3489
3490 /**
3491 * Function returning string for used for the component-index.html file.
3492 * Cypress provides a default if one isn't specified for third party integrations.
3493 */
3494 componentIndexHtml?: () => string
3495
3496 /**
3497 * Used for the Create From Component feature.
3498 * This is currently not supported for third party frameworks.
3499 */
3500 specPattern?: '**/*.cy.ts'
3501 }
3502
3503 type ComponentFrameworkDefinition = Omit<ResolvedComponentFrameworkDefinition, 'dependencies'> & {
3504 dependencies: (bundler: 'webpack' | 'vite') => CypressComponentDependency[]
3505 }
3506
3507 /**
3508 * Certain properties are not supported for third party frameworks right now,
3509 * such as ones related to the "Create From" feature. This is a subset of
3510 * properties that are exposed for public usage.
3511 */
3512
3513 type ThirdPartyComponentFrameworkDefinition = Pick<ComponentFrameworkDefinition, 'type' | 'name' | 'supportedBundlers' | 'detectors' | 'dependencies'> & {
3514 /**
3515 * @example `cypress-ct-${string} for third parties. Any string is valid internally.
3516 */
3517 type: string
3518
3519 /**
3520 * Raw SVG icon that will be displayed in the Project Setup Wizard. Used for third parties that
3521 * want to render a custom icon.
3522 */
3523 icon?: string
3524 }
3525
3526 interface AngularDevServerProjectConfig {
3527 root: string
3528 sourceRoot: string
3529 buildOptions: Record<string, any>
3530 }
3531
3532 type DevServerFn<ComponentDevServerOpts = any> = (cypressDevServerConfig: DevServerConfig, devServerConfig: ComponentDevServerOpts) => ResolvedDevServerConfig | Promise<ResolvedDevServerConfig>
3533
3534 type ConfigHandler<T> = T
3535 | (() => T | Promise<T>)
3536
3537 type DevServerConfigOptions = {
3538 bundler: 'webpack'
3539 framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app' | 'next' | 'svelte'
3540 webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>
3541 } | {
3542 bundler: 'vite'
3543 framework: 'react' | 'vue' | 'svelte'
3544 viteConfig?: ConfigHandler<Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>>
3545 } | {
3546 bundler: 'webpack'
3547 framework: 'angular'
3548 webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>
3549 options?: {
3550 projectConfig: AngularDevServerProjectConfig
3551 }
3552 }
3553
3554 interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalStudio'> {
3555 devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
3556 devServerConfig?: ComponentDevServerOpts
3557 /**
3558 * Runs all component specs in a single tab, trading spec isolation for faster run mode execution.
3559 * @default false
3560 */
3561 experimentalSingleTabRunMode?: boolean
3562 }
3563
3564 /**
3565 * Config options that can be assigned on cypress.config.{js,ts,mjs,cjs} file
3566 */
3567 type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern' | 'indexHtmlFile'>
3568
3569 /**
3570 * Takes ComponentDevServerOpts to track the signature of the devServerConfig for the provided `devServer`,
3571 * so we have proper completion for `devServerConfig`
3572 */
3573 type ConfigOptions<ComponentDevServerOpts = any> = Partial<UserConfigOptions<ComponentDevServerOpts>> & {
3574 /**
3575 * Hosts mappings to IP addresses.
3576 */
3577 hosts?: null | { [key: string]: string }
3578 }
3579
3580 interface PluginConfigOptions extends ResolvedConfigOptions, RuntimeConfigOptions {
3581 /**
3582 * Absolute path to the root of the project
3583 */
3584 projectRoot: string
3585 /**
3586 * Type of test and associated runner that was launched.
3587 */
3588 testingType: TestingType
3589 /**
3590 * Cypress version.
3591 */
3592 version: string
3593 }
3594
3595 interface DebugOptions {
3596 verbose: boolean
3597 }
3598
3599 /**
3600 * Options object to change the default behavior of cy.exec().
3601 */
3602 interface ExecOptions extends Loggable, Timeoutable {
3603 /**
3604 * Whether to fail if the command exits with a non-zero code
3605 *
3606 * @default true
3607 */
3608 failOnNonZeroExit: boolean
3609 /**
3610 * Object of environment variables to set before the command executes
3611 * (e.g. {USERNAME: 'johndoe'}). Will be merged with existing
3612 * system environment variables
3613 *
3614 * @default {}
3615 */
3616 env: object
3617 }
3618
3619 /**
3620 * Options for Cypress.Keyboard.defaults()
3621 */
3622 interface KeyboardDefaultsOptions {
3623 /**
3624 * Time, in milliseconds, between each keystroke when typing. (Pass 0 to disable)
3625 *
3626 * @default 10
3627 */
3628 keystrokeDelay: number
3629 }
3630
3631 /**
3632 * Full set of possible options for cy.request call
3633 */
3634 interface RequestOptions extends Loggable, Timeoutable, Failable {
3635 auth: object
3636 body: RequestBody
3637 encoding: Encodings
3638 followRedirect: boolean
3639 form: boolean
3640 gzip: boolean
3641 headers: object
3642 method: HttpMethod
3643 qs: object
3644 url: string
3645 }
3646
3647 interface RouteOptions {
3648 method: HttpMethod
3649 url: string | RegExp
3650 response: any
3651 status: number
3652 delay: number
3653 headers: object | null
3654 force404: boolean
3655 onRequest(...args: any[]): void
3656 onResponse(...args: any[]): void
3657 onAbort(...args: any[]): void
3658 }
3659
3660 interface Dimensions {
3661 x: number
3662 y: number
3663 width: number
3664 height: number
3665 }
3666
3667 type Padding =
3668 | number
3669 | [number]
3670 | [number, number]
3671 | [number, number, number]
3672 | [number, number, number, number]
3673
3674 interface ScreenshotOptions {
3675 blackout: string[]
3676 capture: 'runner' | 'viewport' | 'fullPage'
3677 clip: Dimensions
3678 disableTimersAndAnimations: boolean
3679 padding: Padding
3680 scale: boolean
3681 overwrite: boolean
3682 onBeforeScreenshot: ($el: JQuery) => void
3683 onAfterScreenshot: ($el: JQuery, props: {
3684 path: string
3685 size: number
3686 dimensions: {
3687 width: number
3688 height: number
3689 }
3690 multipart: boolean
3691 pixelRatio: number
3692 takenAt: string
3693 name: string
3694 blackout: string[]
3695 duration: number
3696 testAttemptIndex: number
3697 }) => void
3698 }
3699
3700 interface ScreenshotDefaultsOptions extends ScreenshotOptions {
3701 screenshotOnRunFailure: boolean
3702 }
3703
3704 interface SelectorPlaygroundDefaultsOptions {
3705 selectorPriority: string[]
3706 onElement: ($el: JQuery) => string | null | undefined
3707 }
3708
3709 interface ScrollToOptions extends Loggable, Timeoutable {
3710 /**
3711 * Scrolls over the duration (in ms)
3712 *
3713 * @default 0
3714 */
3715 duration: number
3716 /**
3717 * Will scroll with the easing animation
3718 *
3719 * @default 'swing'
3720 */
3721 easing: 'swing' | 'linear'
3722 /**
3723 * Ensure element is scrollable. Error if element is not scrollable
3724 *
3725 * @default true
3726 */
3727 ensureScrollable: boolean
3728 }
3729
3730 interface ScrollIntoViewOptions extends ScrollToOptions {
3731 /**
3732 * Amount to scroll after the element has been scrolled into view
3733 *
3734 * @default {top: 0, left: 0}
3735 */
3736 offset: Offset
3737 }
3738
3739 interface SelectOptions extends Loggable, Timeoutable, Forceable {
3740 interval: number
3741 }
3742
3743 interface Session {
3744 /**
3745 * Clear all sessions saved on the backend, including cached global sessions.
3746 */
3747 clearAllSavedSessions: () => Promise<void>
3748 /**
3749 * Clear all storage and cookie data across all origins associated with the current session.
3750 */
3751 clearCurrentSessionData: () => Promise<void>
3752 /**
3753 * Get all storage and cookie data across all origins associated with the current session.
3754 */
3755 getCurrentSessionData: () => Promise<SessionData>
3756 /**
3757 * Get all storage and cookie data saved on the backend associated with the provided session id.
3758 */
3759 getSession: (id: string) => Promise<ServerSessionData>
3760 }
3761
3762 type ActiveSessions = Record<string, SessionData>
3763
3764 interface SessionData {
3765 id: string
3766 hydrated: boolean
3767 cacheAcrossSpecs: SessionOptions['cacheAcrossSpecs']
3768 cookies?: Cookie[] | null
3769 localStorage?: OriginStorage[] | null
3770 sessionStorage?: OriginStorage[] | null
3771 setup: () => void
3772 validate?: SessionOptions['validate']
3773 }
3774
3775 interface ServerSessionData extends Omit<SessionData, 'setup' | 'validate'> {
3776 setup: string
3777 validate?: string
3778 }
3779
3780 interface SessionOptions {
3781 /**
3782 * Whether or not to persist the session across all specs in the run.
3783 * @default {false}
3784 */
3785 cacheAcrossSpecs?: boolean
3786 /**
3787 * Function to run immediately after the session is created and `setup` function runs or
3788 * after a session is restored and the page is cleared. If this returns `false`, throws an
3789 * exception, returns a Promise which resolves to `false` or rejects or contains any failing
3790 * Cypress command, the session is considered invalid.
3791 *
3792 * If validation fails immediately after `setup`, the test will fail.
3793 * If validation fails after restoring a session, `setup` will re-run.
3794 * @default {false}
3795 */
3796 validate?: () => Promise<false | void> | void
3797 }
3798
3799 type SameSiteStatus = 'no_restriction' | 'strict' | 'lax'
3800
3801 interface SelectFileOptions extends Loggable, Timeoutable, ActionableOptions {
3802 /**
3803 * Which user action to perform. `select` matches selecting a file while
3804 * `drag-drop` matches dragging files from the operating system into the
3805 * document.
3806 *
3807 * @default 'select'
3808 */
3809 action: 'select' | 'drag-drop'
3810 }
3811
3812 /**
3813 * Options that control how the `cy.setCookie` command
3814 * sets the cookie in the browser.
3815 * @see https://on.cypress.io/setcookie#Arguments
3816 */
3817 interface SetCookieOptions extends Loggable, Timeoutable {
3818 /**
3819 * The path of the cookie.
3820 * @default "/"
3821 */
3822 path: string
3823 /**
3824 * Represents the domain the cookie belongs to (e.g. "docs.cypress.io", "github.com").
3825 * @default location.hostname
3826 */
3827 domain: string
3828 /**
3829 * Whether a cookie's scope is limited to secure channels, such as HTTPS.
3830 * @default false
3831 */
3832 secure: boolean
3833 /**
3834 * Whether or not the cookie is HttpOnly, meaning the cookie is inaccessible to client-side scripts.
3835 * The Cypress cookie API has access to HttpOnly cookies.
3836 * @default false
3837 */
3838 httpOnly: boolean
3839 /**
3840 * Whether or not the cookie is a host-only cookie, meaning the request's host must exactly match the domain of the cookie.
3841 * @default false
3842 */
3843 hostOnly: boolean
3844 /**
3845 * The cookie's expiry time, specified in seconds since Unix Epoch.
3846 * The default is expiry is 20 years in the future from current time.
3847 */
3848 expiry: number
3849 /**
3850 * The cookie's SameSite value. If set, should be one of `lax`, `strict`, or `no_restriction`.
3851 * `no_restriction` is the equivalent of `SameSite=None`. Pass `undefined` to use the browser's default.
3852 * Note: `no_restriction` can only be used if the secure flag is set to `true`.
3853 * @default undefined
3854 */
3855 sameSite: SameSiteStatus
3856 }
3857
3858 interface ShadowDomOptions {
3859 includeShadowDom?: boolean
3860 }
3861
3862 /**
3863 * Options that control `cy.type` command
3864 *
3865 * @see https://on.cypress.io/type
3866 */
3867 interface TypeOptions extends Loggable, Timeoutable, ActionableOptions {
3868 /**
3869 * Delay after each keypress (ms)
3870 *
3871 * @default 10
3872 */
3873 delay: number
3874 /**
3875 * Parse special characters for strings surrounded by `{}`,
3876 * such as `{esc}`. Set to `false` to type the literal characters instead
3877 *
3878 * @default true
3879 */
3880 parseSpecialCharSequences: boolean
3881 /**
3882 * Keep a modifier activated between commands
3883 *
3884 * @default true
3885 */
3886 release: boolean
3887 }
3888
3889 /**
3890 * Visit website options
3891 *
3892 * @see https://on.cypress.io/visit
3893 */
3894 interface VisitOptions extends Loggable, Timeoutable, Failable {
3895 /**
3896 * The URL to visit. Behaves the same as the `url` argument.
3897 */
3898 url: string
3899
3900 /**
3901 * The HTTP method to use in the visit. Can be `GET` or `POST`.
3902 *
3903 * @default "GET"
3904 */
3905 method: 'GET' | 'POST'
3906
3907 /**
3908 * An optional body to send along with a `POST` request. If it is a string, it will be passed along unmodified. If it is an object, it will be URL encoded to a string and sent with a `Content-Type: application/x-www-urlencoded` header.
3909 *
3910 * @example
3911 * cy.visit({
3912 * url: 'http://www.example.com/form.html',
3913 * method: 'POST',
3914 * body: {
3915 * "field1": "foo",
3916 * "field2": "bar"
3917 * }
3918 * })
3919 */
3920 body: RequestBody
3921
3922 /**
3923 * An object that maps HTTP header names to values to be sent along with the request.
3924 *
3925 * @example
3926 * cy.visit({
3927 * url: 'http://www.example.com',
3928 * headers: {
3929 * 'Accept-Language': 'en-US'
3930 * }
3931 * })
3932 */
3933 headers: { [header: string]: string }
3934
3935 /**
3936 * Called before your page has loaded all of its resources.
3937 *
3938 * @param {AUTWindow} contentWindow the remote page's window object
3939 */
3940 onBeforeLoad(win: AUTWindow): void
3941
3942 /**
3943 * Called once your page has fired its load event.
3944 *
3945 * @param {AUTWindow} contentWindow the remote page's window object
3946 */
3947 onLoad(win: AUTWindow): void
3948
3949 /**
3950 * Cypress will automatically apply the right authorization headers
3951 * if you're attempting to visit an application that requires
3952 * Basic Authentication.
3953 *
3954 * @example
3955 * cy.visit('https://www.acme.com/', {
3956 * auth: {
3957 * username: 'wile',
3958 * password: 'coyote'
3959 * }
3960 * })
3961 */
3962 auth: Auth
3963
3964 /**
3965 * Query parameters to append to the `url` of the request.
3966 */
3967 qs: object
3968 }
3969
3970 /**
3971 * Options to change the default behavior of .trigger()
3972 */
3973 interface TriggerOptions extends Loggable, Timeoutable, ActionableOptions {
3974 /**
3975 * Whether the event bubbles
3976 *
3977 * @default true
3978 */
3979 bubbles: boolean
3980 /**
3981 * Whether the event is cancelable
3982 *
3983 * @default true
3984 */
3985 cancelable: boolean
3986 /**
3987 * The type of the event you want to trigger
3988 *
3989 * @default 'Event'
3990 */
3991 eventConstructor: string
3992 }
3993
3994 /**
3995 * Options to change the default behavior of .url()
3996 */
3997 interface UrlOptions extends Loggable, Timeoutable {
3998 /**
3999 * Whether the url is decoded
4000 *
4001 * @default false
4002 */
4003 decode: boolean
4004 }
4005
4006 /** Options to change the default behavior of .writeFile */
4007 interface WriteFileOptions extends Loggable {
4008 flag: string
4009 encoding: Encodings
4010 }
4011
4012 // Kind of onerous, but has a nice auto-complete.
4013 /**
4014 * @see https://on.cypress.io/should
4015 *
4016 * @interface Chainer
4017 * @template Subject
4018 */
4019 interface Chainer<Subject> {
4020 // chai
4021 /**
4022 * Asserts that the target's `type` is equal to the given string type.
4023 * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
4024 * https://github.com/chaijs/type-detect.
4025 * @example
4026 * cy.wrap('foo').should('be.a', 'string')
4027 * @see http://chaijs.com/api/bdd/#method_a
4028 * @see https://on.cypress.io/assertions
4029 */
4030 (chainer: 'be.a', type: string): Chainable<Subject>
4031 /**
4032 * Asserts that the target is a number or a date greater than the given number or date n respectively.
4033 * However, it's often best to assert that the target is equal to its expected value.
4034 * @example
4035 * cy.wrap(6).should('be.above', 5)
4036 * @see http://chaijs.com/api/bdd/#method_above
4037 * @see https://on.cypress.io/assertions
4038 */
4039 (chainer: 'be.above', value: number | Date): Chainable<Subject>
4040 /**
4041 * Asserts that the target's `type` is equal to the given string type.
4042 * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
4043 * https://github.com/chaijs/type-detect.
4044 * @example
4045 * cy.wrap({ foo: 'bar' }).should('be.an', 'object')
4046 * @alias a
4047 * @see http://chaijs.com/api/bdd/#method_a
4048 * @see https://on.cypress.io/assertions
4049 */
4050 (chainer: 'be.an', value: string): Chainable<Subject>
4051 /**
4052 * Asserts that the target is a number or a `n` date greater than or equal to the given number or date n respectively.
4053 * However, it's often best to assert that the target is equal to its expected value.
4054 * @example
4055 * cy.wrap(6).should('be.at.least', 5)
4056 * @see http://chaijs.com/api/bdd/#method_least
4057 * @see https://on.cypress.io/assertions
4058 */
4059 (chainer: 'be.at.least', value: number | Date): Chainable<Subject>
4060 /**
4061 * Asserts that the target is a number or a `n` date less than or equal to the given number or date n respectively.
4062 * However, it's often best to assert that the target is equal to its expected value.
4063 * @example
4064 * cy.wrap(4).should('be.below', 5)
4065 * @see http://chaijs.com/api/bdd/#method_below
4066 * @see https://on.cypress.io/assertions
4067 */
4068 (chainer: 'be.below', value: number): Chainable<Subject>
4069 /**
4070 * Asserts that the target is an `arguments` object.
4071 * @example
4072 * cy.wrap(arguments).should('be.arguments')
4073 * @see http://chaijs.com/api/bdd/#method_arguments
4074 * @see https://on.cypress.io/assertions
4075 */
4076 (chainer: 'be.arguments'): Chainable<Subject>
4077 /**
4078 * 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.
4079 * @example
4080 * cy.wrap(5.1).should('be.approximately', 5, 0.5)
4081 * @alias closeTo
4082 * @see http://chaijs.com/api/bdd/#method_closeto
4083 * @see https://on.cypress.io/assertions
4084 */
4085 (chainer: 'be.approximately', value: number, delta: number): Chainable<Subject>
4086 /**
4087 * 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.
4088 * @example
4089 * cy.wrap(5.1).should('be.closeTo', 5, 0.5)
4090 * @see http://chaijs.com/api/bdd/#method_closeto
4091 * @see https://on.cypress.io/assertions
4092 */
4093 (chainer: 'be.closeTo', value: number, delta: number): Chainable<Subject>
4094 /**
4095 * When the target is a string or array, .empty asserts that the target's length property is strictly (===) equal to 0
4096 * @example
4097 * cy.wrap([]).should('be.empty')
4098 * cy.wrap('').should('be.empty')
4099 * @see http://chaijs.com/api/bdd/#method_empty
4100 * @see https://on.cypress.io/assertions
4101 */
4102 (chainer: 'be.empty'): Chainable<Subject>
4103 /**
4104 * Asserts that the target is an instance of the given `constructor`.
4105 * @example
4106 * cy.wrap([1, 2]).should('be.instanceOf', Array)
4107 * @see http://chaijs.com/api/bdd/#method_instanceof
4108 * @see https://on.cypress.io/assertions
4109 */
4110 (chainer: 'be.instanceOf', value: any): Chainable<Subject>
4111 /**
4112 * Asserts that the target is strictly (`===`) equal to `false`.
4113 * @example
4114 * cy.wrap(false).should('be.false')
4115 * @see http://chaijs.com/api/bdd/#method_false
4116 * @see https://on.cypress.io/assertions
4117 */
4118 (chainer: 'be.false'): Chainable<Subject>
4119 /**
4120 * Asserts that the target is a number or a date greater than the given number or date n respectively.
4121 * However, it's often best to assert that the target is equal to its expected value.
4122 * @example
4123 * cy.wrap(6).should('be.greaterThan', 5)
4124 * @alias above
4125 * @see http://chaijs.com/api/bdd/#method_above
4126 * @see https://on.cypress.io/assertions
4127 */
4128 (chainer: 'be.greaterThan', value: number): Chainable<Subject>
4129 /**
4130 * Asserts that the target is a number or a date greater than the given number or date n respectively.
4131 * However, it's often best to assert that the target is equal to its expected value.
4132 * @example
4133 * cy.wrap(6).should('be.gt', 5)
4134 * @alias above
4135 * @see http://chaijs.com/api/bdd/#method_above
4136 * @see https://on.cypress.io/assertions
4137 */
4138 (chainer: 'be.gt', value: number): Chainable<Subject>
4139 /**
4140 * Asserts that the target is a number or a `n` date greater than or equal to the given number or date n respectively.
4141 * However, it's often best to assert that the target is equal to its expected value.
4142 * @example
4143 * cy.wrap(6).should('be.gte', 5)
4144 * @alias least
4145 * @see http://chaijs.com/api/bdd/#method_least
4146 * @see https://on.cypress.io/assertions
4147 */
4148 (chainer: 'be.gte', value: number): Chainable<Subject>
4149 /**
4150 * Asserts that the target is a number or a `n` date less than or equal to the given number or date n respectively.
4151 * However, it's often best to assert that the target is equal to its expected value.
4152 * @example
4153 * cy.wrap(4).should('be.lessThan', 5)
4154 * @alias below
4155 * @see http://chaijs.com/api/bdd/#method_below
4156 * @see https://on.cypress.io/assertions
4157 */
4158 (chainer: 'be.lessThan', value: number): Chainable<Subject>
4159 /**
4160 * Asserts that the target is a number or a `n` date less than or equal to the given number or date n respectively.
4161 * However, it's often best to assert that the target is equal to its expected value.
4162 * @example
4163 * cy.wrap(4).should('be.lt', 5)
4164 * @alias below
4165 * @see http://chaijs.com/api/bdd/#method_below
4166 * @see https://on.cypress.io/assertions
4167 */
4168 (chainer: 'be.lt', value: number): Chainable<Subject>
4169 /**
4170 * Asserts that the target is a number or a date less than or equal to the given number or date n respectively.
4171 * However, it's often best to assert that the target is equal to its expected value.
4172 * @example
4173 * cy.wrap(4).should('be.lte', 5)
4174 * @alias most
4175 * @see http://chaijs.com/api/bdd/#method_most
4176 * @see https://on.cypress.io/assertions
4177 */
4178 (chainer: 'be.lte', value: number): Chainable<Subject>
4179 /**
4180 * Asserts that the target is loosely (`==`) equal to `true`. However, it's often best to assert that the target is strictly (`===`) or deeply equal to its expected value.
4181 * @example
4182 * cy.wrap(1).should('be.ok')
4183 * @see http://chaijs.com/api/bdd/#method_ok
4184 * @see https://on.cypress.io/assertions
4185 */
4186 (chainer: 'be.ok'): Chainable<Subject>
4187 /**
4188 * Asserts that the target is strictly (`===`) equal to true.
4189 * @example
4190 * cy.wrap(true).should('be.true')
4191 * @see http://chaijs.com/api/bdd/#method_true
4192 * @see https://on.cypress.io/assertions
4193 */
4194 (chainer: 'be.true'): Chainable<Subject>
4195 /**
4196 * Asserts that the target is strictly (`===`) equal to undefined.
4197 * @example
4198 * cy.wrap(undefined).should('be.undefined')
4199 * @see http://chaijs.com/api/bdd/#method_undefined
4200 * @see https://on.cypress.io/assertions
4201 */
4202 (chainer: 'be.undefined'): Chainable<Subject>
4203 /**
4204 * Asserts that the target is strictly (`===`) equal to null.
4205 * @example
4206 * cy.wrap(null).should('be.null')
4207 * @see http://chaijs.com/api/bdd/#method_null
4208 * @see https://on.cypress.io/assertions
4209 */
4210 (chainer: 'be.null'): Chainable<Subject>
4211 /**
4212 * Asserts that the target is strictly (`===`) equal to NaN.
4213 * @example
4214 * cy.wrap(NaN).should('be.NaN')
4215 * @see http://chaijs.com/api/bdd/#method_null
4216 * @see https://on.cypress.io/assertions
4217 */
4218 (chainer: 'be.NaN'): Chainable<Subject>
4219 /**
4220 * Asserts that the target is a number or a date greater than or equal to the given number or date `start`, and less than or equal to the given number or date `finish` respectively.
4221 * However, it's often best to assert that the target is equal to its expected value.
4222 * @example
4223 * cy.wrap(6).should('be.within', 5, 10)
4224 * @see http://chaijs.com/api/bdd/#method_within
4225 * @see https://on.cypress.io/assertions
4226 */
4227 (chainer: 'be.within', start: number, end: number): Chainable<Subject>
4228 (chainer: 'be.within', start: Date, end: Date): Chainable<Subject>
4229 /**
4230 * When one argument is provided, `.change` asserts that the given function `subject` returns a different value when it's invoked before the target function compared to when it's invoked afterward.
4231 * However, it's often best to assert that `subject` is equal to its expected value.
4232 * @example
4233 * let dots = ''
4234 * function addDot() { dots += '.' }
4235 * function getDots() { return dots }
4236 * cy.wrap(addDot).should('change', getDots)
4237 * @see http://chaijs.com/api/bdd/#method_change
4238 * @see https://on.cypress.io/assertions
4239 */
4240 (chainer: 'change', fn: (...args: any[]) => any): Chainable<Subject>
4241 /**
4242 * When two arguments are provided, `.change` asserts that the value of the given object `subject`'s `prop` property is different before invoking the target function compared to afterward.
4243 * @example
4244 * const myObj = { dots: '' }
4245 * function addDot() { myObj.dots += '.' }
4246 * cy.wrap(addDot).should('change', myObj, 'dots')
4247 * @see http://chaijs.com/api/bdd/#method_change
4248 * @see https://on.cypress.io/assertions
4249 */
4250 (chainer: 'change', obj: object, prop: string): Chainable<Subject>
4251 /**
4252 * When the target is a string, `.include` asserts that the given string val is a substring of the target.
4253 * @example
4254 * cy.wrap('tester').should('contain', 'test')
4255 * @alias include
4256 * @see http://chaijs.com/api/bdd/#method_include
4257 * @see https://on.cypress.io/assertions
4258 */
4259 (chainer: 'contain', value: any): Chainable<Subject>
4260 /**
4261 * 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.
4262 * `.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.
4263 * @example
4264 * let val = 1
4265 * function subtractTwo() { val -= 2 }
4266 * function getVal() { return val }
4267 * cy.wrap(subtractTwo).should('decrease', getVal)
4268 * @see http://chaijs.com/api/bdd/#method_decrease
4269 * @see https://on.cypress.io/assertions
4270 */
4271 (chainer: 'decrease', fn: (...args: any[]) => any): Chainable<Subject>
4272 /**
4273 * When two arguments are provided, `.decrease` asserts that the value of the given object `subject`'s `prop` property is lesser after invoking the target function compared to beforehand.
4274 * @example
4275 * let val = 1
4276 * function subtractTwo() { val -= 2 }
4277 * function getVal() { return val }
4278 * cy.wrap(subtractTwo).should('decrease', getVal)
4279 * @see http://chaijs.com/api/bdd/#method_decrease
4280 * @see https://on.cypress.io/assertions
4281 */
4282 (chainer: 'decrease', obj: object, prop: string): Chainable<Subject>
4283 /**
4284 * Causes all `.equal`, `.include`, `.members`, `.keys`, and `.property` assertions that follow in the chain to use deep equality instead of strict (`===`) equality. See the `deep-eql` project page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql.
4285 * @example
4286 * cy.wrap({ a: 1 }).should('deep.equal', { a: 1 })
4287 * @see http://chaijs.com/api/bdd/#method_deep
4288 * @see https://on.cypress.io/assertions
4289 */
4290 (chainer: 'deep.equal', value: Subject): Chainable<Subject>
4291 /**
4292 * Asserts that the target is not strictly (`===`) equal to either `null` or `undefined`. However, it's often best to assert that the target is equal to its expected value.
4293 * @example
4294 * cy.wrap(1).should('exist')
4295 * @see http://chaijs.com/api/bdd/#method_exist
4296 * @see https://on.cypress.io/assertions
4297 */
4298 (chainer: 'exist'): Chainable<Subject>
4299 /**
4300 * Asserts that the target is strictly (`===`) equal to the given `val`.
4301 * @example
4302 * cy.wrap(1).should('eq', 1)
4303 * @alias equal
4304 * @see http://chaijs.com/api/bdd/#method_equal
4305 * @see https://on.cypress.io/assertions
4306 */
4307 (chainer: 'eq', value: any): Chainable<Subject>
4308 /**
4309 * Asserts that the target is deeply equal to the given `obj`. See the `deep-eql` project page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql.
4310 * @example
4311 * cy.wrap({a: 1}).should('eql', {a: 1}).and('not.equal', {a: 1})
4312 * @see http://chaijs.com/api/bdd/#method_eql
4313 * @see https://on.cypress.io/assertions
4314 */
4315 (chainer: 'eql', value: any): Chainable<Subject>
4316 /**
4317 * Asserts that the target is strictly (`===`) equal to the given `val`.
4318 * @example
4319 * cy.wrap(1).should('equal', 1)
4320 * @see http://chaijs.com/api/bdd/#method_equal
4321 * @see https://on.cypress.io/assertions
4322 */
4323 (chainer: 'equal', value: any): Chainable<Subject>
4324 /**
4325 * Causes all `.key` assertions that follow in the chain to require that the target have all of the given keys. This is the opposite of `.any`, which only requires that the target have at least one of the given keys.
4326 * @example
4327 * cy.wrap({ a: 1, b: 2 }).should('have.all.key', 'a', 'b')
4328 * @see http://chaijs.com/api/bdd/#method_all
4329 * @see https://on.cypress.io/assertions
4330 */
4331 (chainer: 'have.all.key', ...value: string[]): Chainable<Subject>
4332 /**
4333 * Causes all `.key` assertions that follow in the chain to only require that the target have at least one of the given keys. This is the opposite of `.all`, which requires that the target have all of the given keys.
4334 * @example
4335 * cy.wrap({ a: 1, b: 2 }).should('have.any.key', 'a')
4336 * @see http://chaijs.com/api/bdd/#method_any
4337 * @see https://on.cypress.io/assertions
4338 */
4339 (chainer: 'have.any.key', ...value: string[]): Chainable<Subject>
4340 /**
4341 * Causes all `.keys` assertions that follow in the chain to require that the target have all of the given keys. This is the opposite of `.any`, which only requires that the target have at least one of the given keys.
4342 * @example
4343 * cy.wrap({ a: 1, b: 2 }).should('have.all.keys', 'a', 'b')
4344 * @see http://chaijs.com/api/bdd/#method_all
4345 * @see https://on.cypress.io/assertions
4346 */
4347 (chainer: 'have.all.keys' | 'have.keys' | 'have.deep.keys' | 'have.all.deep.keys', ...value: string[]): Chainable<Subject>
4348 /**
4349 * Causes all `.keys` assertions that follow in the chain to only require that the target have at least one of the given keys. This is the opposite of `.all`, which requires that the target have all of the given keys.
4350 * @example
4351 * cy.wrap({ a: 1, b: 2 }).should('have.any.keys', 'a')
4352 * @see http://chaijs.com/api/bdd/#method_any
4353 * @see https://on.cypress.io/assertions
4354 */
4355 (chainer: 'have.any.keys' | 'include.any.keys', ...value: string[]): Chainable<Subject>
4356 /**
4357 * Causes all `.keys` assertions that follow in the chain to require the target to be a superset of the expected set, rather than an identical set.
4358 * @example
4359 * cy.wrap({ a: 1, b: 2 }).should('include.all.keys', 'a', 'b')
4360 * @see http://chaijs.com/api/bdd/#method_keys
4361 * @see https://on.cypress.io/assertions
4362 */
4363 (chainer: 'include.all.keys', ...value: string[]): Chainable<Subject>
4364 /**
4365 * Asserts that the target has a property with the given key `name`. See the `deep-eql` project page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql.
4366 * @example
4367 * cy.wrap({ x: {a: 1 }}).should('have.deep.property', 'x', { a: 1 })
4368 * @see http://chaijs.com/api/bdd/#method_property
4369 * @see https://on.cypress.io/assertions
4370 */
4371 (chainer: 'have.deep.property', value: string, obj: object): Chainable<Subject>
4372 /**
4373 * Asserts that the target's `length` property is equal to the given number `n`.
4374 * @example
4375 * cy.wrap([1, 2, 3]).should('have.length', 3)
4376 * cy.wrap('foo').should('have.length', 3)
4377 * @alias lengthOf
4378 * @see http://chaijs.com/api/bdd/#method_lengthof
4379 * @see https://on.cypress.io/assertions
4380 */
4381 (chainer: 'have.length' | 'have.lengthOf', value: number): Chainable<Subject>
4382 /**
4383 * Asserts that the target's `length` property is greater than to the given number `n`.
4384 * @example
4385 * cy.wrap([1, 2, 3]).should('have.length.greaterThan', 2)
4386 * cy.wrap('foo').should('have.length.greaterThan', 2)
4387 * @see http://chaijs.com/api/bdd/#method_lengthof
4388 * @see https://on.cypress.io/assertions
4389 */
4390 (chainer: 'have.length.greaterThan' | 'have.lengthOf.greaterThan', value: number): Chainable<Subject>
4391 /**
4392 * Asserts that the target's `length` property is greater than to the given number `n`.
4393 * @example
4394 * cy.wrap([1, 2, 3]).should('have.length.gt', 2)
4395 * cy.wrap('foo').should('have.length.gt', 2)
4396 * @see http://chaijs.com/api/bdd/#method_lengthof
4397 * @see https://on.cypress.io/assertions
4398 */
4399 (chainer: 'have.length.gt' | 'have.lengthOf.gt' | 'have.length.above' | 'have.lengthOf.above', value: number): Chainable<Subject>
4400 /**
4401 * Asserts that the target's `length` property is greater than or equal to the given number `n`.
4402 * @example
4403 * cy.wrap([1, 2, 3]).should('have.length.gte', 2)
4404 * cy.wrap('foo').should('have.length.gte', 2)
4405 * @see http://chaijs.com/api/bdd/#method_lengthof
4406 * @see https://on.cypress.io/assertions
4407 */
4408 (chainer: 'have.length.gte' | 'have.lengthOf.gte' | 'have.length.at.least' | 'have.lengthOf.at.least', value: number): Chainable<Subject>
4409 /**
4410 * Asserts that the target's `length` property is less than to the given number `n`.
4411 * @example
4412 * cy.wrap([1, 2, 3]).should('have.length.lessThan', 4)
4413 * cy.wrap('foo').should('have.length.lessThan', 4)
4414 * @see http://chaijs.com/api/bdd/#method_lengthof
4415 * @see https://on.cypress.io/assertions
4416 */
4417 (chainer: 'have.length.lessThan' | 'have.lengthOf.lessThan', value: number): Chainable<Subject>
4418 /**
4419 * Asserts that the target's `length` property is less than to the given number `n`.
4420 * @example
4421 * cy.wrap([1, 2, 3]).should('have.length.lt', 4)
4422 * cy.wrap('foo').should('have.length.lt', 4)
4423 * @see http://chaijs.com/api/bdd/#method_lengthof
4424 * @see https://on.cypress.io/assertions
4425 */
4426 (chainer: 'have.length.lt' | 'have.lengthOf.lt' | 'have.length.below' | 'have.lengthOf.below', value: number): Chainable<Subject>
4427 /**
4428 * Asserts that the target's `length` property is less than or equal to the given number `n`.
4429 * @example
4430 * cy.wrap([1, 2, 3]).should('have.length.lte', 4)
4431 * cy.wrap('foo').should('have.length.lte', 4)
4432 * @see http://chaijs.com/api/bdd/#method_lengthof
4433 * @see https://on.cypress.io/assertions
4434 */
4435 (chainer: 'have.length.lte' | 'have.lengthOf.lte' | 'have.length.at.most' | 'have.lengthOf.at.most', value: number): Chainable<Subject>
4436 /**
4437 * Asserts that the target's `length` property is within `start` and `finish`.
4438 * @example
4439 * cy.wrap([1, 2, 3]).should('have.length.within', 1, 5)
4440 * @see http://chaijs.com/api/bdd/#method_lengthof
4441 * @see https://on.cypress.io/assertions
4442 */
4443 (chainer: 'have.length.within' | 'have.lengthOf.within', start: number, finish: number): Chainable<Subject>
4444 /**
4445 * Asserts that the target array has the same members as the given array `set`.
4446 * @example
4447 * cy.wrap([1, 2, 3]).should('have.members', [2, 1, 3])
4448 * @see http://chaijs.com/api/bdd/#method_members
4449 * @see https://on.cypress.io/assertions
4450 */
4451 (chainer: 'have.members' | 'have.deep.members', values: any[]): Chainable<Subject>
4452 /**
4453 * Asserts that the target array has the same members as the given array where order matters.
4454 * @example
4455 * cy.wrap([1, 2, 3]).should('have.ordered.members', [1, 2, 3])
4456 * @see http://chaijs.com/api/bdd/#method_members
4457 * @see https://on.cypress.io/assertions
4458 */
4459 (chainer: 'have.ordered.members', values: any[]): Chainable<Subject>
4460 /**
4461 * Causes all `.property` and `.include` assertions that follow in the chain to ignore inherited properties.
4462 * @example
4463 * Object.prototype.b = 2
4464 * cy.wrap({ a: 1 }).should('have.property', 'a').and('not.have.ownProperty', 'b')
4465 * @see http://chaijs.com/api/bdd/#method_ownproperty
4466 * @see https://on.cypress.io/assertions
4467 */
4468 (chainer: 'have.ownProperty', property: string): Chainable<Subject>
4469 /**
4470 * Asserts that the target has a property with the given key `name`.
4471 * @example
4472 * cy.wrap({ a: 1 }).should('have.property', 'a')
4473 * cy.wrap({ a: 1 }).should('have.property', 'a', 1)
4474 * @see http://chaijs.com/api/bdd/#method_property
4475 * @see https://on.cypress.io/assertions
4476 */
4477 (chainer: 'have.property' | 'have.nested.property' | 'have.own.property' | 'have.a.property' | 'have.deep.property' | 'have.deep.own.property' | 'have.deep.nested.property', property: string, value?: any): Chainable<Subject>
4478 /**
4479 * Asserts that the target has its own property descriptor with the given key name.
4480 * @example
4481 * cy.wrap({a: 1}).should('have.ownPropertyDescriptor', 'a', { value: 1 })
4482 * @see http://chaijs.com/api/bdd/#method_ownpropertydescriptor
4483 * @see https://on.cypress.io/assertions
4484 */
4485 (chainer: 'have.ownPropertyDescriptor' | 'haveOwnPropertyDescriptor', name: string, descriptor?: PropertyDescriptor): Chainable<Subject>
4486 /**
4487 * Asserts that the target string contains the given substring `str`.
4488 * @example
4489 * cy.wrap('foobar').should('have.string', 'bar')
4490 * @see http://chaijs.com/api/bdd/#method_string
4491 * @see https://on.cypress.io/assertions
4492 */
4493 (chainer: 'have.string', match: string | RegExp): Chainable<Subject>
4494 /**
4495 * When the target is a string, `.include` asserts that the given string `val` is a substring of the target.
4496 * @example
4497 * cy.wrap('foobar').should('include', 'foo')
4498 * @see http://chaijs.com/api/bdd/#method_include
4499 * @see https://on.cypress.io/assertions
4500 */
4501 (chainer: 'include' | 'deep.include' | 'nested.include' | 'own.include' | 'deep.own.include' | 'deep.nested.include', value: any): Chainable<Subject>
4502 /**
4503 * When the target is a string, `.include` asserts that the given string `val` is a substring of the target.
4504 * @example
4505 * cy.wrap([1, 2, 3]).should('include.members', [1, 2])
4506 * @see http://chaijs.com/api/bdd/#method_members
4507 * @see https://on.cypress.io/assertions
4508 */
4509 (chainer: 'include.members' | 'include.ordered.members' | 'include.deep.ordered.members', value: any[]): Chainable<Subject>
4510 /**
4511 * When one argument is provided, `.increase` asserts that the given function `subject` returns a greater number when it's
4512 * invoked after invoking the target function compared to when it's invoked beforehand.
4513 * `.increase` also causes all `.by` assertions that follow in the chain to assert how much greater of a number is returned.
4514 * It's often best to assert that the return value increased by the expected amount, rather than asserting it increased by any amount.
4515 *
4516 * When two arguments are provided, `.increase` asserts that the value of the given object `subject`'s `prop` property is greater after
4517 * invoking the target function compared to beforehand.
4518 *
4519 * @example
4520 * let val = 1
4521 * function addTwo() { val += 2 }
4522 * function getVal() { return val }
4523 * cy.wrap(addTwo).should('increase', getVal)
4524 *
4525 * const myObj = { val: 1 }
4526 * function addTwo() { myObj.val += 2 }
4527 * cy.wrap(addTwo).should('increase', myObj, 'val')
4528 * @see http://chaijs.com/api/bdd/#method_increase
4529 * @see https://on.cypress.io/assertions
4530 */
4531 (chainer: 'increase', value: object, property?: string): Chainable<Subject>
4532 /**
4533 * Asserts that the target matches the given regular expression `re`.
4534 * @example
4535 * cy.wrap('foobar').should('match', /^foo/)
4536 * @see http://chaijs.com/api/bdd/#method_match
4537 * @see https://on.cypress.io/assertions
4538 */
4539 (chainer: 'match', value: RegExp): Chainable<Subject>
4540 /**
4541 * When the target is a non-function object, `.respondTo` asserts that the target has a `method` with the given name method. The method can be own or inherited, and it can be enumerable or non-enumerable.
4542 * @example
4543 * class Cat {
4544 * meow() {}
4545 * }
4546 * cy.wrap(new Cat()).should('respondTo', 'meow')
4547 * @see http://chaijs.com/api/bdd/#method_respondto
4548 * @see https://on.cypress.io/assertions
4549 */
4550 (chainer: 'respondTo', value: string): Chainable<Subject>
4551 /**
4552 * Invokes the given `matcher` function with the target being passed as the first argument, and asserts that the value returned is truthy.
4553 * @example
4554 * cy.wrap(1).should('satisfy', (num) => num > 0)
4555 * @see http://chaijs.com/api/bdd/#method_satisfy
4556 * @see https://on.cypress.io/assertions
4557 */
4558 (chainer: 'satisfy', fn: (val: any) => boolean): Chainable<Subject>
4559 /**
4560 * When no arguments are provided, `.throw` invokes the target function and asserts that an error is thrown.
4561 * When one argument is provided, and it's a string, `.throw` invokes the target function and asserts that an error is thrown with a message that contains that string.
4562 * @example
4563 * function badFn() { throw new TypeError('Illegal salmon!') }
4564 * cy.wrap(badFn).should('throw')
4565 * cy.wrap(badFn).should('throw', 'salmon')
4566 * cy.wrap(badFn).should('throw', /salmon/)
4567 * @see http://chaijs.com/api/bdd/#method_throw
4568 * @see https://on.cypress.io/assertions
4569 */
4570 (chainer: 'throw', value?: string | RegExp): Chainable<Subject>
4571 /**
4572 * When no arguments are provided, `.throw` invokes the target function and asserts that an error is thrown.
4573 * When one argument is provided, and it's a string, `.throw` invokes the target function and asserts that an error is thrown with a message that contains that string.
4574 * @example
4575 * function badFn() { throw new TypeError('Illegal salmon!') }
4576 * cy.wrap(badFn).should('throw')
4577 * cy.wrap(badFn).should('throw', 'salmon')
4578 * cy.wrap(badFn).should('throw', /salmon/)
4579 * @see http://chaijs.com/api/bdd/#method_throw
4580 * @see https://on.cypress.io/assertions
4581 */
4582 // tslint:disable-next-line ban-types
4583 (chainer: 'throw', error: Error | Function, expected?: string | RegExp): Chainable<Subject>
4584 /**
4585 * Asserts that the target is a member of the given array list.
4586 * @example
4587 * cy.wrap(1).should('be.oneOf', [1, 2, 3])
4588 * @see http://chaijs.com/api/bdd/#method_oneof
4589 * @see https://on.cypress.io/assertions
4590 */
4591 (chainer: 'be.oneOf', list: ReadonlyArray<any>): Chainable<Subject>
4592 /**
4593 * Asserts that the target is extensible, which means that new properties can be added to it.
4594 * @example
4595 * cy.wrap({a: 1}).should('be.extensible')
4596 * @see http://chaijs.com/api/bdd/#method_extensible
4597 * @see https://on.cypress.io/assertions
4598 */
4599 (chainer: 'be.extensible'): Chainable<Subject>
4600 /**
4601 * 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.
4602 * @example
4603 * let sealedObject = Object.seal({})
4604 * let frozenObject = Object.freeze({})
4605 * cy.wrap(sealedObject).should('be.sealed')
4606 * cy.wrap(frozenObject).should('be.sealed')
4607 * @see http://chaijs.com/api/bdd/#method_sealed
4608 * @see https://on.cypress.io/assertions
4609 */
4610 (chainer: 'be.sealed'): Chainable<Subject>
4611 /**
4612 * 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.
4613 * @example
4614 * let frozenObject = Object.freeze({})
4615 * cy.wrap(frozenObject).should('be.frozen')
4616 * @see http://chaijs.com/api/bdd/#method_frozen
4617 * @see https://on.cypress.io/assertions
4618 */
4619 (chainer: 'be.frozen'): Chainable<Subject>
4620 /**
4621 * Asserts that the target is a number, and isn't `NaN` or positive/negative `Infinity`.
4622 * @example
4623 * cy.wrap(1).should('be.finite')
4624 * @see http://chaijs.com/api/bdd/#method_finite
4625 * @see https://on.cypress.io/assertions
4626 */
4627 (chainer: 'be.finite'): Chainable<Subject>
4628
4629 // chai.not
4630 /**
4631 * Asserts that the target's `type` is not equal to the given string type.
4632 * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
4633 * https://github.com/chaijs/type-detect.
4634 * @example
4635 * cy.wrap('foo').should('not.be.a', 'number')
4636 * @see http://chaijs.com/api/bdd/#method_a
4637 * @see https://on.cypress.io/assertions
4638 */
4639 (chainer: 'not.be.a', type: string): Chainable<Subject>
4640 /**
4641 * Asserts that the target is a not number or not a date greater than the given number or date n respectively.
4642 * However, it's often best to assert that the target is equal to its expected value.
4643 * @example
4644 * cy.wrap(6).should('not.be.above', 10)
4645 * @see http://chaijs.com/api/bdd/#method_above
4646 * @see https://on.cypress.io/assertions
4647 */
4648 (chainer: 'not.be.above', value: number | Date): Chainable<Subject>
4649 /**
4650 * Asserts that the target's `type` is not equal to the given string type.
4651 * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
4652 * https://github.com/chaijs/type-detect.
4653 * @example
4654 * cy.wrap('foo').should('not.be.an', 'object')
4655 * @alias a
4656 * @see http://chaijs.com/api/bdd/#method_a
4657 * @see https://on.cypress.io/assertions
4658 */
4659 (chainer: 'not.be.an', value: string): Chainable<Subject>
4660 /**
4661 * Asserts that the target is not a number or not a `n` date greater than or equal to the given number or date n respectively.
4662 * However, it's often best to assert that the target is equal to its expected value.
4663 * @example
4664 * cy.wrap(6).should('not.be.at.least', 10)
4665 * @see http://chaijs.com/api/bdd/#method_least
4666 * @see https://on.cypress.io/assertions
4667 */
4668 (chainer: 'not.be.at.least', value: number | Date): Chainable<Subject>
4669 /**
4670 * Asserts that the target is not a number or not a `n` date less than or equal to the given number or date n respectively.
4671 * However, it's often best to assert that the target is equal to its expected value.
4672 * @example
4673 * cy.wrap(4).should('not.be.below', 1)
4674 * @see http://chaijs.com/api/bdd/#method_below
4675 * @see https://on.cypress.io/assertions
4676 */
4677 (chainer: 'not.be.below', value: number): Chainable<Subject>
4678 /**
4679 * Asserts that the target is not an `arguments` object.
4680 * @example
4681 * cy.wrap(1).should('not.be.arguments')
4682 * @see http://chaijs.com/api/bdd/#method_arguments
4683 * @see https://on.cypress.io/assertions
4684 */
4685 (chainer: 'not.be.arguments'): Chainable<Subject>
4686 /**
4687 * 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.
4688 * @example
4689 * cy.wrap(5.1).should('not.be.approximately', 6, 0.5)
4690 * @alias closeTo
4691 * @see http://chaijs.com/api/bdd/#method_closeto
4692 * @see https://on.cypress.io/assertions
4693 */
4694 (chainer: 'not.be.approximately', value: number, delta: number): Chainable<Subject>
4695 /**
4696 * 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.
4697 * @example
4698 * cy.wrap(5.1).should('not.be.closeTo', 6, 0.5)
4699 * @see http://chaijs.com/api/bdd/#method_closeto
4700 * @see https://on.cypress.io/assertions
4701 */
4702 (chainer: 'not.be.closeTo', value: number, delta: number): Chainable<Subject>
4703 /**
4704 * When the target is a not string or array, .empty asserts that the target's length property is strictly (===) equal to 0
4705 * @example
4706 * cy.wrap([1]).should('not.be.empty')
4707 * cy.wrap('foo').should('not.be.empty')
4708 * @see http://chaijs.com/api/bdd/#method_empty
4709 * @see https://on.cypress.io/assertions
4710 */
4711 (chainer: 'not.be.empty'): Chainable<Subject>
4712 /**
4713 * Asserts that the target is not an instance of the given `constructor`.
4714 * @example
4715 * cy.wrap([1, 2]).should('not.be.instanceOf', String)
4716 * @see http://chaijs.com/api/bdd/#method_instanceof
4717 * @see https://on.cypress.io/assertions
4718 */
4719 (chainer: 'not.be.instanceOf', value: any): Chainable<Subject>
4720 /**
4721 * Asserts that the target is not strictly (`===`) equal to `false`.
4722 * @example
4723 * cy.wrap(true).should('not.be.false')
4724 * @see http://chaijs.com/api/bdd/#method_false
4725 * @see https://on.cypress.io/assertions
4726 */
4727 (chainer: 'not.be.false'): Chainable<Subject>
4728 /**
4729 * Asserts that the target is a not number or a date greater than the given number or date n respectively.
4730 * However, it's often best to assert that the target is equal to its expected value.
4731 * @example
4732 * cy.wrap(6).should('be.greaterThan', 7)
4733 * @alias above
4734 * @see http://chaijs.com/api/bdd/#method_above
4735 * @see https://on.cypress.io/assertions
4736 */
4737 (chainer: 'not.be.greaterThan', value: number): Chainable<Subject>
4738 /**
4739 * Asserts that the target is a not number or a date greater than the given number or date n respectively.
4740 * However, it's often best to assert that the target is equal to its expected value.
4741 * @example
4742 * cy.wrap(6).should('not.be.gt', 7)
4743 * @alias above
4744 * @see http://chaijs.com/api/bdd/#method_above
4745 * @see https://on.cypress.io/assertions
4746 */
4747 (chainer: 'not.be.gt', value: number): Chainable<Subject>
4748 /**
4749 * Asserts that the target is a not number or a `n` date greater than or equal to the given number or date n respectively.
4750 * However, it's often best to assert that the target is equal to its expected value.
4751 * @example
4752 * cy.wrap(6).should('not.be.gte', 7)
4753 * @alias least
4754 * @see http://chaijs.com/api/bdd/#method_least
4755 * @see https://on.cypress.io/assertions
4756 */
4757 (chainer: 'not.be.gte', value: number): Chainable<Subject>
4758 /**
4759 * Asserts that the target is not a number or a `n` date less than or equal to the given number or date n respectively.
4760 * However, it's often best to assert that the target is equal to its expected value.
4761 * @example
4762 * cy.wrap(4).should('not.be.lessThan', 3)
4763 * @alias below
4764 * @see http://chaijs.com/api/bdd/#method_below
4765 * @see https://on.cypress.io/assertions
4766 */
4767 (chainer: 'not.be.lessThan', value: number): Chainable<Subject>
4768 /**
4769 * Asserts that the target is not a number or a `n` date less than or equal to the given number or date n respectively.
4770 * However, it's often best to assert that the target is equal to its expected value.
4771 * @example
4772 * cy.wrap(4).should('not.be.lt', 3)
4773 * @alias below
4774 * @see http://chaijs.com/api/bdd/#method_below
4775 * @see https://on.cypress.io/assertions
4776 */
4777 (chainer: 'not.be.lt', value: number): Chainable<Subject>
4778 /**
4779 * Asserts that the target is not a number or a date less than or equal to the given number or date n respectively.
4780 * However, it's often best to assert that the target is equal to its expected value.
4781 * @example
4782 * cy.wrap(4).should('not.be.lte', 3)
4783 * @alias most
4784 * @see http://chaijs.com/api/bdd/#method_most
4785 * @see https://on.cypress.io/assertions
4786 */
4787 (chainer: 'not.be.lte', value: number): Chainable<Subject>
4788 /**
4789 * Asserts that the target is not loosely (`==`) equal to `true`. However, it's often best to assert that the target is strictly (`===`) or deeply equal to its expected value.
4790 * @example
4791 * cy.wrap(0).should('not.be.ok')
4792 * @see http://chaijs.com/api/bdd/#method_ok
4793 * @see https://on.cypress.io/assertions
4794 */
4795 (chainer: 'not.be.ok'): Chainable<Subject>
4796 /**
4797 * Asserts that the target is not strictly (`===`) equal to true.
4798 * @example
4799 * cy.wrap(false).should('not.be.true')
4800 * @see http://chaijs.com/api/bdd/#method_true
4801 * @see https://on.cypress.io/assertions
4802 */
4803 (chainer: 'not.be.true'): Chainable<Subject>
4804 /**
4805 * Asserts that the target is not strictly (`===`) equal to undefined.
4806 * @example
4807 * cy.wrap(true).should('not.be.undefined')
4808 * @see http://chaijs.com/api/bdd/#method_undefined
4809 * @see https://on.cypress.io/assertions
4810 */
4811 (chainer: 'not.be.undefined'): Chainable<Subject>
4812 /**
4813 * Asserts that the target is strictly (`===`) equal to null.
4814 * @example
4815 * cy.wrap(null).should('not.be.null')
4816 * @see http://chaijs.com/api/bdd/#method_null
4817 * @see https://on.cypress.io/assertions
4818 */
4819 (chainer: 'not.be.null'): Chainable<Subject>
4820 /**
4821 * Asserts that the target is strictly (`===`) equal to NaN.
4822 * @example
4823 * cy.wrap(NaN).should('not.be.NaN')
4824 * @see http://chaijs.com/api/bdd/#method_nan
4825 * @see https://on.cypress.io/assertions
4826 */
4827 (chainer: 'not.be.NaN'): Chainable<Subject>
4828 /**
4829 * Asserts that the target is not a number or a date greater than or equal to the given number or date `start`, and less than or equal to the given number or date `finish` respectively.
4830 * However, it's often best to assert that the target is equal to its expected value.
4831 * @example
4832 * cy.wrap(3).should('not.be.within', 5, 10)
4833 * @see http://chaijs.com/api/bdd/#method_within
4834 * @see https://on.cypress.io/assertions
4835 */
4836 (chainer: 'not.be.within', start: number, end: number): Chainable<Subject>
4837 (chainer: 'not.be.within', start: Date, end: Date): Chainable<Subject>
4838 /**
4839 * When one argument is provided, `.change` asserts that the given function `subject` returns a different value when it's invoked before the target function compared to when it's invoked afterward.
4840 * However, it's often best to assert that `subject` is equal to its expected value.
4841 * @example
4842 * let dots = ''
4843 * function addDot() { dots += '.' }
4844 * function getDots() { return dots }
4845 * cy.wrap(() => {}).should('not.change', getDots)
4846 * @see http://chaijs.com/api/bdd/#method_change
4847 * @see https://on.cypress.io/assertions
4848 */
4849 (chainer: 'not.change', fn: (...args: any[]) => any): Chainable<Subject>
4850 /**
4851 * When two arguments are provided, `.change` asserts that the value of the given object `subject`'s `prop` property is different before invoking the target function compared to afterward.
4852 * @example
4853 * const myObj = { dots: '' }
4854 * function addDot() { myObj.dots += '.' }
4855 * cy.wrap(() => {}).should('not.change', myObj, 'dots')
4856 * @see http://chaijs.com/api/bdd/#method_change
4857 * @see https://on.cypress.io/assertions
4858 */
4859 (chainer: 'not.change', obj: object, prop: string): Chainable<Subject>
4860 /**
4861 * When the target is a string, `.include` asserts that the given string val is a substring of the target.
4862 * @example
4863 * cy.wrap('tester').should('not.contain', 'foo')
4864 * @alias include
4865 * @see http://chaijs.com/api/bdd/#method_include
4866 * @see https://on.cypress.io/assertions
4867 */
4868 (chainer: 'not.contain', value: any): Chainable<Subject>
4869 /**
4870 * 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.
4871 * `.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.
4872 * @example
4873 * let val = 1
4874 * function subtractTwo() { val -= 2 }
4875 * function getVal() { return val }
4876 * cy.wrap(() => {}).should('not.decrease', getVal)
4877 * @see http://chaijs.com/api/bdd/#method_decrease
4878 * @see https://on.cypress.io/assertions
4879 */
4880 (chainer: 'not.decrease', fn: (...args: any[]) => any): Chainable<Subject>
4881 /**
4882 * When two arguments are provided, `.decrease` asserts that the value of the given object `subject`'s `prop` property is not lesser after invoking the target function compared to beforehand.
4883 * @example
4884 * const myObj = { val: 1 }
4885 * function subtractTwo() { myObj.val -= 2 }
4886 * cy.wrap(() => {}).should('not.decrease', myObj, 'val')
4887 * @see http://chaijs.com/api/bdd/#method_decrease
4888 * @see https://on.cypress.io/assertions
4889 */
4890 (chainer: 'not.decrease', obj: object, prop: string): Chainable<Subject>
4891 /**
4892 * Causes all `.equal`, `.include`, `.members`, `.keys`, and `.property` assertions that follow in the chain to not use deep equality instead of strict (`===`) equality. See the `deep-eql` project page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql.
4893 * @example
4894 * cy.wrap({ a: 1 }).should('not.deep.equal', { b: 1 })
4895 * @see http://chaijs.com/api/bdd/#method_deep
4896 * @see https://on.cypress.io/assertions
4897 */
4898 (chainer: 'not.deep.equal', value: Subject): Chainable<Subject>
4899 /**
4900 * Asserts that the target is not strictly (`===`) equal to either `null` or `undefined`. However, it's often best to assert that the target is equal to its expected value.
4901 * @example
4902 * cy.wrap(null).should('not.exist')
4903 * @see http://chaijs.com/api/bdd/#method_exist
4904 * @see https://on.cypress.io/assertions
4905 */
4906 (chainer: 'not.exist'): Chainable<Subject>
4907 /**
4908 * Asserts that the target is not strictly (`===`) equal to the given `val`.
4909 * @example
4910 * cy.wrap(1).should('not.eq', 2)
4911 * @alias equal
4912 * @see http://chaijs.com/api/bdd/#method_equal
4913 * @see https://on.cypress.io/assertions
4914 */
4915 (chainer: 'not.eq', value: any): Chainable<Subject>
4916 /**
4917 * Asserts that the target is not deeply equal to the given `obj`. See the `deep-eql` project page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql.
4918 * @example
4919 * cy.wrap({a: 1}).should('not.eql', {c: 1}).and('not.equal', {a: 1})
4920 * @see http://chaijs.com/api/bdd/#method_eql
4921 * @see https://on.cypress.io/assertions
4922 */
4923 (chainer: 'not.eql', value: any): Chainable<Subject>
4924 /**
4925 * Asserts that the target is not strictly (`===`) equal to the given `val`.
4926 * @example
4927 * cy.wrap(1).should('not.equal', 2)
4928 * @see http://chaijs.com/api/bdd/#method_equal
4929 * @see https://on.cypress.io/assertions
4930 */
4931 (chainer: 'not.equal', value: any): Chainable<Subject>
4932 /**
4933 * Causes all `.keys` assertions that follow in the chain to not require that the target have all of the given keys. This is the opposite of `.any`, which only requires that the target have at least one of the given keys.
4934 * @example
4935 * cy.wrap({ a: 1, b: 2 }).should('not.have.all.keys', 'c', 'd')
4936 * @see http://chaijs.com/api/bdd/#method_all
4937 * @see https://on.cypress.io/assertions
4938 */
4939 (chainer: 'not.have.all.keys' | 'not.have.keys' | 'not.have.deep.keys' | 'not.have.all.deep.keys', ...value: string[]): Chainable<Subject>
4940 /**
4941 * Causes all `.keys` assertions that follow in the chain to only require that the target not have at least one of the given keys. This is the opposite of `.all`, which requires that the target have all of the given keys.
4942 * @example
4943 * cy.wrap({ a: 1, b: 2 }).should('not.have.any.keys', 'c')
4944 * @see http://chaijs.com/api/bdd/#method_any
4945 * @see https://on.cypress.io/assertions
4946 */
4947 (chainer: 'not.have.any.keys' | 'not.include.any.keys', ...value: string[]): Chainable<Subject>
4948 /**
4949 * Asserts that the target does not have a property with the given key `name`. See the `deep-eql` project page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql.
4950 * @example
4951 * cy.wrap({ x: {a: 1 }}).should('not.have.deep.property', 'y', { a: 1 })
4952 * @see http://chaijs.com/api/bdd/#method_property
4953 * @see https://on.cypress.io/assertions
4954 */
4955 (chainer: 'not.have.deep.property', value: string, obj: object): Chainable<Subject>
4956 /**
4957 * Asserts that the target's `length` property is not equal to the given number `n`.
4958 * @example
4959 * cy.wrap([1, 2, 3]).should('not.have.length', 2)
4960 * cy.wrap('foo').should('not.have.length', 2)
4961 * @alias lengthOf
4962 * @see http://chaijs.com/api/bdd/#method_lengthof
4963 * @see https://on.cypress.io/assertions
4964 */
4965 (chainer: 'not.have.length' | 'not.have.lengthOf', value: number): Chainable<Subject>
4966 /**
4967 * Asserts that the target's `length` property is not greater than to the given number `n`.
4968 * @example
4969 * cy.wrap([1, 2, 3]).should('not.have.length.greaterThan', 4)
4970 * cy.wrap('foo').should('not.have.length.greaterThan', 4)
4971 * @see http://chaijs.com/api/bdd/#method_lengthof
4972 * @see https://on.cypress.io/assertions
4973 */
4974 (chainer: 'not.have.length.greaterThan' | 'not.have.lengthOf.greaterThan', value: number): Chainable<Subject>
4975 /**
4976 * Asserts that the target's `length` property is not greater than to the given number `n`.
4977 * @example
4978 * cy.wrap([1, 2, 3]).should('not.have.length.gt', 4)
4979 * cy.wrap('foo').should('not.have.length.gt', 4)
4980 * @see http://chaijs.com/api/bdd/#method_lengthof
4981 * @see https://on.cypress.io/assertions
4982 */
4983 (chainer: 'not.have.length.gt' | 'not.have.lengthOf.gt' | 'not.have.length.above' | 'not.have.lengthOf.above', value: number): Chainable<Subject>
4984 /**
4985 * Asserts that the target's `length` property is not greater than or equal to the given number `n`.
4986 * @example
4987 * cy.wrap([1, 2, 3]).should('not.have.length.gte', 4)
4988 * cy.wrap('foo').should('not.have.length.gte', 4)
4989 * @see http://chaijs.com/api/bdd/#method_lengthof
4990 * @see https://on.cypress.io/assertions
4991 */
4992 (chainer: 'not.have.length.gte' | 'not.have.lengthOf.gte' | 'not.have.length.at.least' | 'not.have.lengthOf.at.least', value: number): Chainable<Subject>
4993 /**
4994 * Asserts that the target's `length` property is less than to the given number `n`.
4995 * @example
4996 * cy.wrap([1, 2, 3]).should('have.length.lessThan', 2)
4997 * cy.wrap('foo').should('have.length.lessThan', 2)
4998 * @see http://chaijs.com/api/bdd/#method_lengthof
4999 * @see https://on.cypress.io/assertions
5000 */
5001 (chainer: 'not.have.length.lessThan' | 'not.have.lengthOf.lessThan', value: number): Chainable<Subject>
5002 /**
5003 * Asserts that the target's `length` property is not less than to the given number `n`.
5004 * @example
5005 * cy.wrap([1, 2, 3]).should('not.have.length.lt', 2)
5006 * cy.wrap('foo').should('not.have.length.lt', 2)
5007 * @see http://chaijs.com/api/bdd/#method_lengthof
5008 * @see https://on.cypress.io/assertions
5009 */
5010 (chainer: 'not.have.length.lt' | 'not.have.lengthOf.lt' | 'not.have.length.below' | 'not.have.lengthOf.below', value: number): Chainable<Subject>
5011 /**
5012 * Asserts that the target's `length` property is not less than or equal to the given number `n`.
5013 * @example
5014 * cy.wrap([1, 2, 3]).should('not.have.length.lte', 2)
5015 * cy.wrap('foo').should('not.have.length.lte', 2)
5016 * @see http://chaijs.com/api/bdd/#method_lengthof
5017 * @see https://on.cypress.io/assertions
5018 */
5019 (chainer: 'not.have.length.lte' | 'not.have.lengthOf.lte' | 'not.have.length.at.most' | 'not.have.lengthOf.at.most', value: number): Chainable<Subject>
5020 /**
5021 * Asserts that the target's `length` property is within `start` and `finish`.
5022 * @example
5023 * cy.wrap([1, 2, 3]).should('not.have.length.within', 6, 12)
5024 * @see http://chaijs.com/api/bdd/#method_lengthof
5025 * @see https://on.cypress.io/assertions
5026 */
5027 (chainer: 'not.have.length.within' | 'not.have.lengthOf.within', start: number, finish: number): Chainable<Subject>
5028 /**
5029 * Asserts that the target array does not have the same members as the given array `set`.
5030 * @example
5031 * cy.wrap([1, 2, 3]).should('not.have.members', [4, 5, 6])
5032 * @see http://chaijs.com/api/bdd/#method_members
5033 * @see https://on.cypress.io/assertions
5034 */
5035 (chainer: 'not.have.members' | 'not.have.deep.members', values: any[]): Chainable<Subject>
5036 /**
5037 * Asserts that the target array does not have the same members as the given array where order matters.
5038 * @example
5039 * cy.wrap([1, 2, 3]).should('not. have.ordered.members', [4, 5, 6])
5040 * @see http://chaijs.com/api/bdd/#method_members
5041 * @see https://on.cypress.io/assertions
5042 */
5043 (chainer: 'not.have.ordered.members', values: any[]): Chainable<Subject>
5044 /**
5045 * Causes all `.property` and `.include` assertions that follow in the chain to ignore inherited properties.
5046 * @example
5047 * Object.prototype.b = 2
5048 * cy.wrap({ a: 1 }).should('have.property', 'a').and('not.have.ownProperty', 'b')
5049 * @see http://chaijs.com/api/bdd/#method_ownproperty
5050 * @see https://on.cypress.io/assertions
5051 */
5052 (chainer: 'not.have.ownProperty', property: string): Chainable<Subject>
5053 /**
5054 * Asserts that the target has a property with the given key `name`.
5055 * @example
5056 * cy.wrap({ a: 1 }).should('not.have.property', 'b')
5057 * cy.wrap({ a: 1 }).should('not.have.property', 'b', 1)
5058 * @see http://chaijs.com/api/bdd/#method_property
5059 * @see https://on.cypress.io/assertions
5060 */
5061 (chainer: 'not.have.property' | 'not.have.nested.property' | 'not.have.own.property' | 'not.have.a.property' | 'not.have.deep.property' | 'not.have.deep.own.property' | 'not.have.deep.nested.property', property: string, value?: any): Chainable<Subject>
5062 /**
5063 * Asserts that the target has its own property descriptor with the given key name.
5064 * @example
5065 * cy.wrap({a: 1}).should('not.have.ownPropertyDescriptor', 'a', { value: 2 })
5066 * @see http://chaijs.com/api/bdd/#method_ownpropertydescriptor
5067 * @see https://on.cypress.io/assertions
5068 */
5069 (chainer: 'not.have.ownPropertyDescriptor' | 'not.haveOwnPropertyDescriptor', name: string, descriptor?: PropertyDescriptor): Chainable<Subject>
5070 /**
5071 * Asserts that the target string does not contains the given substring `str`.
5072 * @example
5073 * cy.wrap('foobar').should('not.have.string', 'baz')
5074 * @see http://chaijs.com/api/bdd/#method_string
5075 * @see https://on.cypress.io/assertions
5076 */
5077 (chainer: 'not.have.string', match: string | RegExp): Chainable<Subject>
5078 /**
5079 * When the target is a string, `.include` asserts that the given string `val` is not a substring of the target.
5080 * @example
5081 * cy.wrap('foobar').should('not.include', 'baz')
5082 * @see http://chaijs.com/api/bdd/#method_include
5083 * @see https://on.cypress.io/assertions
5084 */
5085 (chainer: 'not.include' | 'not.deep.include' | 'not.nested.include' | 'not.own.include' | 'not.deep.own.include' | 'not.deep.nested.include', value: any): Chainable<Subject>
5086 /**
5087 * When the target is a string, `.include` asserts that the given string `val` is not a substring of the target.
5088 * @example
5089 * cy.wrap([1, 2, 3]).should('not.include.members', [4, 5])
5090 * @see http://chaijs.com/api/bdd/#method_members
5091 * @see https://on.cypress.io/assertions
5092 */
5093 (chainer: 'not.include.members' | 'not.include.ordered.members' | 'not.include.deep.ordered.members', value: any[]): Chainable<Subject>
5094 /**
5095 * When one argument is provided, `.increase` asserts that the given function `subject` returns a greater number when it's
5096 * invoked after invoking the target function compared to when it's invoked beforehand.
5097 * `.increase` also causes all `.by` assertions that follow in the chain to assert how much greater of a number is returned.
5098 * It's often best to assert that the return value increased by the expected amount, rather than asserting it increased by any amount.
5099 *
5100 * When two arguments are provided, `.increase` asserts that the value of the given object `subject`'s `prop` property is greater after
5101 * invoking the target function compared to beforehand.
5102 *
5103 * @example
5104 * let val = 1
5105 * function addTwo() { val += 2 }
5106 * function getVal() { return val }
5107 * cy.wrap(() => {}).should('not.increase', getVal)
5108 *
5109 * const myObj = { val: 1 }
5110 * function addTwo() { myObj.val += 2 }
5111 * cy.wrap(addTwo).should('increase', myObj, 'val')
5112 * @see http://chaijs.com/api/bdd/#method_increase
5113 * @see https://on.cypress.io/assertions
5114 */
5115 (chainer: 'not.increase', value: object, property?: string): Chainable<Subject>
5116 /**
5117 * Asserts that the target does not match the given regular expression `re`.
5118 * @example
5119 * cy.wrap('foobar').should('not.match', /baz$/)
5120 * @see http://chaijs.com/api/bdd/#method_match
5121 * @see https://on.cypress.io/assertions
5122 */
5123 (chainer: 'not.match', value: RegExp): Chainable<Subject>
5124 /**
5125 * When the target is a non-function object, `.respondTo` asserts that the target does not have a `method` with the given name method. The method can be own or inherited, and it can be enumerable or non-enumerable.
5126 * @example
5127 * class Cat {
5128 * meow() {}
5129 * }
5130 * cy.wrap(new Cat()).should('not.respondTo', 'bark')
5131 * @see http://chaijs.com/api/bdd/#method_respondto
5132 * @see https://on.cypress.io/assertions
5133 */
5134 (chainer: 'not.respondTo', value: string): Chainable<Subject>
5135 /**
5136 * Invokes the given `matcher` function with the target being passed as the first argument, and asserts that the value returned is falsy.
5137 * @example
5138 * cy.wrap(1).should('not.satisfy', (num) => num < 0)
5139 * @see http://chaijs.com/api/bdd/#method_satisfy
5140 * @see https://on.cypress.io/assertions
5141 */
5142 (chainer: 'not.satisfy', fn: (val: any) => boolean): Chainable<Subject>
5143 /**
5144 * When no arguments are provided, `.throw` invokes the target function and asserts that no error is thrown.
5145 * When one argument is provided, and it's a string, `.throw` invokes the target function and asserts that no error is thrown with a message that contains that string.
5146 * @example
5147 * function badFn() { console.log('Illegal salmon!') }
5148 * cy.wrap(badFn).should('not.throw')
5149 * cy.wrap(badFn).should('not.throw', 'salmon')
5150 * cy.wrap(badFn).should('not.throw', /salmon/)
5151 * @see http://chaijs.com/api/bdd/#method_throw
5152 * @see https://on.cypress.io/assertions
5153 */
5154 (chainer: 'not.throw', value?: string | RegExp): Chainable<Subject>
5155 /**
5156 * When no arguments are provided, `.throw` invokes the target function and asserts that no error is thrown.
5157 * When one argument is provided, and it's a string, `.throw` invokes the target function and asserts that no error is thrown with a message that contains that string.
5158 * @example
5159 * function badFn() { console.log('Illegal salmon!') }
5160 * cy.wrap(badFn).should('not.throw')
5161 * cy.wrap(badFn).should('not.throw', 'salmon')
5162 * cy.wrap(badFn).should('not.throw', /salmon/)
5163 * @see http://chaijs.com/api/bdd/#method_throw
5164 * @see https://on.cypress.io/assertions
5165 */
5166 // tslint:disable-next-line ban-types
5167 (chainer: 'not.throw', error: Error | Function, expected?: string | RegExp): Chainable<Subject>
5168 /**
5169 * Asserts that the target is a member of the given array list.
5170 * @example
5171 * cy.wrap(42).should('not.be.oneOf', [1, 2, 3])
5172 * @see http://chaijs.com/api/bdd/#method_oneof
5173 * @see https://on.cypress.io/assertions
5174 */
5175 (chainer: 'not.be.oneOf', list: ReadonlyArray<any>): Chainable<Subject>
5176 /**
5177 * Asserts that the target is extensible, which means that new properties can be added to it.
5178 * @example
5179 * let o = Object.seal({})
5180 * cy.wrap(o).should('not.be.extensible')
5181 * @see http://chaijs.com/api/bdd/#method_extensible
5182 * @see https://on.cypress.io/assertions
5183 */
5184 (chainer: 'not.be.extensible'): Chainable<Subject>
5185 /**
5186 * 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.
5187 * @example
5188 * cy.wrap({a: 1}).should('be.sealed')
5189 * cy.wrap({a: 1}).should('be.sealed')
5190 * @see http://chaijs.com/api/bdd/#method_sealed
5191 * @see https://on.cypress.io/assertions
5192 */
5193 (chainer: 'not.be.sealed'): Chainable<Subject>
5194 /**
5195 * 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.
5196 * @example
5197 * cy.wrap({a: 1}).should('not.be.frozen')
5198 * @see http://chaijs.com/api/bdd/#method_frozen
5199 * @see https://on.cypress.io/assertions
5200 */
5201 (chainer: 'not.be.frozen'): Chainable<Subject>
5202 /**
5203 * Asserts that the target is a number, and isn't `NaN` or positive/negative `Infinity`.
5204 * @example
5205 * cy.wrap(NaN).should('not.be.finite')
5206 * cy.wrap(Infinity).should('not.be.finite')
5207 * @see http://chaijs.com/api/bdd/#method_finite
5208 * @see https://on.cypress.io/assertions
5209 */
5210 (chainer: 'not.be.finite'): Chainable<Subject>
5211
5212 // sinon-chai
5213 /**
5214 * Assert spy/stub was called the `new` operator.
5215 * 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.
5216 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
5217 * @see https://on.cypress.io/assertions
5218 */
5219 (chainer: 'be.always.calledWithNew' | 'always.have.been.calledWithNew'): Chainable<Subject>
5220 /**
5221 * Assert if spy was always called with matching arguments (and possibly others).
5222 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithmatcharg1-arg2-
5223 * @see https://on.cypress.io/assertions
5224 */
5225 (chainer: 'be.always.calledWithMatch' | 'always.have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
5226 /**
5227 * Assert spy always returned the provided value.
5228 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysreturnedobj
5229 * @see https://on.cypress.io/assertions
5230 */
5231 (chainer: 'always.returned' | 'have.always.returned', value: any): Chainable<Subject>
5232 /**
5233 * `true` if the spy was called at least once
5234 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalled
5235 * @see https://on.cypress.io/assertions
5236 */
5237 (chainer: 'be.called' | 'have.been.called'): Chainable<Subject>
5238 /**
5239 * Assert spy was called after `anotherSpy`
5240 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledafteranotherspy
5241 * @see https://on.cypress.io/assertions
5242 */
5243 (chainer: 'be.calledAfter' | 'have.been.calledAfter', spy: sinon.SinonSpy): Chainable<Subject>
5244 /**
5245 * Assert spy was called before `anotherSpy`
5246 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledbeforeanotherspy
5247 * @see https://on.cypress.io/assertions
5248 */
5249 (chainer: 'be.calledBefore' | 'have.been.calledBefore', spy: sinon.SinonSpy): Chainable<Subject>
5250 /**
5251 * Assert spy was called at least once with `obj` as `this`. `calledOn` also accepts a matcher (see [matchers](http://sinonjs.org/releases/v4.1.3/spies/#matchers)).
5252 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonobj
5253 * @see https://on.cypress.io/assertions
5254 */
5255 (chainer: 'be.calledOn' | 'have.been.calledOn', context: any): Chainable<Subject>
5256 /**
5257 * Assert spy was called exactly once
5258 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonce
5259 * @see https://on.cypress.io/assertions
5260 */
5261 (chainer: 'be.calledOnce' | 'have.been.calledOnce'): Chainable<Subject>
5262 /**
5263 * Assert spy was called exactly three times
5264 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledthrice
5265 * @see https://on.cypress.io/assertions
5266 */
5267 (chainer: 'be.calledThrice' | 'have.been.calledThrice'): Chainable<Subject>
5268 /**
5269 * Assert spy was called exactly twice
5270 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledtwice
5271 * @see https://on.cypress.io/assertions
5272 */
5273 (chainer: 'be.calledTwice' | 'have.been.calledTwice'): Chainable<Subject>
5274 /**
5275 * Assert spy was called at least once with the provided arguments and no others.
5276 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithexactlyarg1-arg2-
5277 * @see https://on.cypress.io/assertions
5278 */
5279 (chainer: 'be.calledWithExactly' | 'have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
5280 /**
5281 * Assert spy was called with matching arguments (and possibly others).
5282 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithmatcharg1-arg2-
5283 * @see https://on.cypress.io/assertions
5284 */
5285 (chainer: 'be.calledWithMatch' | 'have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
5286 /**
5287 * Assert spy/stub was called the `new` operator.
5288 * 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.
5289 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
5290 * @see https://on.cypress.io/assertions
5291 */
5292 (chainer: 'be.calledWithNew' | 'have.been.calledWithNew'): Chainable<Subject>
5293 /**
5294 * Assert spy always threw an exception.
5295 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysthrew
5296 * @see https://on.cypress.io/assertions
5297 */
5298 (chainer: 'have.always.thrown', value?: Error | typeof Error | string): Chainable<Subject>
5299 /**
5300 * Assert the number of calls.
5301 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycallcount
5302 * @see https://on.cypress.io/assertions
5303 */
5304 (chainer: 'have.callCount', value: number): Chainable<Subject>
5305 /**
5306 * Assert spy threw an exception at least once.
5307 * @see http://sinonjs.org/releases/v4.1.3/spies/#spythrew
5308 * @see https://on.cypress.io/assertions
5309 */
5310 (chainer: 'have.thrown', value?: Error | typeof Error | string): Chainable<Subject>
5311 /**
5312 * Assert spy returned the provided value at least once. (see [matchers](http://sinonjs.org/releases/v4.1.3/spies/#matchers))
5313 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyreturnedobj
5314 * @see https://on.cypress.io/assertions
5315 */
5316 (chainer: 'returned' | 'have.returned', value: any): Chainable<Subject>
5317 /**
5318 * Assert spy was called before anotherSpy, and no spy calls occurred between spy and anotherSpy.
5319 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelybeforeanotherspy
5320 * @see https://on.cypress.io/assertions
5321 */
5322 (chainer: 'be.calledImmediatelyBefore' | 'have.been.calledImmediatelyBefore', anotherSpy: sinon.SinonSpy): Chainable<Subject>
5323 /**
5324 * Assert spy was called after anotherSpy, and no spy calls occurred between anotherSpy and spy.
5325 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelyafteranotherspy
5326 * @see https://on.cypress.io/assertions
5327 */
5328 (chainer: 'be.calledImmediatelyAfter' | 'have.been.calledImmediatelyAfter', anotherSpy: sinon.SinonSpy): Chainable<Subject>
5329 /**
5330 * Assert the spy was always called with obj as this
5331 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledonobj
5332 * @see https://on.cypress.io/assertions
5333 */
5334 (chainer: 'be.always.calledOn' | 'always.have.been.calledOn', obj: any): Chainable<Subject>
5335 /**
5336 * Assert spy was called at least once with the provided arguments.
5337 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
5338 * @see https://on.cypress.io/assertions
5339 */
5340 (chainer: 'be.calledWith' | 'have.been.calledWith', ...args: any[]): Chainable<Subject>
5341 /**
5342 * Assert spy was always called with the provided arguments (and possibly others).
5343 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwitharg1-arg2-
5344 * @see https://on.cypress.io/assertions
5345 */
5346 (chainer: 'be.always.calledWith' | 'always.have.been.calledWith', ...args: any[]): Chainable<Subject>
5347 /**
5348 * Assert spy was called at exactly once with the provided arguments.
5349 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
5350 * @see https://on.cypress.io/assertions
5351 */
5352 (chainer: 'be.calledOnceWith' | 'have.been.calledOnceWith', ...args: any[]): Chainable<Subject>
5353 /**
5354 * Assert spy was always called with the exact provided arguments.
5355 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithexactlyarg1-arg2-
5356 * @see https://on.cypress.io/assertions
5357 */
5358 (chainer: 'be.always.calledWithExactly' | 'have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
5359 /**
5360 * Assert spy was called at exactly once with the provided arguments.
5361 * @see http://sinonjs.org/releases/v4.1.3/spies/#
5362 * @see https://on.cypress.io/assertions
5363 */
5364 (chainer: 'be.calledOnceWithExactly' | 'have.been.calledOnceWithExactly', ...args: any[]): Chainable<Subject>
5365 /**
5366 * Assert spy always returned the provided value.
5367 * @see http://sinonjs.org/releases/v4.1.3/spies/#
5368 * @see https://on.cypress.io/assertions
5369 */
5370 (chainer: 'have.always.returned', obj: any): Chainable<Subject>
5371
5372 // sinon-chai.not
5373 /**
5374 * Assert spy/stub was not called the `new` operator.
5375 * 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.
5376 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
5377 * @see https://on.cypress.io/assertions
5378 */
5379 (chainer: 'not.be.always.calledWithNew' | 'not.always.have.been.calledWithNew'): Chainable<Subject>
5380 /**
5381 * Assert if spy was not always called with matching arguments (and possibly others).
5382 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithmatcharg1-arg2-
5383 * @see https://on.cypress.io/assertions
5384 */
5385 (chainer: 'not.be.always.calledWithMatch' | 'not.always.have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
5386 /**
5387 * Assert spy not always returned the provided value.
5388 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysreturnedobj
5389 * @see https://on.cypress.io/assertions
5390 */
5391 (chainer: 'not.always.returned' | 'not.have.always.returned', value: any): Chainable<Subject>
5392 /**
5393 * `true` if the spy was not called at least once
5394 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalled
5395 * @see https://on.cypress.io/assertions
5396 */
5397 (chainer: 'not.be.called' | 'not.have.been.called'): Chainable<Subject>
5398 /**
5399 * Assert spy was not.called after `anotherSpy`
5400 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledafteranotherspy
5401 * @see https://on.cypress.io/assertions
5402 */
5403 (chainer: 'not.be.calledAfter' | 'not.have.been.calledAfter', spy: sinon.SinonSpy): Chainable<Subject>
5404 /**
5405 * Assert spy was not called before `anotherSpy`
5406 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledbeforeanotherspy
5407 * @see https://on.cypress.io/assertions
5408 */
5409 (chainer: 'not.be.calledBefore' | 'not.have.been.calledBefore', spy: sinon.SinonSpy): Chainable<Subject>
5410 /**
5411 * Assert spy was not called at least once with `obj` as `this`. `calledOn` also accepts a matcher (see [matchers](http://sinonjs.org/releases/v4.1.3/spies/#matchers)).
5412 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonobj
5413 * @see https://on.cypress.io/assertions
5414 */
5415 (chainer: 'not.be.calledOn' | 'not.have.been.calledOn', context: any): Chainable<Subject>
5416 /**
5417 * Assert spy was not called exactly once
5418 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonce
5419 * @see https://on.cypress.io/assertions
5420 */
5421 (chainer: 'not.be.calledOnce' | 'not.have.been.calledOnce'): Chainable<Subject>
5422 /**
5423 * Assert spy was not called exactly three times
5424 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledthrice
5425 * @see https://on.cypress.io/assertions
5426 */
5427 (chainer: 'not.be.calledThrice' | 'not.have.been.calledThrice'): Chainable<Subject>
5428 /**
5429 * Assert spy was not called exactly twice
5430 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledtwice
5431 * @see https://on.cypress.io/assertions
5432 */
5433 (chainer: 'not.be.calledTwice' | 'not.have.been.calledTwice'): Chainable<Subject>
5434 /**
5435 * Assert spy was not called at least once with the provided arguments and no others.
5436 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithexactlyarg1-arg2-
5437 * @see https://on.cypress.io/assertions
5438 */
5439 (chainer: 'not.be.calledWithExactly' | 'not.have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
5440 /**
5441 * Assert spy was not called with matching arguments (and possibly others).
5442 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithmatcharg1-arg2-
5443 * @see https://on.cypress.io/assertions
5444 */
5445 (chainer: 'not.be.calledWithMatch' | 'not.have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
5446 /**
5447 * Assert spy/stub was not called the `new` operator.
5448 * 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.
5449 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
5450 * @see https://on.cypress.io/assertions
5451 */
5452 (chainer: 'not.be.calledWithNew' | 'not.have.been.calledWithNew'): Chainable<Subject>
5453 /**
5454 * Assert spy did not always throw an exception.
5455 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysthrew
5456 * @see https://on.cypress.io/assertions
5457 */
5458 (chainer: 'not.have.always.thrown', value?: Error | typeof Error | string): Chainable<Subject>
5459 /**
5460 * Assert not the number of calls.
5461 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycallcount
5462 * @see https://on.cypress.io/assertions
5463 */
5464 (chainer: 'not.have.callCount', value: number): Chainable<Subject>
5465 /**
5466 * Assert spy did not throw an exception at least once.
5467 * @see http://sinonjs.org/releases/v4.1.3/spies/#spythrew
5468 * @see https://on.cypress.io/assertions
5469 */
5470 (chainer: 'not.have.thrown', value?: Error | typeof Error | string): Chainable<Subject>
5471 /**
5472 * Assert spy did not return the provided value at least once. (see [matchers](http://sinonjs.org/releases/v4.1.3/spies/#matchers))
5473 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyreturnedobj
5474 * @see https://on.cypress.io/assertions
5475 */
5476 (chainer: 'not.returned' | 'not.have.returned', value: any): Chainable<Subject>
5477 /**
5478 * Assert spy was called before anotherSpy, and no spy calls occurred between spy and anotherSpy.
5479 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelybeforeanotherspy
5480 * @see https://on.cypress.io/assertions
5481 */
5482 (chainer: 'not.be.calledImmediatelyBefore' | 'not.have.been.calledImmediatelyBefore', anotherSpy: sinon.SinonSpy): Chainable<Subject>
5483 /**
5484 * Assert spy was called after anotherSpy, and no spy calls occurred between anotherSpy and spy.
5485 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelyafteranotherspy
5486 * @see https://on.cypress.io/assertions
5487 */
5488 (chainer: 'not.be.calledImmediatelyAfter' | 'not.have.been.calledImmediatelyAfter', anotherSpy: sinon.SinonSpy): Chainable<Subject>
5489 /**
5490 * Assert the spy was always called with obj as this
5491 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledonobj
5492 * @see https://on.cypress.io/assertions
5493 */
5494 (chainer: 'not.be.always.calledOn' | 'not.always.have.been.calledOn', obj: any): Chainable<Subject>
5495 /**
5496 * Assert spy was called at least once with the provided arguments.
5497 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
5498 * @see https://on.cypress.io/assertions
5499 */
5500 (chainer: 'not.be.calledWith' | 'not.have.been.calledWith', ...args: any[]): Chainable<Subject>
5501 /**
5502 * Assert spy was always called with the provided arguments (and possibly others).
5503 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwitharg1-arg2-
5504 * @see https://on.cypress.io/assertions
5505 */
5506 (chainer: 'not.be.always.calledWith' | 'not.always.have.been.calledWith', ...args: any[]): Chainable<Subject>
5507 /**
5508 * Assert spy was called at exactly once with the provided arguments.
5509 * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
5510 * @see https://on.cypress.io/assertions
5511 */
5512 (chainer: 'not.be.calledOnceWith' | 'not.have.been.calledOnceWith', ...args: any[]): Chainable<Subject>
5513 /**
5514 * Assert spy was always called with the exact provided arguments.
5515 * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithexactlyarg1-arg2-
5516 * @see https://on.cypress.io/assertions
5517 */
5518 (chainer: 'not.be.always.calledWithExactly' | 'not.have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
5519 /**
5520 * Assert spy was called at exactly once with the provided arguments.
5521 * @see http://sinonjs.org/releases/v4.1.3/spies/#
5522 * @see https://on.cypress.io/assertions
5523 */
5524 (chainer: 'not.be.calledOnceWithExactly' | 'not.have.been.calledOnceWithExactly', ...args: any[]): Chainable<Subject>
5525 /**
5526 * Assert spy always returned the provided value.
5527 * @see http://sinonjs.org/releases/v4.1.3/spies/#
5528 * @see https://on.cypress.io/assertions
5529 */
5530 (chainer: 'not.have.always.returned', obj: any): Chainable<Subject>
5531
5532 // jquery-chai
5533 /**
5534 * Assert that at least one element of the selection is checked, using `.is(':checked')`.
5535 * @example
5536 * cy.get('#result').should('be.checked')
5537 * @see http://chaijs.com/plugins/chai-jquery/#checked
5538 * @see https://on.cypress.io/assertions
5539 */
5540 (chainer: 'be.checked'): Chainable<Subject>
5541 /**
5542 * Assert that at least one element of the selection is disabled, using `.is(':disabled')`.
5543 * @example
5544 * cy.get('#result').should('be.disabled')
5545 * @see http://chaijs.com/plugins/chai-jquery/#disabled
5546 * @see https://on.cypress.io/assertions
5547 */
5548 (chainer: 'be.disabled'): Chainable<Subject>
5549 /**
5550 * Assert that at least one element of the selection is empty, using `.is(':empty')`. If the object asserted against is not a jQuery object, the original implementation will be called.
5551 * @example
5552 * cy.get('#result').should('be.empty')
5553 * @see http://chaijs.com/plugins/chai-jquery/#empty
5554 * @see https://on.cypress.io/assertions
5555 */
5556 (chainer: 'be.empty'): Chainable<Subject>
5557 /**
5558 * Assert that at least one element of the selection is enabled, using `.is(':enabled')`.
5559 * @example
5560 * cy.get('#result').should('be.enabled')
5561 * @see http://chaijs.com/plugins/chai-jquery/#enabled
5562 * @see https://on.cypress.io/assertions
5563 */
5564 (chainer: 'be.enabled'): Chainable<Subject>
5565 /**
5566 * Assert that at least one element of the selection is hidden, using `.is(':hidden')`.
5567 * @example
5568 * cy.get('#result').should('be.hidden')
5569 * @see http://chaijs.com/plugins/chai-jquery/#hidden
5570 * @see https://on.cypress.io/assertions
5571 */
5572 (chainer: 'be.hidden'): Chainable<Subject>
5573 /**
5574 * Assert that at least one element of the selection is selected, using `.is(':selected')`.
5575 * @example
5576 * cy.get('#result').should('be.selected')
5577 * @see http://chaijs.com/plugins/chai-jquery/#selected
5578 * @see https://on.cypress.io/assertions
5579 */
5580 (chainer: 'be.selected'): Chainable<Subject>
5581 /**
5582 * Assert that at least one element of the selection is visible, using `.is(':visible')`.
5583 * @example
5584 * cy.get('#result').should('be.visible')
5585 * @see http://chaijs.com/plugins/chai-jquery/#visible
5586 * @see https://on.cypress.io/assertions
5587 */
5588 (chainer: 'be.visible'): Chainable<Subject>
5589 /**
5590 * Assert that the selection contains the given text, using `:contains()`. If the object asserted against is not a jQuery object, or if `contain` is not called as a function, the original implementation will be called.
5591 * @example
5592 * cy.get('#result').should('contain', 'text')
5593 * @see http://chaijs.com/plugins/chai-jquery/#containtext
5594 * @see https://on.cypress.io/assertions
5595 */
5596 (chainer: 'contain', value: string): Chainable<Subject>
5597 /**
5598 * Assert that at least one element of the selection is focused.
5599 * @example
5600 * cy.get('#result').should('have.focus')
5601 * cy.get('#result').should('be.focused')
5602 * @see https://on.cypress.io/assertions
5603 */
5604 (chainer: 'have.focus'): Chainable<Subject>
5605 /**
5606 * Assert that at least one element of the selection is focused.
5607 * @example
5608 * cy.get('#result').should('be.focused')
5609 * cy.get('#result').should('have.focus')
5610 * @see https://on.cypress.io/assertions
5611 */
5612 (chainer: 'be.focused'): Chainable<Subject>
5613 /**
5614 * Assert that the selection is not empty. Note that this overrides the built-in chai assertion. If the object asserted against is not a jQuery object, the original implementation will be called.
5615 * @example
5616 * cy.get('#result').should('exist')
5617 * @see http://chaijs.com/plugins/chai-jquery/#exist
5618 * @see https://on.cypress.io/assertions
5619 */
5620 (chainer: 'exist'): Chainable<Subject>
5621 /**
5622 * Assert that the first element of the selection has the given attribute, using `.attr()`. Optionally, assert a particular value as well. The return value is available for chaining.
5623 * @example
5624 * cy.get('#result').should('have.attr', 'role')
5625 * cy.get('#result').should('have.attr', 'role', 'menu')
5626 * @see http://chaijs.com/plugins/chai-jquery/#attrname-value
5627 * @see https://on.cypress.io/assertions
5628 */
5629 (chainer: 'have.attr', value: string, match?: string): Chainable<Subject>
5630 /**
5631 * Assert that the first element of the selection has the given attribute, using `.attr()`. Optionally, assert a particular value as well. The return value is available for chaining.
5632 * @example
5633 * cy.get('#result').should('have.class', 'success')
5634 * @see http://chaijs.com/plugins/chai-jquery/#classclassname
5635 * @see https://on.cypress.io/assertions
5636 */
5637 (chainer: 'have.class', value: string): Chainable<Subject>
5638 /**
5639 * Assert that the first element of the selection has the given CSS property, using `.css()`. Optionally, assert a particular value as well. The return value is available for chaining.
5640 * @example
5641 * cy.get('#result').should('have.css', 'display', 'none')
5642 * @see http://chaijs.com/plugins/chai-jquery/#cssname-value
5643 * @see https://on.cypress.io/assertions
5644 */
5645 (chainer: 'have.css', value: string, match?: string): Chainable<Subject>
5646 /**
5647 * Assert that the first element of the selection has the given data value, using `.data()`. Optionally, assert a particular value as well. The return value is available for chaining.
5648 * @example
5649 * cy.get('#result').should('have.data', 'foo', 'bar')
5650 * @see http://chaijs.com/plugins/chai-jquery/#dataname-value
5651 * @see https://on.cypress.io/assertions
5652 */
5653 (chainer: 'have.data', value: string, match?: string): Chainable<Subject>
5654 /**
5655 * Assert that the selection contains at least one element which has a descendant matching the given selector, using `.has()`.
5656 * @example
5657 * cy.get('#result').should('have.descendants', 'h1')
5658 * @see http://chaijs.com/plugins/chai-jquery/#descendantsselector
5659 * @see https://on.cypress.io/assertions
5660 */
5661 (chainer: 'have.descendants', selector: string): Chainable<Subject>
5662 /**
5663 * Assert that the html of the first element of the selection is equal to the given html, using `.html()`.
5664 * @example
5665 * cy.get('#result').should('have.html', '<em>John Doe</em>')
5666 * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
5667 * @see https://on.cypress.io/assertions
5668 */
5669 (chainer: 'have.html', value: string): Chainable<Subject>
5670 /**
5671 * Assert that the html of the first element of the selection partially contains the given html, using `.html()`.
5672 * @example
5673 * cy.get('#result').should('contain.html', '<em>John Doe</em>')
5674 * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
5675 * @see https://on.cypress.io/assertions
5676 */
5677 (chainer: 'contain.html', value: string): Chainable<Subject>
5678 /**
5679 * Assert that the html of the first element of the selection partially contains the given html, using `.html()`.
5680 * @example
5681 * cy.get('#result').should('include.html', '<em>John Doe</em>')
5682 * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
5683 * @see https://on.cypress.io/assertions
5684 */
5685 (chainer: 'include.html', value: string): Chainable<Subject>
5686 /**
5687 * Assert that the first element of the selection has the given id, using `.attr('id')`.
5688 * @example
5689 * cy.get('#result').should('have.id', 'result')
5690 * @see http://chaijs.com/plugins/chai-jquery/#idid
5691 * @see https://on.cypress.io/assertions
5692 */
5693 (chainer: 'have.id', value: string, match?: string): Chainable<Subject>
5694 /**
5695 * Assert that the first element of the selection has the given property, using `.prop()`. Optionally, assert a particular value as well. The return value is available for chaining.
5696 * @example
5697 * cy.get('#result').should('have.prop', 'disabled')
5698 * cy.get('#result').should('have.prop', 'disabled', false)
5699 * @see http://chaijs.com/plugins/chai-jquery/#propname-value
5700 * @see https://on.cypress.io/assertions
5701 */
5702 (chainer: 'have.prop', value: string, match?: any): Chainable<Subject>
5703 /**
5704 * Assert that the text of the first element of the selection is equal to the given text, using `.text()`.
5705 * @example
5706 * cy.get('#result').should('have.text', 'John Doe')
5707 * @see http://chaijs.com/plugins/chai-jquery/#texttext
5708 * @see https://on.cypress.io/assertions
5709 */
5710 (chainer: 'have.text', value: string): Chainable<Subject>
5711 /**
5712 * Assert that the text of the first element of the selection partially contains the given text, using `.text()`.
5713 * @example
5714 * cy.get('#result').should('contain.text', 'John Doe')
5715 * @see http://chaijs.com/plugins/chai-jquery/#texttext
5716 * @see https://on.cypress.io/assertions
5717 */
5718 (chainer: 'contain.text', value: string): Chainable<Subject>
5719 /**
5720 * Assert that the text of the first element of the selection partially contains the given text, using `.text()`.
5721 * @example
5722 * cy.get('#result').should('include.text', 'John Doe')
5723 * @see http://chaijs.com/plugins/chai-jquery/#texttext
5724 * @see https://on.cypress.io/assertions
5725 */
5726 (chainer: 'include.text', value: string): Chainable<Subject>
5727 /**
5728 * Assert that the first element of the selection has the given value, using `.val()`.
5729 * @example
5730 * cy.get('textarea').should('have.value', 'foo bar baz')
5731 * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
5732 * @see https://on.cypress.io/assertions
5733 */
5734 (chainer: 'have.value', value: string): Chainable<Subject>
5735 /**
5736 * Assert that the first element of the selection partially contains the given value, using `.val()`.
5737 * @example
5738 * cy.get('textarea').should('contain.value', 'foo bar baz')
5739 * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
5740 * @see https://on.cypress.io/assertions
5741 */
5742 (chainer: 'contain.value', value: string): Chainable<Subject>
5743 /**
5744 * Assert that the first element of the selection partially contains the given value, using `.val()`.
5745 * @example
5746 * cy.get('textarea').should('include.value', 'foo bar baz')
5747 * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
5748 * @see https://on.cypress.io/assertions
5749 */
5750 (chainer: 'include.value', value: string): Chainable<Subject>
5751 /**
5752 * Assert that the selection matches a given selector, using `.is()`. Note that this overrides the built-in chai assertion. If the object asserted against is not a jQuery object, the original implementation will be called.
5753 * @example
5754 * cy.get('#result').should('match', ':empty')
5755 * @see http://chaijs.com/plugins/chai-jquery/#matchselector
5756 * @see https://on.cypress.io/assertions
5757 */
5758 (chainer: 'match', value: string): Chainable<Subject>
5759
5760 // jquery-chai.not
5761 /**
5762 * Assert that at least one element of the selection is not checked, using `.is(':checked')`.
5763 * @example
5764 * cy.get('#result').should('not.be.checked')
5765 * @see http://chaijs.com/plugins/chai-jquery/#checked
5766 * @see https://on.cypress.io/assertions
5767 */
5768 (chainer: 'not.be.checked'): Chainable<Subject>
5769 /**
5770 * Assert that at least one element of the selection is not disabled, using `.is(':disabled')`.
5771 * @example
5772 * cy.get('#result').should('not.be.disabled')
5773 * @see http://chaijs.com/plugins/chai-jquery/#disabled
5774 * @see https://on.cypress.io/assertions
5775 */
5776 (chainer: 'not.be.disabled'): Chainable<Subject>
5777 /**
5778 * Assert that at least one element of the selection is not empty, using `.is(':empty')`. If the object asserted against is not a jQuery object, the original implementation will be called.
5779 * @example
5780 * cy.get('#result').should('not.be.empty')
5781 * @see http://chaijs.com/plugins/chai-jquery/#empty
5782 * @see https://on.cypress.io/assertions
5783 */
5784 (chainer: 'not.be.empty'): Chainable<Subject>
5785 /**
5786 * Assert that at least one element of the selection is not enabled, using `.is(':enabled')`.
5787 * @example
5788 * cy.get('#result').should('not.be.enabled')
5789 * @see http://chaijs.com/plugins/chai-jquery/#enabled
5790 * @see https://on.cypress.io/assertions
5791 */
5792 (chainer: 'not.be.enabled'): Chainable<Subject>
5793 /**
5794 * Assert that at least one element of the selection is not hidden, using `.is(':hidden')`.
5795 * @example
5796 * cy.get('#result').should('not.be.hidden')
5797 * @see http://chaijs.com/plugins/chai-jquery/#hidden
5798 * @see https://on.cypress.io/assertions
5799 */
5800 (chainer: 'not.be.hidden'): Chainable<Subject>
5801 /**
5802 * Assert that at least one element of the selection is not selected, using `.is(':selected')`.
5803 * @example
5804 * cy.get('#result').should('not.be.selected')
5805 * @see http://chaijs.com/plugins/chai-jquery/#selected
5806 * @see https://on.cypress.io/assertions
5807 */
5808 (chainer: 'not.be.selected'): Chainable<Subject>
5809 /**
5810 * Assert that at least one element of the selection is not visible, using `.is(':visible')`.
5811 * @example
5812 * cy.get('#result').should('not.be.visible')
5813 * @see http://chaijs.com/plugins/chai-jquery/#visible
5814 * @see https://on.cypress.io/assertions
5815 */
5816 (chainer: 'not.be.visible'): Chainable<Subject>
5817 /**
5818 * Assert that no element of the selection is focused.
5819 * @example
5820 * cy.get('#result').should('not.have.focus')
5821 * cy.get('#result').should('not.be.focused')
5822 * @see https://on.cypress.io/assertions
5823 */
5824 (chainer: 'not.have.focus'): Chainable<Subject>
5825 /**
5826 * Assert that no element of the selection is focused.
5827 * @example
5828 * cy.get('#result').should('not.be.focused')
5829 * cy.get('#result').should('not.have.focus')
5830 * @see https://on.cypress.io/assertions
5831 */
5832 (chainer: 'not.be.focused'): Chainable<Subject>
5833 /**
5834 * Assert that the selection does not contain the given text, using `:contains()`. If the object asserted against is not a jQuery object, or if `contain` is not called as a function, the original implementation will be called.
5835 * @example
5836 * cy.get('#result').should('not.contain', 'text')
5837 * @see http://chaijs.com/plugins/chai-jquery/#containtext
5838 * @see https://on.cypress.io/assertions
5839 */
5840 (chainer: 'not.contain', value: string): Chainable<Subject>
5841 /**
5842 * Assert that the selection is empty. Note that this overrides the built-in chai assertion. If the object asserted against is not a jQuery object, the original implementation will be called.
5843 * @example
5844 * cy.get('#result').should('not.exist')
5845 * @see http://chaijs.com/plugins/chai-jquery/#exist
5846 * @see https://on.cypress.io/assertions
5847 */
5848 (chainer: 'not.exist'): Chainable<Subject>
5849 /**
5850 * Assert that the first element of the selection does not have the given attribute, using `.attr()`. Optionally, assert a particular value as well. The return value is available for chaining.
5851 * @example
5852 * cy.get('#result').should('not.have.attr', 'role')
5853 * cy.get('#result').should('not.have.attr', 'role', 'menu')
5854 * @see http://chaijs.com/plugins/chai-jquery/#attrname-value
5855 * @see https://on.cypress.io/assertions
5856 */
5857 (chainer: 'not.have.attr', value: string, match?: string): Chainable<Subject>
5858 /**
5859 * Assert that the first element of the selection does not have the given attribute, using `.attr()`. Optionally, assert a particular value as well. The return value is available for chaining.
5860 * @example
5861 * cy.get('#result').should('not.have.class', 'success')
5862 * @see http://chaijs.com/plugins/chai-jquery/#classclassname
5863 * @see https://on.cypress.io/assertions
5864 */
5865 (chainer: 'not.have.class', value: string): Chainable<Subject>
5866 /**
5867 * Assert that the first element of the selection does not have the given CSS property, using `.css()`. Optionally, assert a particular value as well. The return value is available for chaining.
5868 * @example
5869 * cy.get('#result').should('not.have.css', 'display', 'none')
5870 * @see http://chaijs.com/plugins/chai-jquery/#cssname-value
5871 * @see https://on.cypress.io/assertions
5872 */
5873 (chainer: 'not.have.css', value: string, match?: string): Chainable<Subject>
5874 /**
5875 * Assert that the first element of the selection does not have the given data value, using `.data()`. Optionally, assert a particular value as well. The return value is available for chaining.
5876 * @example
5877 * cy.get('#result').should('not.have.data', 'foo', 'bar')
5878 * @see http://chaijs.com/plugins/chai-jquery/#dataname-value
5879 * @see https://on.cypress.io/assertions
5880 */
5881 (chainer: 'not.have.data', value: string, match?: string): Chainable<Subject>
5882 /**
5883 * Assert that the selection does not contain at least one element which has a descendant matching the given selector, using `.has()`.
5884 * @example
5885 * cy.get('#result').should('not.have.descendants', 'h1')
5886 * @see http://chaijs.com/plugins/chai-jquery/#descendantsselector
5887 * @see https://on.cypress.io/assertions
5888 */
5889 (chainer: 'not.have.descendants', selector: string): Chainable<Subject>
5890 /**
5891 * Assert that the html of the first element of the selection is not equal to the given html, using `.html()`.
5892 * @example
5893 * cy.get('#result').should('not.have.html', '<em>John Doe</em>')
5894 * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
5895 * @see https://on.cypress.io/assertions
5896 */
5897 (chainer: 'not.have.html', value: string): Chainable<Subject>
5898 /**
5899 * Assert that the html of the first element of the selection does not contain the given html, using `.html()`.
5900 * @example
5901 * cy.get('#result').should('not.contain.html', '<em>John Doe</em>')
5902 * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
5903 * @see https://on.cypress.io/assertions
5904 */
5905 (chainer: 'not.contain.html', value: string): Chainable<Subject>
5906 /**
5907 * Assert that the html of the first element of the selection does not contain the given html, using `.html()`.
5908 * @example
5909 * cy.get('#result').should('not.include.html', '<em>John Doe</em>')
5910 * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
5911 * @see https://on.cypress.io/assertions
5912 */
5913 (chainer: 'not.include.html', value: string): Chainable<Subject>
5914 /**
5915 * Assert that the first element of the selection does not have the given id, using `.attr('id')`.
5916 * @example
5917 * cy.get('#result').should('not.have.id', 'result')
5918 * @see http://chaijs.com/plugins/chai-jquery/#idid
5919 * @see https://on.cypress.io/assertions
5920 */
5921 (chainer: 'not.have.id', value: string, match?: string): Chainable<Subject>
5922 /**
5923 * Assert that the first element of the selection does not have the given property, using `.prop()`. Optionally, assert a particular value as well. The return value is available for chaining.
5924 * @example
5925 * cy.get('#result').should('not.have.prop', 'disabled')
5926 * cy.get('#result').should('not.have.prop', 'disabled', false)
5927 * @see http://chaijs.com/plugins/chai-jquery/#propname-value
5928 * @see https://on.cypress.io/assertions
5929 */
5930 (chainer: 'not.have.prop', value: string, match?: any): Chainable<Subject>
5931 /**
5932 * Assert that the text of the first element of the selection is not equal to the given text, using `.text()`.
5933 * @example
5934 * cy.get('#result').should('not.have.text', 'John Doe')
5935 * @see http://chaijs.com/plugins/chai-jquery/#texttext
5936 * @see https://on.cypress.io/assertions
5937 */
5938 (chainer: 'not.have.text', value: string): Chainable<Subject>
5939 /**
5940 * Assert that the text of the first element of the selection does not contain the given text, using `.text()`.
5941 * @example
5942 * cy.get('#result').should('not.contain.text', 'John Doe')
5943 * @see http://chaijs.com/plugins/chai-jquery/#texttext
5944 * @see https://on.cypress.io/assertions
5945 */
5946 (chainer: 'not.contain.text', value: string): Chainable<Subject>
5947 /**
5948 * Assert that the text of the first element of the selection does not contain the given text, using `.text()`.
5949 * @example
5950 * cy.get('#result').should('not.include.text', 'John Doe')
5951 * @see http://chaijs.com/plugins/chai-jquery/#texttext
5952 * @see https://on.cypress.io/assertions
5953 */
5954 (chainer: 'not.include.text', value: string): Chainable<Subject>
5955 /**
5956 * Assert that the first element of the selection does not have the given value, using `.val()`.
5957 * @example
5958 * cy.get('textarea').should('not.have.value', 'foo bar baz')
5959 * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
5960 * @see https://on.cypress.io/assertions
5961 */
5962 (chainer: 'not.have.value', value: string): Chainable<Subject>
5963 /**
5964 * Assert that the first element of the selection does not contain the given value, using `.val()`.
5965 * @example
5966 * cy.get('textarea').should('not.contain.value', 'foo bar baz')
5967 * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
5968 * @see https://on.cypress.io/assertions
5969 */
5970 (chainer: 'not.contain.value', value: string): Chainable<Subject>
5971 /**
5972 * Assert that the first element of the selection does not contain the given value, using `.val()`.
5973 * @example
5974 * cy.get('textarea').should('not.include.value', 'foo bar baz')
5975 * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
5976 * @see https://on.cypress.io/assertions
5977 */
5978 (chainer: 'not.include.value', value: string): Chainable<Subject>
5979 /**
5980 * Assert that the selection does not match a given selector, using `.is()`. Note that this overrides the built-in chai assertion. If the object asserted against is not a jQuery object, the original implementation will be called.
5981 * @example
5982 * cy.get('#result').should('not.match', ':empty')
5983 * @see http://chaijs.com/plugins/chai-jquery/#matchselector
5984 * @see https://on.cypress.io/assertions
5985 */
5986 (chainer: 'not.match', value: string): Chainable<Subject>
5987
5988 // fallback
5989 /**
5990 * Create an assertion. Assertions are automatically retried until they pass or time out.
5991 * Ctrl+Space will invoke auto-complete in most editors.
5992 * @see https://on.cypress.io/should
5993 */
5994 (chainers: string, value?: any): Chainable<Subject>
5995 (chainers: string, value: any, match: any): Chainable<Subject>
5996
5997 /**
5998 * Create an assertion. Assertions are automatically retried until they pass or time out.
5999 * 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.
6000 * 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.
6001 * @example
6002 * cy
6003 * .get('p')
6004 * .should(($p) => {
6005 * // should have found 3 elements
6006 * expect($p).to.have.length(3)
6007 *
6008 * // make sure the first contains some text content
6009 * expect($p.first()).to.contain('Hello World')
6010 *
6011 * // use jquery's map to grab all of their classes
6012 * // jquery's map returns a new jquery object
6013 * const classes = $p.map((i, el) => {
6014 * return Cypress.$(el).attr('class')
6015 * })
6016 *
6017 * // call classes.get() to make this a plain array
6018 * expect(classes.get()).to.deep.eq([
6019 * 'text-primary',
6020 * 'text-danger',
6021 * 'text-default'
6022 * ])
6023 * })
6024 * @see https://on.cypress.io/should
6025 */
6026 (fn: (currentSubject: Subject) => void): Chainable<Subject>
6027 }
6028
6029 interface AfterBrowserLaunchDetails {
6030 webSocketDebuggerUrl: string
6031 }
6032
6033 interface BeforeBrowserLaunchOptions {
6034 extensions: string[]
6035 preferences: { [key: string]: any }
6036 args: string[]
6037 env: { [key: string]: any }
6038 }
6039
6040 interface Dimensions {
6041 width: number
6042 height: number
6043 }
6044
6045 interface ScreenshotDetails {
6046 size: number
6047 takenAt: string
6048 duration: number
6049 dimensions: Dimensions
6050 multipart: boolean
6051 pixelRatio: number
6052 name: string
6053 specName: string
6054 testFailure: boolean
6055 path: string
6056 scaled: boolean
6057 blackout: string[]
6058 }
6059
6060 interface AfterScreenshotReturnObject {
6061 path?: string
6062 size?: number
6063 dimensions?: Dimensions
6064 }
6065
6066 interface FileObject extends NodeEventEmitter {
6067 filePath: string
6068 outputPath: string
6069 shouldWatch: boolean
6070 }
6071
6072 /**
6073 * Individual task callback. Receives a single argument and _should_ return
6074 * anything but `undefined` or a promise that resolves anything but `undefined`
6075 * TODO: find a way to express "anything but undefined" in TypeScript
6076 */
6077 type Task = (value: any) => any
6078
6079 interface Tasks {
6080 [key: string]: Task
6081 }
6082
6083 interface SystemDetails {
6084 osName: string
6085 osVersion: string
6086 }
6087
6088 interface BeforeRunDetails {
6089 browser?: Browser
6090 config: ConfigOptions
6091 cypressVersion: string
6092 group?: string
6093 parallel?: boolean
6094 runUrl?: string
6095 specs?: Spec[]
6096 specPattern?: string[]
6097 system: SystemDetails
6098 tag?: string
6099 autoCancelAfterFailures?: number | false
6100 }
6101
6102 interface DevServerConfig {
6103 specs: Spec[]
6104 cypressConfig: PluginConfigOptions
6105 devServerEvents: NodeJS.EventEmitter
6106 }
6107
6108 interface ResolvedDevServerConfig {
6109 port: number
6110 close: (done?: (err?: Error) => any) => void
6111 }
6112
6113 interface PluginEvents {
6114 (action: 'after:browser:launch', fn: (browser: Browser, browserLaunchDetails: AfterBrowserLaunchDetails) => void | Promise<void>): void
6115 (action: 'after:run', fn: (results: CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult) => void | Promise<void>): void
6116 (action: 'after:screenshot', fn: (details: ScreenshotDetails) => void | AfterScreenshotReturnObject | Promise<AfterScreenshotReturnObject>): void
6117 (action: 'after:spec', fn: (spec: Spec, results: CypressCommandLine.RunResult) => void | Promise<void>): void
6118 (action: 'before:run', fn: (runDetails: BeforeRunDetails) => void | Promise<void>): void
6119 (action: 'before:spec', fn: (spec: Spec) => void | Promise<void>): void
6120 (action: 'before:browser:launch', fn: (browser: Browser, afterBrowserLaunchOptions: BeforeBrowserLaunchOptions) => void | Promise<void> | BeforeBrowserLaunchOptions | Promise<BeforeBrowserLaunchOptions>): void
6121 (action: 'file:preprocessor', fn: (file: FileObject) => string | Promise<string>): void
6122 (action: 'dev-server:start', fn: (file: DevServerConfig) => Promise<ResolvedDevServerConfig>): void
6123 (action: 'task', tasks: Tasks): void
6124 }
6125
6126 interface CodeFrame {
6127 frame: string
6128 language: string
6129 line: number
6130 column: number
6131 absoluteFile: string
6132 originalFile: string
6133 relativeFile: string
6134 }
6135
6136 interface CypressError extends Error {
6137 docsUrl?: string
6138 codeFrame?: CodeFrame
6139 }
6140
6141 // for just a few events like "window:alert" it makes sense to allow passing cy.stub() or
6142 // a user callback function. Others probably only need a callback function.
6143
6144 /**
6145 * These events come from the application currently under test (your application).
6146 * These are the most useful events for you to listen to.
6147 * @see https://on.cypress.io/catalog-of-events#App-Events
6148 */
6149 interface Actions {
6150 /**
6151 * Fires when an uncaught exception or unhandled rejection occurs in your application. If it's an unhandled rejection, the rejected promise will be the 3rd argument.
6152 * Cypress will fail the test when this fires.
6153 * Return `false` from this event and Cypress will not fail the test. Also useful for debugging purposes because the actual `error` instance is provided to you.
6154 * @see https://on.cypress.io/catalog-of-events#App-Events
6155 * @example
6156 ```
6157 // likely want to do this in a support file
6158 // so it's applied to all spec files
6159 // cypress/support/{e2e|component}.js
6160
6161 Cypress.on('uncaught:exception', (err, runnable) => {
6162 // returning false here prevents Cypress from
6163 // failing the test
6164 return false
6165 })
6166 // stub "window.alert" in a single test
6167 it('shows alert', () => {
6168 const stub = cy.stub()
6169 cy.on('window:alert', stub)
6170 // trigger application code that calls alert(...)
6171 .then(() => {
6172 expect(stub).to.have.been.calledOnce
6173 })
6174 })
6175 ```
6176 */
6177 (action: 'uncaught:exception', fn: (error: Error, runnable: Mocha.Runnable, promise?: Promise<any>) => false | void): Cypress
6178 /**
6179 * Fires when your app calls the global `window.confirm()` method.
6180 * Cypress will auto accept confirmations. Return `false` from this event and the confirmation will be canceled.
6181 * @see https://on.cypress.io/catalog-of-events#App-Events
6182 * @example
6183 ```
6184 cy.on('window:confirm', (str) => {
6185 console.log(str)
6186 return false // simulate "Cancel"
6187 })
6188 ```
6189 */
6190 (action: 'window:confirm', fn: ((text: string) => false | void) | SinonSpyAgent<sinon.SinonSpy> | SinonSpyAgent<sinon.SinonStub>): Cypress
6191 /**
6192 * Fires when your app calls the global `window.alert()` method.
6193 * Cypress will auto accept alerts. You cannot change this behavior.
6194 * @example
6195 ```
6196 const stub = cy.stub()
6197 cy.on('window:alert', stub)
6198 // assume the button calls window.alert()
6199 cy.get('.my-button')
6200 .click()
6201 .then(() => {
6202 expect(stub).to.have.been.calledOnce
6203 })
6204 ```
6205 * @see https://on.cypress.io/catalog-of-events#App-Events
6206 */
6207 (action: 'window:alert', fn: ((text: string) => void) | SinonSpyAgent<sinon.SinonSpy> | SinonSpyAgent<sinon.SinonStub>): Cypress
6208 /**
6209 * Fires as the page begins to load, but before any of your applications JavaScript has executed.
6210 * This fires at the exact same time as `cy.visit()` `onBeforeLoad` callback.
6211 * Useful to modify the window on a page transition.
6212 * @see https://on.cypress.io/catalog-of-events#App-Events
6213 */
6214 (action: 'window:before:load', fn: (win: AUTWindow) => void): Cypress
6215 /**
6216 * Fires after all your resources have finished loading after a page transition.
6217 * This fires at the exact same time as a `cy.visit()` `onLoad` callback.
6218 * @see https://on.cypress.io/catalog-of-events#App-Events
6219 */
6220 (action: 'window:load', fn: (win: AUTWindow) => void): Cypress
6221 /**
6222 * Fires when your application is about to navigate away.
6223 * The real event object is provided to you.
6224 * Your app may have set a `returnValue` on the event, which is useful to assert on.
6225 * @see https://on.cypress.io/catalog-of-events#App-Events
6226 */
6227 (action: 'window:before:unload', fn: (event: BeforeUnloadEvent) => void): Cypress
6228 /**
6229 * Fires when your application is has unloaded and is navigating away.
6230 * The real event object is provided to you. This event is not cancelable.
6231 * @see https://on.cypress.io/catalog-of-events#App-Events
6232 */
6233 (action: 'window:unload', fn: (event: Event) => void): Cypress
6234 /**
6235 * Fires whenever Cypress detects that your application's URL has changed.
6236 * @see https://on.cypress.io/catalog-of-events#App-Events
6237 */
6238 (action: 'url:changed', fn: (url: string) => void): Cypress
6239 /**
6240 * Fires when the test has failed. It is technically possible to prevent the test
6241 * from actually failing by binding to this event and invoking an async `done` callback.
6242 * However this is **strongly discouraged**. Tests should never legitimately fail.
6243 * This event exists because it's extremely useful for debugging purposes.
6244 * @see https://on.cypress.io/catalog-of-events#App-Events
6245 */
6246 (action: 'fail', fn: (error: CypressError, mocha: Mocha.Runnable) => void): Cypress
6247 /**
6248 * Fires whenever the viewport changes via a `cy.viewport()` or naturally when
6249 * Cypress resets the viewport to the default between tests. Useful for debugging purposes.
6250 * @see https://on.cypress.io/catalog-of-events#App-Events
6251 */
6252 (action: 'viewport:changed', fn: (viewport: Viewport) => void): Cypress
6253 /**
6254 * Fires whenever **Cypress** is scrolling your application.
6255 * This event is fired when Cypress is {% url 'waiting for and calculating
6256 * actionability' interacting-with-elements %}. It will scroll to 'uncover'
6257 * elements currently being covered. This event is extremely useful to debug why
6258 * Cypress may think an element is not interactive.
6259 * @see https://on.cypress.io/catalog-of-events#App-Events
6260 */
6261 (action: 'scrolled', fn: ($el: JQuery) => void): Cypress
6262 /**
6263 * Fires when a cy command is first invoked and enqueued to be run later.
6264 * Useful for debugging purposes if you're confused about the order in which commands will execute.
6265 * @see https://on.cypress.io/catalog-of-events#App-Events
6266 */
6267 (action: 'command:enqueued', fn: (command: EnqueuedCommandAttributes) => void): Cypress
6268 /**
6269 * Fires when cy begins actually running and executing your command.
6270 * Useful for debugging and understanding how the command queue is async.
6271 * @see https://on.cypress.io/catalog-of-events#App-Events
6272 */
6273 (action: 'command:start', fn: (command: CommandQueue) => void): Cypress
6274 /**
6275 * Fires when cy finishes running and executing your command.
6276 * Useful for debugging and understanding how commands are handled.
6277 * @see https://on.cypress.io/catalog-of-events#App-Events
6278 */
6279 (action: 'command:end', fn: (command: CommandQueue) => void): Cypress
6280 /**
6281 * Fires when a command is skipped, namely the `should` command.
6282 * Useful for debugging and understanding how commands are handled.
6283 * @see https://on.cypress.io/catalog-of-events#App-Events
6284 */
6285 (action: 'skipped:command:end', fn: (command: CommandQueue) => void): Cypress
6286 /**
6287 * Fires whenever a command begins its retrying routines.
6288 * This is called on the trailing edge after Cypress has internally
6289 * waited for the retry interval. Useful to understand **why** a command is retrying,
6290 * and generally includes the actual error causing the retry to happen.
6291 * When commands fail the final error is the one that actually bubbles up to fail the test.
6292 * This event is essentially to debug why Cypress is failing.
6293 * @see https://on.cypress.io/catalog-of-events#App-Events
6294 */
6295 (action: 'command:retry', fn: (command: CommandQueue) => void): Cypress
6296 /**
6297 * Fires whenever a command emits this event so it can be displayed in the Command Log.
6298 * Useful to see how internal cypress commands utilize the {% url 'Cypress.log()' cypress-log %} API.
6299 * @see https://on.cypress.io/catalog-of-events#App-Events
6300 */
6301 (action: 'log:added', fn: (attributes: ObjectLike, log: any) => void): Cypress
6302 /**
6303 * Fires whenever a command's attributes changes.
6304 * This event is debounced to prevent it from firing too quickly and too often.
6305 * Useful to see how internal cypress commands utilize the {% url 'Cypress.log()' cypress-log %} API.
6306 * @see https://on.cypress.io/catalog-of-events#App-Events
6307 */
6308 (action: 'log:changed', fn: (attributes: ObjectLike, log: any) => void): Cypress
6309 /**
6310 * Fires before the test and all **before** and **beforeEach** hooks run.
6311 * @see https://on.cypress.io/catalog-of-events#App-Events
6312 */
6313 (action: 'test:before:run', fn: (attributes: ObjectLike, test: Mocha.Test) => void): Cypress
6314 /**
6315 * Fires before the test and all **before** and **beforeEach** hooks run.
6316 * If a `Promise` is returned, it will be awaited before proceeding.
6317 */
6318 (action: 'test:before:run:async', fn: (attributes: ObjectLike, test: Mocha.Test) => void | Promise<any>): Cypress
6319 /**
6320 * Fires after the test and all **afterEach** and **after** hooks run.
6321 * @see https://on.cypress.io/catalog-of-events#App-Events
6322 */
6323 (action: 'test:after:run', fn: (attributes: ObjectLike, test: Mocha.Test) => void): Cypress
6324 }
6325
6326 // $CommandQueue from `command_queue.coffee` - a lot to type. Might be more useful if it was written in TS
6327 interface CommandQueue extends ObjectLike {
6328 logs(filters: any): any
6329 add(obj: any): any
6330 get(): any
6331 get<K extends keyof CommandQueue>(key: string): CommandQueue[K]
6332 toJSON(): string[]
6333 create(): CommandQueue
6334 }
6335
6336 /**
6337 * The clock starts at the unix epoch (timestamp of 0). This means that when you instantiate new Date in your application, it will have a time of January 1st, 1970.
6338 */
6339 interface Clock {
6340 /**
6341 * Move the clock the specified number of `milliseconds`.
6342 * Any timers within the affected range of time will be called.
6343 * @param time Number in ms to advance the clock
6344 * @see https://on.cypress.io/tick
6345 */
6346 tick(time: number): void
6347 /**
6348 * Restore all overridden native functions.
6349 * This is automatically called between tests, so should not generally be needed.
6350 * @see https://on.cypress.io/clock
6351 * @example
6352 * cy.clock()
6353 * cy.visit('/')
6354 * ...
6355 * cy.clock().then(clock => {
6356 * clock.restore()
6357 * })
6358 * // or use this shortcut
6359 * cy.clock().invoke('restore')
6360 */
6361 restore(): void
6362 /**
6363 * Change the time without invoking any timers.
6364 *
6365 * Default value with no argument or undefined is 0.
6366 *
6367 * This can be useful if you need to change the time by an hour
6368 * while there is a setInterval registered that may otherwise run thousands
6369 * of times.
6370 * @see https://on.cypress.io/clock
6371 * @example
6372 * cy.clock()
6373 * cy.visit('/')
6374 * ...
6375 * cy.clock().then(clock => {
6376 * clock.setSystemTime(60 * 60 * 1000)
6377 * })
6378 * // or use this shortcut
6379 * cy.clock().invoke('setSystemTime', 60 * 60 * 1000)
6380 */
6381 setSystemTime(now?: number | Date): void
6382 }
6383
6384 interface Cookie {
6385 name: string
6386 value: string
6387 path: string
6388 domain: string
6389 hostOnly?: boolean
6390 httpOnly: boolean
6391 secure: boolean
6392 expiry?: number
6393 sameSite?: SameSiteStatus
6394 }
6395
6396 interface EnqueuedCommandAttributes {
6397 id: string
6398 name: string
6399 args: any[]
6400 type: string
6401 chainerId: string
6402 injected: boolean
6403 userInvocationStack?: string
6404 query?: boolean
6405 fn(...args: any[]): any
6406 }
6407
6408 interface Command {
6409 get<K extends keyof EnqueuedCommandAttributes>(attr: K): EnqueuedCommandAttributes[K]
6410 get(): EnqueuedCommandAttributes
6411 set<K extends keyof EnqueuedCommandAttributes>(key: K, value: EnqueuedCommandAttributes[K]): Log
6412 set(options: Partial<EnqueuedCommandAttributes>): Log
6413 }
6414
6415 interface Exec {
6416 code: number
6417 stdout: string
6418 stderr: string
6419 }
6420
6421 type TypedArray =
6422 | Int8Array
6423 | Uint8Array
6424 | Uint8ClampedArray
6425 | Int16Array
6426 | Uint16Array
6427 | Int32Array
6428 | Uint32Array
6429 | Float32Array
6430 | Float64Array
6431
6432 type FileReference = string | BufferType | FileReferenceObject | TypedArray
6433 interface FileReferenceObject {
6434 /*
6435 * Buffers will be used as-is, while strings will be interpreted as an alias or a file path.
6436 * All other types will have `Buffer.from(JSON.stringify())` applied.
6437 */
6438 contents: any
6439 fileName?: string
6440 mimeType?: string
6441 lastModified?: number
6442 }
6443
6444 interface LogAttrs {
6445 url: string
6446 consoleProps: ObjectLike
6447 }
6448
6449 interface Log {
6450 end(): Log
6451 error(error: Error): Log
6452 finish(): void
6453 get<K extends keyof LogConfig>(attr: K): LogConfig[K]
6454 get(): LogConfig
6455 set<K extends keyof LogConfig>(key: K, value: LogConfig[K]): Log
6456 set(options: Partial<LogConfig>): Log
6457 snapshot(name?: string, options?: { at?: number, next: string }): Log
6458 }
6459
6460 interface LogConfig extends Timeoutable {
6461 /** Unique id for the log, in the form of '<origin>-<number>' */
6462 id: string
6463 /** The JQuery element for the command. This will highlight the command in the main window when debugging */
6464 $el: JQuery
6465 /** The scope of the log entry. If child, will appear nested below parents, prefixed with '-' */
6466 type: 'parent' | 'child'
6467 /** Allows the name of the command to be overwritten */
6468 name: string
6469 /** Override *name* for display purposes only */
6470 displayName: string
6471 /** additional information to include in the log */
6472 message: any
6473 /** Set to false if you want to control the finishing of the command in the log yourself */
6474 autoEnd: boolean
6475 /** Set to true to immediately finish the log */
6476 end: boolean
6477 /** Return an object that will be printed in the dev tools console */
6478 consoleProps(): ObjectLike
6479 }
6480
6481 interface Response<T> {
6482 allRequestResponses: any[]
6483 body: T
6484 duration: number
6485 headers: { [key: string]: string | string[] }
6486 isOkStatusCode: boolean
6487 redirects?: string[]
6488 redirectedToUrl?: string
6489 requestHeaders: { [key: string]: string }
6490 status: number
6491 statusText: string
6492 }
6493
6494 interface Server extends RouteOptions {
6495 enable: boolean
6496 ignore: (xhr: any) => boolean
6497 }
6498
6499 interface Viewport {
6500 viewportWidth: number
6501 viewportHeight: number
6502 }
6503
6504 type Encodings = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'utf8' | 'utf-8' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' | null
6505 type PositionType = 'topLeft' | 'top' | 'topRight' | 'left' | 'center' | 'right' | 'bottomLeft' | 'bottom' | 'bottomRight'
6506 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'
6507 interface Offset {
6508 top: number
6509 left: number
6510 }
6511
6512 // Diff taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
6513 type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]
6514 type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
6515
6516 /**
6517 * Public interface for the global "cy" object. If you want to add
6518 * a custom property to this object, you should extend this interface.
6519 * @see https://on.cypress.io/typescript#Types-for-custom-commands
6520 *
6521 ```
6522 // in your TS file
6523 declare namespace Cypress {
6524 interface cy {
6525 // declare additional properties on "cy" object, like
6526 // label: string
6527 }
6528 interface Chainable {
6529 // declare additional custom commands as methods, like
6530 // login(username: string, password: string)
6531 }
6532 }
6533 ```
6534 */
6535 interface cy extends Chainable<undefined> { }
6536}
6537
6538declare namespace Mocha {
6539 interface TestFunction {
6540 /**
6541 * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
6542 * as a thunk.
6543 */
6544 (title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
6545
6546 /**
6547 * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
6548 * as a thunk.
6549 */
6550 (title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
6551 }
6552 interface ExclusiveTestFunction {
6553 /**
6554 * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
6555 * as a thunk.
6556 */
6557 (title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
6558
6559 /**
6560 * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
6561 * as a thunk.
6562 */
6563 (title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
6564 }
6565 interface PendingTestFunction {
6566 /**
6567 * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
6568 * as a thunk.
6569 */
6570 (title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
6571
6572 /**
6573 * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
6574 * as a thunk.
6575 */
6576 (title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
6577 }
6578
6579 interface SuiteFunction {
6580 /**
6581 * Describe a "suite" with the given `title`, TestOptions, and callback `fn` containing
6582 * nested suites.
6583 */
6584 (title: string, config: Cypress.SuiteConfigOverrides, fn: (this: Suite) => void): Suite
6585 }
6586
6587 interface ExclusiveSuiteFunction {
6588 /**
6589 * Describe a "suite" with the given `title`, TestOptions, and callback `fn` containing
6590 * nested suites. Indicates this suite should be executed exclusively.
6591 */
6592 (title: string, config: Cypress.SuiteConfigOverrides, fn: (this: Suite) => void): Suite
6593 }
6594
6595 interface PendingSuiteFunction {
6596 (title: string, config: Cypress.SuiteConfigOverrides, fn: (this: Suite) => void): Suite | void
6597 }
6598}
6599
\No newline at end of file