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 |
|
6 | declare 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 | * //on.cypress.io/dblclick
https: |
1236 | *
|
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 | interface EndToEndConfigOptions extends Omit<CoreConfigOptions, 'indexHtmlFile'> {
|
3222 | /**
|
3223 | * Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially.
|
3224 | * @default false
|
3225 | */
|
3226 | experimentalRunAllSpecs?: boolean
|
3227 | /**
|
3228 | * Enables support for `Cypress.require()` for including dependencies within the `cy.origin()` callback.
|
3229 | * @default false
|
3230 | */
|
3231 | experimentalOriginDependencies?: boolean
|
3232 | }
|
3233 |
|
3234 | /**
|
3235 | * Options appended to config object on runtime.
|
3236 | */
|
3237 | interface RuntimeConfigOptions extends Partial<RuntimeServerConfigOptions> {
|
3238 | /**
|
3239 | * Absolute path to the config file (default: <projectRoot>/cypress.config.{js,ts,mjs,cjs})
|
3240 | */
|
3241 | configFile: string
|
3242 | /**
|
3243 | * CPU architecture, from Node `os.arch()`
|
3244 | *
|
3245 | * @see https://nodejs.org/api/os.html#os_os_arch
|
3246 | */
|
3247 | arch: string
|
3248 | /**
|
3249 | * Available browsers found on your system.
|
3250 | */
|
3251 | browsers: Browser[]
|
3252 | /**
|
3253 | * Hosts mappings to IP addresses.
|
3254 | */
|
3255 | hosts: null | { [key: string]: string }
|
3256 | /**
|
3257 | * Whether Cypress was launched via 'cypress open' (interactive mode)
|
3258 | */
|
3259 | isInteractive: boolean
|
3260 | /**
|
3261 | * The platform Cypress is running on.
|
3262 | */
|
3263 | platform: 'linux' | 'darwin' | 'win32'
|
3264 | remote: RemoteState
|
3265 | /**
|
3266 | * The Cypress version being used.
|
3267 | */
|
3268 | version: string
|
3269 |
|
3270 | // Internal or Unlisted at server/lib/config_options
|
3271 | namespace: string
|
3272 | projectRoot: string
|
3273 | repoRoot: string | null
|
3274 | devServerPublicPathRoute: string
|
3275 | cypressBinaryRoot: string
|
3276 | }
|
3277 |
|
3278 | /**
|
3279 | * Optional options added before the server starts
|
3280 | */
|
3281 | interface RuntimeServerConfigOptions {
|
3282 | /**
|
3283 | * The browser Cypress is running on.
|
3284 | */
|
3285 | browser: Browser
|
3286 | // Internal or Unlisted at server/lib/config_options
|
3287 | autoOpen: boolean
|
3288 | browserUrl: string
|
3289 | clientRoute: string
|
3290 | cypressEnv: string
|
3291 | isNewProject: boolean
|
3292 | isTextTerminal: boolean
|
3293 | morgan: boolean
|
3294 | parentTestsFolder: string
|
3295 | parentTestsFolderDisplay: string
|
3296 | projectName: string
|
3297 | proxyUrl: string
|
3298 | remote: RemoteState
|
3299 | report: boolean
|
3300 | reporterRoute: string
|
3301 | reporterUrl: string
|
3302 | socketId: null | string
|
3303 | socketIoCookie: string
|
3304 | socketIoRoute: string
|
3305 | spec: Cypress['spec'] | null
|
3306 | specs: Array<Cypress['spec']>
|
3307 | protocolEnabled: boolean
|
3308 | hideCommandLog: boolean
|
3309 | hideRunnerUi: boolean
|
3310 | }
|
3311 |
|
3312 | interface SuiteConfigOverrides extends Partial<
|
3313 | Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>
|
3314 | >, Partial<Pick<ResolvedConfigOptions, 'baseUrl' | 'testIsolation'>> {
|
3315 | browser?: IsBrowserMatcher | IsBrowserMatcher[]
|
3316 | keystrokeDelay?: number
|
3317 | }
|
3318 |
|
3319 | interface TestConfigOverrides extends Partial<
|
3320 | Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>
|
3321 | >, Partial<Pick<ResolvedConfigOptions, 'baseUrl'>> {
|
3322 | browser?: IsBrowserMatcher | IsBrowserMatcher[]
|
3323 | keystrokeDelay?: number
|
3324 | }
|
3325 |
|
3326 | /**
|
3327 | * All configuration items are optional.
|
3328 | */
|
3329 | type CoreConfigOptions = Partial<Omit<ResolvedConfigOptions, TestingType>>
|
3330 |
|
3331 | interface DefineDevServerConfig {
|
3332 | // This interface can be extended by the user, to inject the types for their
|
3333 | // preferred bundler: e.g.
|
3334 | //
|
3335 | // import type * as webpack from 'webpack'
|
3336 | //
|
3337 | // declare global {
|
3338 | // namespace Cypress {
|
3339 | // interface DefineDevServerConfig {
|
3340 | // webpackConfig?: webpack.Configuration
|
3341 | // }
|
3342 | // }
|
3343 | // }
|
3344 | [key: string]: any
|
3345 | }
|
3346 |
|
3347 | type PickConfigOpt<T> = T extends keyof DefineDevServerConfig ? DefineDevServerConfig[T] : any
|
3348 |
|
3349 | interface DependencyToInstall {
|
3350 | dependency: CypressComponentDependency
|
3351 | satisfied: boolean
|
3352 | detectedVersion: string | null
|
3353 | }
|
3354 |
|
3355 | interface CypressComponentDependency {
|
3356 | /**
|
3357 | * Unique identifier.
|
3358 | * @example 'reactscripts'
|
3359 | */
|
3360 | type: string
|
3361 |
|
3362 | /**
|
3363 | * Name to display in the user interface.
|
3364 | * @example "React Scripts"
|
3365 | */
|
3366 | name: string
|
3367 |
|
3368 | /**
|
3369 | * Package name on npm.
|
3370 | * @example react-scripts
|
3371 | */
|
3372 | package: string
|
3373 |
|
3374 | /**
|
3375 | * Code to run when installing. Version is optional.
|
3376 | *
|
3377 | * Should be <package_name>@<version>.
|
3378 | *
|
3379 | * @example `react`
|
3380 | * @example `react@18`
|
3381 | * @example `react-scripts`
|
3382 | */
|
3383 | installer: string
|
3384 |
|
3385 | /**
|
3386 | * Description shown in UI. It is recommended to use the same one the package uses on npm.
|
3387 | * @example 'Create React apps with no build configuration'
|
3388 | */
|
3389 | description: string
|
3390 |
|
3391 | /**
|
3392 | * Minimum version supported. Should conform to Semantic Versioning as used in `package.json`.
|
3393 | * @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#dependencies
|
3394 | * @example '^=4.0.0 || ^=5.0.0'
|
3395 | * @example '^2.0.0'
|
3396 | */
|
3397 | minVersion: string
|
3398 | }
|
3399 |
|
3400 | interface ResolvedComponentFrameworkDefinition {
|
3401 | /**
|
3402 | * A semantic, unique identifier.
|
3403 | * Must begin with `cypress-ct-` or `@org/cypress-ct-` for third party implementations.
|
3404 | * @example 'reactscripts'
|
3405 | * @example 'nextjs'
|
3406 | * @example 'cypress-ct-solid-js'
|
3407 | */
|
3408 | type: string
|
3409 |
|
3410 | /**
|
3411 | * Used as the flag for `getPreset` for meta framworks, such as finding the webpack config for CRA, Angular, etc.
|
3412 | * It is also the name of the string added to `cypress.config`
|
3413 | *
|
3414 | * @example
|
3415 | * export default {
|
3416 | * component: {
|
3417 | * devServer: {
|
3418 | * framework: 'create-react-app' // can be 'next', 'create-react-app', etc etc.
|
3419 | * }
|
3420 | * }
|
3421 | * }
|
3422 | */
|
3423 | configFramework: string
|
3424 |
|
3425 | /**
|
3426 | * Library (React, Vue) or template (aka "meta framework") (CRA, Next.js, Angular)
|
3427 | */
|
3428 | category: 'library' | 'template'
|
3429 |
|
3430 | /**
|
3431 | * Name displayed in Launchpad when doing initial setup.
|
3432 | * @example 'Solid.js'
|
3433 | * @example 'Create React App'
|
3434 | */
|
3435 | name: string
|
3436 |
|
3437 | /**
|
3438 | * Supported bundlers.
|
3439 | */
|
3440 | supportedBundlers: Array<'webpack' | 'vite'>
|
3441 |
|
3442 | /**
|
3443 | * Used to attempt to automatically select the correct framework/bundler from the dropdown.
|
3444 | *
|
3445 | * @example
|
3446 | * const SOLID_DETECTOR: Dependency = {
|
3447 | * type: 'solid',
|
3448 | * name: 'Solid.js',
|
3449 | * package: 'solid-js',
|
3450 | * installer: 'solid-js',
|
3451 | * description: 'Solid is a declarative JavaScript library for creating user interfaces',
|
3452 | * minVersion: '^1.0.0',
|
3453 | * }
|
3454 | */
|
3455 | detectors: CypressComponentDependency[]
|
3456 |
|
3457 | /**
|
3458 | * Array of required dependencies. This could be the bundler and JavaScript library.
|
3459 | */
|
3460 | dependencies: (bundler: 'webpack' | 'vite', projectPath: string) => Promise<DependencyToInstall[]>
|
3461 |
|
3462 | /**
|
3463 | * This is used interally by Cypress for the "Create From Component" feature.
|
3464 | */
|
3465 | codeGenFramework?: 'react' | 'vue' | 'svelte' | 'angular'
|
3466 |
|
3467 | /**
|
3468 | * This is used interally by Cypress for the "Create From Component" feature.
|
3469 | * @example '*.{js,jsx,tsx}'
|
3470 | */
|
3471 | glob?: string
|
3472 |
|
3473 | /**
|
3474 | * This is the path to get mount, eg `import { mount } from <mount_module>,
|
3475 | * @example: `cypress-ct-solidjs/src/mount`
|
3476 | */
|
3477 | mountModule: (projectPath: string) => Promise<string>
|
3478 |
|
3479 | /**
|
3480 | * Support status. Internally alpha | beta | full.
|
3481 | * Community integrations are "community".
|
3482 | */
|
3483 | supportStatus: 'alpha' | 'beta' | 'full' | 'community'
|
3484 |
|
3485 | /**
|
3486 | * Function returning string for used for the component-index.html file.
|
3487 | * Cypress provides a default if one isn't specified for third party integrations.
|
3488 | */
|
3489 | componentIndexHtml?: () => string
|
3490 |
|
3491 | /**
|
3492 | * Used for the Create From Component feature.
|
3493 | * This is currently not supported for third party frameworks.
|
3494 | */
|
3495 | specPattern?: '**/*.cy.ts'
|
3496 | }
|
3497 |
|
3498 | type ComponentFrameworkDefinition = Omit<ResolvedComponentFrameworkDefinition, 'dependencies'> & {
|
3499 | dependencies: (bundler: 'webpack' | 'vite') => CypressComponentDependency[]
|
3500 | }
|
3501 |
|
3502 | /**
|
3503 | * Certain properties are not supported for third party frameworks right now,
|
3504 | * such as ones related to the "Create From" feature. This is a subset of
|
3505 | * properties that are exposed for public usage.
|
3506 | */
|
3507 |
|
3508 | type ThirdPartyComponentFrameworkDefinition = Pick<ComponentFrameworkDefinition, 'type' | 'name' | 'supportedBundlers' | 'detectors' | 'dependencies'> & {
|
3509 | /**
|
3510 | * @example `cypress-ct-${string} for third parties. Any string is valid internally.
|
3511 | */
|
3512 | type: string
|
3513 |
|
3514 | /**
|
3515 | * Raw SVG icon that will be displayed in the Project Setup Wizard. Used for third parties that
|
3516 | * want to render a custom icon.
|
3517 | */
|
3518 | icon?: string
|
3519 | }
|
3520 |
|
3521 | interface AngularDevServerProjectConfig {
|
3522 | root: string
|
3523 | sourceRoot: string
|
3524 | buildOptions: Record<string, any>
|
3525 | }
|
3526 |
|
3527 | type DevServerFn<ComponentDevServerOpts = any> = (cypressDevServerConfig: DevServerConfig, devServerConfig: ComponentDevServerOpts) => ResolvedDevServerConfig | Promise<ResolvedDevServerConfig>
|
3528 |
|
3529 | type ConfigHandler<T> = T
|
3530 | | (() => T | Promise<T>)
|
3531 |
|
3532 | type DevServerConfigOptions = {
|
3533 | bundler: 'webpack'
|
3534 | framework: 'react' | 'vue' | 'vue-cli' | 'nuxt' | 'create-react-app' | 'next' | 'svelte'
|
3535 | webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>
|
3536 | } | {
|
3537 | bundler: 'vite'
|
3538 | framework: 'react' | 'vue' | 'svelte'
|
3539 | viteConfig?: ConfigHandler<Omit<Exclude<PickConfigOpt<'viteConfig'>, undefined>, 'base' | 'root'>>
|
3540 | } | {
|
3541 | bundler: 'webpack'
|
3542 | framework: 'angular'
|
3543 | webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>
|
3544 | options?: {
|
3545 | projectConfig: AngularDevServerProjectConfig
|
3546 | }
|
3547 | }
|
3548 |
|
3549 | interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalStudio'> {
|
3550 | devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
|
3551 | devServerConfig?: ComponentDevServerOpts
|
3552 | /**
|
3553 | * Runs all component specs in a single tab, trading spec isolation for faster run mode execution.
|
3554 | * @default false
|
3555 | */
|
3556 | experimentalSingleTabRunMode?: boolean
|
3557 | }
|
3558 |
|
3559 | /**
|
3560 | * Config options that can be assigned on cypress.config.{js,ts,mjs,cjs} file
|
3561 | */
|
3562 | type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern' | 'indexHtmlFile'>
|
3563 |
|
3564 | /**
|
3565 | * Takes ComponentDevServerOpts to track the signature of the devServerConfig for the provided `devServer`,
|
3566 | * so we have proper completion for `devServerConfig`
|
3567 | */
|
3568 | type ConfigOptions<ComponentDevServerOpts = any> = Partial<UserConfigOptions<ComponentDevServerOpts>> & {
|
3569 | /**
|
3570 | * Hosts mappings to IP addresses.
|
3571 | */
|
3572 | hosts?: null | { [key: string]: string }
|
3573 | }
|
3574 |
|
3575 | interface PluginConfigOptions extends ResolvedConfigOptions, RuntimeConfigOptions {
|
3576 | /**
|
3577 | * Absolute path to the root of the project
|
3578 | */
|
3579 | projectRoot: string
|
3580 | /**
|
3581 | * Type of test and associated runner that was launched.
|
3582 | */
|
3583 | testingType: TestingType
|
3584 | /**
|
3585 | * Cypress version.
|
3586 | */
|
3587 | version: string
|
3588 | }
|
3589 |
|
3590 | interface DebugOptions {
|
3591 | verbose: boolean
|
3592 | }
|
3593 |
|
3594 | /**
|
3595 | * Options object to change the default behavior of cy.exec().
|
3596 | */
|
3597 | interface ExecOptions extends Loggable, Timeoutable {
|
3598 | /**
|
3599 | * Whether to fail if the command exits with a non-zero code
|
3600 | *
|
3601 | * @default true
|
3602 | */
|
3603 | failOnNonZeroExit: boolean
|
3604 | /**
|
3605 | * Object of environment variables to set before the command executes
|
3606 | * (e.g. {USERNAME: 'johndoe'}). Will be merged with existing
|
3607 | * system environment variables
|
3608 | *
|
3609 | * @default {}
|
3610 | */
|
3611 | env: object
|
3612 | }
|
3613 |
|
3614 | /**
|
3615 | * Options for Cypress.Keyboard.defaults()
|
3616 | */
|
3617 | interface KeyboardDefaultsOptions {
|
3618 | /**
|
3619 | * Time, in milliseconds, between each keystroke when typing. (Pass 0 to disable)
|
3620 | *
|
3621 | * @default 10
|
3622 | */
|
3623 | keystrokeDelay: number
|
3624 | }
|
3625 |
|
3626 | /**
|
3627 | * Full set of possible options for cy.request call
|
3628 | */
|
3629 | interface RequestOptions extends Loggable, Timeoutable, Failable {
|
3630 | auth: object
|
3631 | body: RequestBody
|
3632 | encoding: Encodings
|
3633 | followRedirect: boolean
|
3634 | form: boolean
|
3635 | gzip: boolean
|
3636 | headers: object
|
3637 | method: HttpMethod
|
3638 | qs: object
|
3639 | url: string
|
3640 | }
|
3641 |
|
3642 | interface RouteOptions {
|
3643 | method: HttpMethod
|
3644 | url: string | RegExp
|
3645 | response: any
|
3646 | status: number
|
3647 | delay: number
|
3648 | headers: object | null
|
3649 | force404: boolean
|
3650 | onRequest(...args: any[]): void
|
3651 | onResponse(...args: any[]): void
|
3652 | onAbort(...args: any[]): void
|
3653 | }
|
3654 |
|
3655 | interface Dimensions {
|
3656 | x: number
|
3657 | y: number
|
3658 | width: number
|
3659 | height: number
|
3660 | }
|
3661 |
|
3662 | type Padding =
|
3663 | | number
|
3664 | | [number]
|
3665 | | [number, number]
|
3666 | | [number, number, number]
|
3667 | | [number, number, number, number]
|
3668 |
|
3669 | interface ScreenshotOptions {
|
3670 | blackout: string[]
|
3671 | capture: 'runner' | 'viewport' | 'fullPage'
|
3672 | clip: Dimensions
|
3673 | disableTimersAndAnimations: boolean
|
3674 | padding: Padding
|
3675 | scale: boolean
|
3676 | overwrite: boolean
|
3677 | onBeforeScreenshot: ($el: JQuery) => void
|
3678 | onAfterScreenshot: ($el: JQuery, props: {
|
3679 | path: string
|
3680 | size: number
|
3681 | dimensions: {
|
3682 | width: number
|
3683 | height: number
|
3684 | }
|
3685 | multipart: boolean
|
3686 | pixelRatio: number
|
3687 | takenAt: string
|
3688 | name: string
|
3689 | blackout: string[]
|
3690 | duration: number
|
3691 | testAttemptIndex: number
|
3692 | }) => void
|
3693 | }
|
3694 |
|
3695 | interface ScreenshotDefaultsOptions extends ScreenshotOptions {
|
3696 | screenshotOnRunFailure: boolean
|
3697 | }
|
3698 |
|
3699 | interface SelectorPlaygroundDefaultsOptions {
|
3700 | selectorPriority: string[]
|
3701 | onElement: ($el: JQuery) => string | null | undefined
|
3702 | }
|
3703 |
|
3704 | interface ScrollToOptions extends Loggable, Timeoutable {
|
3705 | /**
|
3706 | * Scrolls over the duration (in ms)
|
3707 | *
|
3708 | * @default 0
|
3709 | */
|
3710 | duration: number
|
3711 | /**
|
3712 | * Will scroll with the easing animation
|
3713 | *
|
3714 | * @default 'swing'
|
3715 | */
|
3716 | easing: 'swing' | 'linear'
|
3717 | /**
|
3718 | * Ensure element is scrollable. Error if element is not scrollable
|
3719 | *
|
3720 | * @default true
|
3721 | */
|
3722 | ensureScrollable: boolean
|
3723 | }
|
3724 |
|
3725 | interface ScrollIntoViewOptions extends ScrollToOptions {
|
3726 | /**
|
3727 | * Amount to scroll after the element has been scrolled into view
|
3728 | *
|
3729 | * @default {top: 0, left: 0}
|
3730 | */
|
3731 | offset: Offset
|
3732 | }
|
3733 |
|
3734 | interface SelectOptions extends Loggable, Timeoutable, Forceable {
|
3735 | interval: number
|
3736 | }
|
3737 |
|
3738 | interface Session {
|
3739 | /**
|
3740 | * Clear all sessions saved on the backend, including cached global sessions.
|
3741 | */
|
3742 | clearAllSavedSessions: () => Promise<void>
|
3743 | /**
|
3744 | * Clear all storage and cookie data across all origins associated with the current session.
|
3745 | */
|
3746 | clearCurrentSessionData: () => Promise<void>
|
3747 | /**
|
3748 | * Get all storage and cookie data across all origins associated with the current session.
|
3749 | */
|
3750 | getCurrentSessionData: () => Promise<SessionData>
|
3751 | /**
|
3752 | * Get all storage and cookie data saved on the backend associated with the provided session id.
|
3753 | */
|
3754 | getSession: (id: string) => Promise<ServerSessionData>
|
3755 | }
|
3756 |
|
3757 | type ActiveSessions = Record<string, SessionData>
|
3758 |
|
3759 | interface SessionData {
|
3760 | id: string
|
3761 | hydrated: boolean
|
3762 | cacheAcrossSpecs: SessionOptions['cacheAcrossSpecs']
|
3763 | cookies?: Cookie[] | null
|
3764 | localStorage?: OriginStorage[] | null
|
3765 | sessionStorage?: OriginStorage[] | null
|
3766 | setup: () => void
|
3767 | validate?: SessionOptions['validate']
|
3768 | }
|
3769 |
|
3770 | interface ServerSessionData extends Omit<SessionData, 'setup' | 'validate'> {
|
3771 | setup: string
|
3772 | validate?: string
|
3773 | }
|
3774 |
|
3775 | interface SessionOptions {
|
3776 | /**
|
3777 | * Whether or not to persist the session across all specs in the run.
|
3778 | * @default {false}
|
3779 | */
|
3780 | cacheAcrossSpecs?: boolean
|
3781 | /**
|
3782 | * Function to run immediately after the session is created and `setup` function runs or
|
3783 | * after a session is restored and the page is cleared. If this returns `false`, throws an
|
3784 | * exception, returns a Promise which resolves to `false` or rejects or contains any failing
|
3785 | * Cypress command, the session is considered invalid.
|
3786 | *
|
3787 | * If validation fails immediately after `setup`, the test will fail.
|
3788 | * If validation fails after restoring a session, `setup` will re-run.
|
3789 | * @default {false}
|
3790 | */
|
3791 | validate?: () => Promise<false | void> | void
|
3792 | }
|
3793 |
|
3794 | type SameSiteStatus = 'no_restriction' | 'strict' | 'lax'
|
3795 |
|
3796 | interface SelectFileOptions extends Loggable, Timeoutable, ActionableOptions {
|
3797 | /**
|
3798 | * Which user action to perform. `select` matches selecting a file while
|
3799 | * `drag-drop` matches dragging files from the operating system into the
|
3800 | * document.
|
3801 | *
|
3802 | * @default 'select'
|
3803 | */
|
3804 | action: 'select' | 'drag-drop'
|
3805 | }
|
3806 |
|
3807 | /**
|
3808 | * Options that control how the `cy.setCookie` command
|
3809 | * sets the cookie in the browser.
|
3810 | * @see https://on.cypress.io/setcookie#Arguments
|
3811 | */
|
3812 | interface SetCookieOptions extends Loggable, Timeoutable {
|
3813 | /**
|
3814 | * The path of the cookie.
|
3815 | * @default "/"
|
3816 | */
|
3817 | path: string
|
3818 | /**
|
3819 | * Represents the domain the cookie belongs to (e.g. "docs.cypress.io", "github.com").
|
3820 | * @default location.hostname
|
3821 | */
|
3822 | domain: string
|
3823 | /**
|
3824 | * Whether a cookie's scope is limited to secure channels, such as HTTPS.
|
3825 | * @default false
|
3826 | */
|
3827 | secure: boolean
|
3828 | /**
|
3829 | * Whether or not the cookie is HttpOnly, meaning the cookie is inaccessible to client-side scripts.
|
3830 | * The Cypress cookie API has access to HttpOnly cookies.
|
3831 | * @default false
|
3832 | */
|
3833 | httpOnly: boolean
|
3834 | /**
|
3835 | * Whether or not the cookie is a host-only cookie, meaning the request's host must exactly match the domain of the cookie.
|
3836 | * @default false
|
3837 | */
|
3838 | hostOnly: boolean
|
3839 | /**
|
3840 | * The cookie's expiry time, specified in seconds since Unix Epoch.
|
3841 | * The default is expiry is 20 years in the future from current time.
|
3842 | */
|
3843 | expiry: number
|
3844 | /**
|
3845 | * The cookie's SameSite value. If set, should be one of `lax`, `strict`, or `no_restriction`.
|
3846 | * `no_restriction` is the equivalent of `SameSite=None`. Pass `undefined` to use the browser's default.
|
3847 | * Note: `no_restriction` can only be used if the secure flag is set to `true`.
|
3848 | * @default undefined
|
3849 | */
|
3850 | sameSite: SameSiteStatus
|
3851 | }
|
3852 |
|
3853 | interface ShadowDomOptions {
|
3854 | includeShadowDom?: boolean
|
3855 | }
|
3856 |
|
3857 | /**
|
3858 | * Options that control `cy.type` command
|
3859 | *
|
3860 | * @see https://on.cypress.io/type
|
3861 | */
|
3862 | interface TypeOptions extends Loggable, Timeoutable, ActionableOptions {
|
3863 | /**
|
3864 | * Delay after each keypress (ms)
|
3865 | *
|
3866 | * @default 10
|
3867 | */
|
3868 | delay: number
|
3869 | /**
|
3870 | * Parse special characters for strings surrounded by `{}`,
|
3871 | * such as `{esc}`. Set to `false` to type the literal characters instead
|
3872 | *
|
3873 | * @default true
|
3874 | */
|
3875 | parseSpecialCharSequences: boolean
|
3876 | /**
|
3877 | * Keep a modifier activated between commands
|
3878 | *
|
3879 | * @default true
|
3880 | */
|
3881 | release: boolean
|
3882 | }
|
3883 |
|
3884 | /**
|
3885 | * Visit website options
|
3886 | *
|
3887 | * @see https://on.cypress.io/visit
|
3888 | */
|
3889 | interface VisitOptions extends Loggable, Timeoutable, Failable {
|
3890 | /**
|
3891 | * The URL to visit. Behaves the same as the `url` argument.
|
3892 | */
|
3893 | url: string
|
3894 |
|
3895 | /**
|
3896 | * The HTTP method to use in the visit. Can be `GET` or `POST`.
|
3897 | *
|
3898 | * @default "GET"
|
3899 | */
|
3900 | method: 'GET' | 'POST'
|
3901 |
|
3902 | /**
|
3903 | * 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.
|
3904 | *
|
3905 | * @example
|
3906 | * cy.visit({
|
3907 | * url: 'http://www.example.com/form.html',
|
3908 | * method: 'POST',
|
3909 | * body: {
|
3910 | * "field1": "foo",
|
3911 | * "field2": "bar"
|
3912 | * }
|
3913 | * })
|
3914 | */
|
3915 | body: RequestBody
|
3916 |
|
3917 | /**
|
3918 | * An object that maps HTTP header names to values to be sent along with the request.
|
3919 | *
|
3920 | * @example
|
3921 | * cy.visit({
|
3922 | * url: 'http://www.example.com',
|
3923 | * headers: {
|
3924 | * 'Accept-Language': 'en-US'
|
3925 | * }
|
3926 | * })
|
3927 | */
|
3928 | headers: { [header: string]: string }
|
3929 |
|
3930 | /**
|
3931 | * Called before your page has loaded all of its resources.
|
3932 | *
|
3933 | * @param {AUTWindow} contentWindow the remote page's window object
|
3934 | */
|
3935 | onBeforeLoad(win: AUTWindow): void
|
3936 |
|
3937 | /**
|
3938 | * Called once your page has fired its load event.
|
3939 | *
|
3940 | * @param {AUTWindow} contentWindow the remote page's window object
|
3941 | */
|
3942 | onLoad(win: AUTWindow): void
|
3943 |
|
3944 | /**
|
3945 | * Cypress will automatically apply the right authorization headers
|
3946 | * if you're attempting to visit an application that requires
|
3947 | * Basic Authentication.
|
3948 | *
|
3949 | * @example
|
3950 | * cy.visit('https://www.acme.com/', {
|
3951 | * auth: {
|
3952 | * username: 'wile',
|
3953 | * password: 'coyote'
|
3954 | * }
|
3955 | * })
|
3956 | */
|
3957 | auth: Auth
|
3958 |
|
3959 | /**
|
3960 | * Query parameters to append to the `url` of the request.
|
3961 | */
|
3962 | qs: object
|
3963 | }
|
3964 |
|
3965 | /**
|
3966 | * Options to change the default behavior of .trigger()
|
3967 | */
|
3968 | interface TriggerOptions extends Loggable, Timeoutable, ActionableOptions {
|
3969 | /**
|
3970 | * Whether the event bubbles
|
3971 | *
|
3972 | * @default true
|
3973 | */
|
3974 | bubbles: boolean
|
3975 | /**
|
3976 | * Whether the event is cancelable
|
3977 | *
|
3978 | * @default true
|
3979 | */
|
3980 | cancelable: boolean
|
3981 | /**
|
3982 | * The type of the event you want to trigger
|
3983 | *
|
3984 | * @default 'Event'
|
3985 | */
|
3986 | eventConstructor: string
|
3987 | }
|
3988 |
|
3989 | /**
|
3990 | * Options to change the default behavior of .url()
|
3991 | */
|
3992 | interface UrlOptions extends Loggable, Timeoutable {
|
3993 | /**
|
3994 | * Whether the url is decoded
|
3995 | *
|
3996 | * @default false
|
3997 | */
|
3998 | decode: boolean
|
3999 | }
|
4000 |
|
4001 | /** Options to change the default behavior of .writeFile */
|
4002 | interface WriteFileOptions extends Loggable {
|
4003 | flag: string
|
4004 | encoding: Encodings
|
4005 | }
|
4006 |
|
4007 | // Kind of onerous, but has a nice auto-complete.
|
4008 | /**
|
4009 | * @see https://on.cypress.io/should
|
4010 | *
|
4011 | * @interface Chainer
|
4012 | * @template Subject
|
4013 | */
|
4014 | interface Chainer<Subject> {
|
4015 | // chai
|
4016 | /**
|
4017 | * Asserts that the target's `type` is equal to the given string type.
|
4018 | * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
4019 | * https://github.com/chaijs/type-detect.
|
4020 | * @example
|
4021 | * cy.wrap('foo').should('be.a', 'string')
|
4022 | * @see http://chaijs.com/api/bdd/#method_a
|
4023 | * @see https://on.cypress.io/assertions
|
4024 | */
|
4025 | (chainer: 'be.a', type: string): Chainable<Subject>
|
4026 | /**
|
4027 | * Asserts that the target is a number or a date greater than the given number or date n respectively.
|
4028 | * However, it's often best to assert that the target is equal to its expected value.
|
4029 | * @example
|
4030 | * cy.wrap(6).should('be.above', 5)
|
4031 | * @see http://chaijs.com/api/bdd/#method_above
|
4032 | * @see https://on.cypress.io/assertions
|
4033 | */
|
4034 | (chainer: 'be.above', value: number | Date): Chainable<Subject>
|
4035 | /**
|
4036 | * Asserts that the target's `type` is equal to the given string type.
|
4037 | * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
4038 | * https://github.com/chaijs/type-detect.
|
4039 | * @example
|
4040 | * cy.wrap({ foo: 'bar' }).should('be.an', 'object')
|
4041 | * @alias a
|
4042 | * @see http://chaijs.com/api/bdd/#method_a
|
4043 | * @see https://on.cypress.io/assertions
|
4044 | */
|
4045 | (chainer: 'be.an', value: string): Chainable<Subject>
|
4046 | /**
|
4047 | * Asserts that the target is a number or a `n` date greater than or equal to the given number or date n respectively.
|
4048 | * However, it's often best to assert that the target is equal to its expected value.
|
4049 | * @example
|
4050 | * cy.wrap(6).should('be.at.least', 5)
|
4051 | * @see http://chaijs.com/api/bdd/#method_least
|
4052 | * @see https://on.cypress.io/assertions
|
4053 | */
|
4054 | (chainer: 'be.at.least', value: number | Date): Chainable<Subject>
|
4055 | /**
|
4056 | * Asserts that the target is a number or a `n` date less than or equal to the given number or date n respectively.
|
4057 | * However, it's often best to assert that the target is equal to its expected value.
|
4058 | * @example
|
4059 | * cy.wrap(4).should('be.below', 5)
|
4060 | * @see http://chaijs.com/api/bdd/#method_below
|
4061 | * @see https://on.cypress.io/assertions
|
4062 | */
|
4063 | (chainer: 'be.below', value: number): Chainable<Subject>
|
4064 | /**
|
4065 | * Asserts that the target is an `arguments` object.
|
4066 | * @example
|
4067 | * cy.wrap(arguments).should('be.arguments')
|
4068 | * @see http://chaijs.com/api/bdd/#method_arguments
|
4069 | * @see https://on.cypress.io/assertions
|
4070 | */
|
4071 | (chainer: 'be.arguments'): Chainable<Subject>
|
4072 | /**
|
4073 | * 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.
|
4074 | * @example
|
4075 | * cy.wrap(5.1).should('be.approximately', 5, 0.5)
|
4076 | * @alias closeTo
|
4077 | * @see http://chaijs.com/api/bdd/#method_closeto
|
4078 | * @see https://on.cypress.io/assertions
|
4079 | */
|
4080 | (chainer: 'be.approximately', value: number, delta: number): Chainable<Subject>
|
4081 | /**
|
4082 | * 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.
|
4083 | * @example
|
4084 | * cy.wrap(5.1).should('be.closeTo', 5, 0.5)
|
4085 | * @see http://chaijs.com/api/bdd/#method_closeto
|
4086 | * @see https://on.cypress.io/assertions
|
4087 | */
|
4088 | (chainer: 'be.closeTo', value: number, delta: number): Chainable<Subject>
|
4089 | /**
|
4090 | * When the target is a string or array, .empty asserts that the target's length property is strictly (===) equal to 0
|
4091 | * @example
|
4092 | * cy.wrap([]).should('be.empty')
|
4093 | * cy.wrap('').should('be.empty')
|
4094 | * @see http://chaijs.com/api/bdd/#method_empty
|
4095 | * @see https://on.cypress.io/assertions
|
4096 | */
|
4097 | (chainer: 'be.empty'): Chainable<Subject>
|
4098 | /**
|
4099 | * Asserts that the target is an instance of the given `constructor`.
|
4100 | * @example
|
4101 | * cy.wrap([1, 2]).should('be.instanceOf', Array)
|
4102 | * @see http://chaijs.com/api/bdd/#method_instanceof
|
4103 | * @see https://on.cypress.io/assertions
|
4104 | */
|
4105 | (chainer: 'be.instanceOf', value: any): Chainable<Subject>
|
4106 | /**
|
4107 | * Asserts that the target is strictly (`===`) equal to `false`.
|
4108 | * @example
|
4109 | * cy.wrap(false).should('be.false')
|
4110 | * @see http://chaijs.com/api/bdd/#method_false
|
4111 | * @see https://on.cypress.io/assertions
|
4112 | */
|
4113 | (chainer: 'be.false'): Chainable<Subject>
|
4114 | /**
|
4115 | * Asserts that the target is a number or a date greater than the given number or date n respectively.
|
4116 | * However, it's often best to assert that the target is equal to its expected value.
|
4117 | * @example
|
4118 | * cy.wrap(6).should('be.greaterThan', 5)
|
4119 | * @alias above
|
4120 | * @see http://chaijs.com/api/bdd/#method_above
|
4121 | * @see https://on.cypress.io/assertions
|
4122 | */
|
4123 | (chainer: 'be.greaterThan', value: number): Chainable<Subject>
|
4124 | /**
|
4125 | * Asserts that the target is a number or a date greater than the given number or date n respectively.
|
4126 | * However, it's often best to assert that the target is equal to its expected value.
|
4127 | * @example
|
4128 | * cy.wrap(6).should('be.gt', 5)
|
4129 | * @alias above
|
4130 | * @see http://chaijs.com/api/bdd/#method_above
|
4131 | * @see https://on.cypress.io/assertions
|
4132 | */
|
4133 | (chainer: 'be.gt', value: number): Chainable<Subject>
|
4134 | /**
|
4135 | * Asserts that the target is a number or a `n` date greater than or equal to the given number or date n respectively.
|
4136 | * However, it's often best to assert that the target is equal to its expected value.
|
4137 | * @example
|
4138 | * cy.wrap(6).should('be.gte', 5)
|
4139 | * @alias least
|
4140 | * @see http://chaijs.com/api/bdd/#method_least
|
4141 | * @see https://on.cypress.io/assertions
|
4142 | */
|
4143 | (chainer: 'be.gte', value: number): Chainable<Subject>
|
4144 | /**
|
4145 | * Asserts that the target is a number or a `n` date less than or equal to the given number or date n respectively.
|
4146 | * However, it's often best to assert that the target is equal to its expected value.
|
4147 | * @example
|
4148 | * cy.wrap(4).should('be.lessThan', 5)
|
4149 | * @alias below
|
4150 | * @see http://chaijs.com/api/bdd/#method_below
|
4151 | * @see https://on.cypress.io/assertions
|
4152 | */
|
4153 | (chainer: 'be.lessThan', value: number): Chainable<Subject>
|
4154 | /**
|
4155 | * Asserts that the target is a number or a `n` date less than or equal to the given number or date n respectively.
|
4156 | * However, it's often best to assert that the target is equal to its expected value.
|
4157 | * @example
|
4158 | * cy.wrap(4).should('be.lt', 5)
|
4159 | * @alias below
|
4160 | * @see http://chaijs.com/api/bdd/#method_below
|
4161 | * @see https://on.cypress.io/assertions
|
4162 | */
|
4163 | (chainer: 'be.lt', value: number): Chainable<Subject>
|
4164 | /**
|
4165 | * Asserts that the target is a number or a date less than or equal to the given number or date n respectively.
|
4166 | * However, it's often best to assert that the target is equal to its expected value.
|
4167 | * @example
|
4168 | * cy.wrap(4).should('be.lte', 5)
|
4169 | * @alias most
|
4170 | * @see http://chaijs.com/api/bdd/#method_most
|
4171 | * @see https://on.cypress.io/assertions
|
4172 | */
|
4173 | (chainer: 'be.lte', value: number): Chainable<Subject>
|
4174 | /**
|
4175 | * 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.
|
4176 | * @example
|
4177 | * cy.wrap(1).should('be.ok')
|
4178 | * @see http://chaijs.com/api/bdd/#method_ok
|
4179 | * @see https://on.cypress.io/assertions
|
4180 | */
|
4181 | (chainer: 'be.ok'): Chainable<Subject>
|
4182 | /**
|
4183 | * Asserts that the target is strictly (`===`) equal to true.
|
4184 | * @example
|
4185 | * cy.wrap(true).should('be.true')
|
4186 | * @see http://chaijs.com/api/bdd/#method_true
|
4187 | * @see https://on.cypress.io/assertions
|
4188 | */
|
4189 | (chainer: 'be.true'): Chainable<Subject>
|
4190 | /**
|
4191 | * Asserts that the target is strictly (`===`) equal to undefined.
|
4192 | * @example
|
4193 | * cy.wrap(undefined).should('be.undefined')
|
4194 | * @see http://chaijs.com/api/bdd/#method_undefined
|
4195 | * @see https://on.cypress.io/assertions
|
4196 | */
|
4197 | (chainer: 'be.undefined'): Chainable<Subject>
|
4198 | /**
|
4199 | * Asserts that the target is strictly (`===`) equal to null.
|
4200 | * @example
|
4201 | * cy.wrap(null).should('be.null')
|
4202 | * @see http://chaijs.com/api/bdd/#method_null
|
4203 | * @see https://on.cypress.io/assertions
|
4204 | */
|
4205 | (chainer: 'be.null'): Chainable<Subject>
|
4206 | /**
|
4207 | * Asserts that the target is strictly (`===`) equal to NaN.
|
4208 | * @example
|
4209 | * cy.wrap(NaN).should('be.NaN')
|
4210 | * @see http://chaijs.com/api/bdd/#method_null
|
4211 | * @see https://on.cypress.io/assertions
|
4212 | */
|
4213 | (chainer: 'be.NaN'): Chainable<Subject>
|
4214 | /**
|
4215 | * 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.
|
4216 | * However, it's often best to assert that the target is equal to its expected value.
|
4217 | * @example
|
4218 | * cy.wrap(6).should('be.within', 5, 10)
|
4219 | * @see http://chaijs.com/api/bdd/#method_within
|
4220 | * @see https://on.cypress.io/assertions
|
4221 | */
|
4222 | (chainer: 'be.within', start: number, end: number): Chainable<Subject>
|
4223 | (chainer: 'be.within', start: Date, end: Date): Chainable<Subject>
|
4224 | /**
|
4225 | * 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.
|
4226 | * However, it's often best to assert that `subject` is equal to its expected value.
|
4227 | * @example
|
4228 | * let dots = ''
|
4229 | * function addDot() { dots += '.' }
|
4230 | * function getDots() { return dots }
|
4231 | * cy.wrap(addDot).should('change', getDots)
|
4232 | * @see http://chaijs.com/api/bdd/#method_change
|
4233 | * @see https://on.cypress.io/assertions
|
4234 | */
|
4235 | (chainer: 'change', fn: (...args: any[]) => any): Chainable<Subject>
|
4236 | /**
|
4237 | * 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.
|
4238 | * @example
|
4239 | * const myObj = { dots: '' }
|
4240 | * function addDot() { myObj.dots += '.' }
|
4241 | * cy.wrap(addDot).should('change', myObj, 'dots')
|
4242 | * @see http://chaijs.com/api/bdd/#method_change
|
4243 | * @see https://on.cypress.io/assertions
|
4244 | */
|
4245 | (chainer: 'change', obj: object, prop: string): Chainable<Subject>
|
4246 | /**
|
4247 | * When the target is a string, `.include` asserts that the given string val is a substring of the target.
|
4248 | * @example
|
4249 | * cy.wrap('tester').should('contain', 'test')
|
4250 | * @alias include
|
4251 | * @see http://chaijs.com/api/bdd/#method_include
|
4252 | * @see https://on.cypress.io/assertions
|
4253 | */
|
4254 | (chainer: 'contain', value: any): Chainable<Subject>
|
4255 | /**
|
4256 | * 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.
|
4257 | * `.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.
|
4258 | * @example
|
4259 | * let val = 1
|
4260 | * function subtractTwo() { val -= 2 }
|
4261 | * function getVal() { return val }
|
4262 | * cy.wrap(subtractTwo).should('decrease', getVal)
|
4263 | * @see http://chaijs.com/api/bdd/#method_decrease
|
4264 | * @see https://on.cypress.io/assertions
|
4265 | */
|
4266 | (chainer: 'decrease', fn: (...args: any[]) => any): Chainable<Subject>
|
4267 | /**
|
4268 | * 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.
|
4269 | * @example
|
4270 | * let val = 1
|
4271 | * function subtractTwo() { val -= 2 }
|
4272 | * function getVal() { return val }
|
4273 | * cy.wrap(subtractTwo).should('decrease', getVal)
|
4274 | * @see http://chaijs.com/api/bdd/#method_decrease
|
4275 | * @see https://on.cypress.io/assertions
|
4276 | */
|
4277 | (chainer: 'decrease', obj: object, prop: string): Chainable<Subject>
|
4278 | /**
|
4279 | * 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.
|
4280 | * @example
|
4281 | * cy.wrap({ a: 1 }).should('deep.equal', { a: 1 })
|
4282 | * @see http://chaijs.com/api/bdd/#method_deep
|
4283 | * @see https://on.cypress.io/assertions
|
4284 | */
|
4285 | (chainer: 'deep.equal', value: Subject): Chainable<Subject>
|
4286 | /**
|
4287 | * 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.
|
4288 | * @example
|
4289 | * cy.wrap(1).should('exist')
|
4290 | * @see http://chaijs.com/api/bdd/#method_exist
|
4291 | * @see https://on.cypress.io/assertions
|
4292 | */
|
4293 | (chainer: 'exist'): Chainable<Subject>
|
4294 | /**
|
4295 | * Asserts that the target is strictly (`===`) equal to the given `val`.
|
4296 | * @example
|
4297 | * cy.wrap(1).should('eq', 1)
|
4298 | * @alias equal
|
4299 | * @see http://chaijs.com/api/bdd/#method_equal
|
4300 | * @see https://on.cypress.io/assertions
|
4301 | */
|
4302 | (chainer: 'eq', value: any): Chainable<Subject>
|
4303 | /**
|
4304 | * 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.
|
4305 | * @example
|
4306 | * cy.wrap({a: 1}).should('eql', {a: 1}).and('not.equal', {a: 1})
|
4307 | * @see http://chaijs.com/api/bdd/#method_eql
|
4308 | * @see https://on.cypress.io/assertions
|
4309 | */
|
4310 | (chainer: 'eql', value: any): Chainable<Subject>
|
4311 | /**
|
4312 | * Asserts that the target is strictly (`===`) equal to the given `val`.
|
4313 | * @example
|
4314 | * cy.wrap(1).should('equal', 1)
|
4315 | * @see http://chaijs.com/api/bdd/#method_equal
|
4316 | * @see https://on.cypress.io/assertions
|
4317 | */
|
4318 | (chainer: 'equal', value: any): Chainable<Subject>
|
4319 | /**
|
4320 | * 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.
|
4321 | * @example
|
4322 | * cy.wrap({ a: 1, b: 2 }).should('have.all.key', 'a', 'b')
|
4323 | * @see http://chaijs.com/api/bdd/#method_all
|
4324 | * @see https://on.cypress.io/assertions
|
4325 | */
|
4326 | (chainer: 'have.all.key', ...value: string[]): Chainable<Subject>
|
4327 | /**
|
4328 | * 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.
|
4329 | * @example
|
4330 | * cy.wrap({ a: 1, b: 2 }).should('have.any.key', 'a')
|
4331 | * @see http://chaijs.com/api/bdd/#method_any
|
4332 | * @see https://on.cypress.io/assertions
|
4333 | */
|
4334 | (chainer: 'have.any.key', ...value: string[]): Chainable<Subject>
|
4335 | /**
|
4336 | * 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.
|
4337 | * @example
|
4338 | * cy.wrap({ a: 1, b: 2 }).should('have.all.keys', 'a', 'b')
|
4339 | * @see http://chaijs.com/api/bdd/#method_all
|
4340 | * @see https://on.cypress.io/assertions
|
4341 | */
|
4342 | (chainer: 'have.all.keys' | 'have.keys' | 'have.deep.keys' | 'have.all.deep.keys', ...value: string[]): Chainable<Subject>
|
4343 | /**
|
4344 | * 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.
|
4345 | * @example
|
4346 | * cy.wrap({ a: 1, b: 2 }).should('have.any.keys', 'a')
|
4347 | * @see http://chaijs.com/api/bdd/#method_any
|
4348 | * @see https://on.cypress.io/assertions
|
4349 | */
|
4350 | (chainer: 'have.any.keys' | 'include.any.keys', ...value: string[]): Chainable<Subject>
|
4351 | /**
|
4352 | * 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.
|
4353 | * @example
|
4354 | * cy.wrap({ a: 1, b: 2 }).should('include.all.keys', 'a', 'b')
|
4355 | * @see http://chaijs.com/api/bdd/#method_keys
|
4356 | * @see https://on.cypress.io/assertions
|
4357 | */
|
4358 | (chainer: 'include.all.keys', ...value: string[]): Chainable<Subject>
|
4359 | /**
|
4360 | * 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.
|
4361 | * @example
|
4362 | * cy.wrap({ x: {a: 1 }}).should('have.deep.property', 'x', { a: 1 })
|
4363 | * @see http://chaijs.com/api/bdd/#method_property
|
4364 | * @see https://on.cypress.io/assertions
|
4365 | */
|
4366 | (chainer: 'have.deep.property', value: string, obj: object): Chainable<Subject>
|
4367 | /**
|
4368 | * Asserts that the target's `length` property is equal to the given number `n`.
|
4369 | * @example
|
4370 | * cy.wrap([1, 2, 3]).should('have.length', 3)
|
4371 | * cy.wrap('foo').should('have.length', 3)
|
4372 | * @alias lengthOf
|
4373 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4374 | * @see https://on.cypress.io/assertions
|
4375 | */
|
4376 | (chainer: 'have.length' | 'have.lengthOf', value: number): Chainable<Subject>
|
4377 | /**
|
4378 | * Asserts that the target's `length` property is greater than to the given number `n`.
|
4379 | * @example
|
4380 | * cy.wrap([1, 2, 3]).should('have.length.greaterThan', 2)
|
4381 | * cy.wrap('foo').should('have.length.greaterThan', 2)
|
4382 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4383 | * @see https://on.cypress.io/assertions
|
4384 | */
|
4385 | (chainer: 'have.length.greaterThan' | 'have.lengthOf.greaterThan', value: number): Chainable<Subject>
|
4386 | /**
|
4387 | * Asserts that the target's `length` property is greater than to the given number `n`.
|
4388 | * @example
|
4389 | * cy.wrap([1, 2, 3]).should('have.length.gt', 2)
|
4390 | * cy.wrap('foo').should('have.length.gt', 2)
|
4391 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4392 | * @see https://on.cypress.io/assertions
|
4393 | */
|
4394 | (chainer: 'have.length.gt' | 'have.lengthOf.gt' | 'have.length.above' | 'have.lengthOf.above', value: number): Chainable<Subject>
|
4395 | /**
|
4396 | * Asserts that the target's `length` property is greater than or equal to the given number `n`.
|
4397 | * @example
|
4398 | * cy.wrap([1, 2, 3]).should('have.length.gte', 2)
|
4399 | * cy.wrap('foo').should('have.length.gte', 2)
|
4400 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4401 | * @see https://on.cypress.io/assertions
|
4402 | */
|
4403 | (chainer: 'have.length.gte' | 'have.lengthOf.gte' | 'have.length.at.least' | 'have.lengthOf.at.least', value: number): Chainable<Subject>
|
4404 | /**
|
4405 | * Asserts that the target's `length` property is less than to the given number `n`.
|
4406 | * @example
|
4407 | * cy.wrap([1, 2, 3]).should('have.length.lessThan', 4)
|
4408 | * cy.wrap('foo').should('have.length.lessThan', 4)
|
4409 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4410 | * @see https://on.cypress.io/assertions
|
4411 | */
|
4412 | (chainer: 'have.length.lessThan' | 'have.lengthOf.lessThan', value: number): Chainable<Subject>
|
4413 | /**
|
4414 | * Asserts that the target's `length` property is less than to the given number `n`.
|
4415 | * @example
|
4416 | * cy.wrap([1, 2, 3]).should('have.length.lt', 4)
|
4417 | * cy.wrap('foo').should('have.length.lt', 4)
|
4418 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4419 | * @see https://on.cypress.io/assertions
|
4420 | */
|
4421 | (chainer: 'have.length.lt' | 'have.lengthOf.lt' | 'have.length.below' | 'have.lengthOf.below', value: number): Chainable<Subject>
|
4422 | /**
|
4423 | * Asserts that the target's `length` property is less than or equal to the given number `n`.
|
4424 | * @example
|
4425 | * cy.wrap([1, 2, 3]).should('have.length.lte', 4)
|
4426 | * cy.wrap('foo').should('have.length.lte', 4)
|
4427 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4428 | * @see https://on.cypress.io/assertions
|
4429 | */
|
4430 | (chainer: 'have.length.lte' | 'have.lengthOf.lte' | 'have.length.at.most' | 'have.lengthOf.at.most', value: number): Chainable<Subject>
|
4431 | /**
|
4432 | * Asserts that the target's `length` property is within `start` and `finish`.
|
4433 | * @example
|
4434 | * cy.wrap([1, 2, 3]).should('have.length.within', 1, 5)
|
4435 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4436 | * @see https://on.cypress.io/assertions
|
4437 | */
|
4438 | (chainer: 'have.length.within' | 'have.lengthOf.within', start: number, finish: number): Chainable<Subject>
|
4439 | /**
|
4440 | * Asserts that the target array has the same members as the given array `set`.
|
4441 | * @example
|
4442 | * cy.wrap([1, 2, 3]).should('have.members', [2, 1, 3])
|
4443 | * @see http://chaijs.com/api/bdd/#method_members
|
4444 | * @see https://on.cypress.io/assertions
|
4445 | */
|
4446 | (chainer: 'have.members' | 'have.deep.members', values: any[]): Chainable<Subject>
|
4447 | /**
|
4448 | * Asserts that the target array has the same members as the given array where order matters.
|
4449 | * @example
|
4450 | * cy.wrap([1, 2, 3]).should('have.ordered.members', [1, 2, 3])
|
4451 | * @see http://chaijs.com/api/bdd/#method_members
|
4452 | * @see https://on.cypress.io/assertions
|
4453 | */
|
4454 | (chainer: 'have.ordered.members', values: any[]): Chainable<Subject>
|
4455 | /**
|
4456 | * Causes all `.property` and `.include` assertions that follow in the chain to ignore inherited properties.
|
4457 | * @example
|
4458 | * Object.prototype.b = 2
|
4459 | * cy.wrap({ a: 1 }).should('have.property', 'a').and('not.have.ownProperty', 'b')
|
4460 | * @see http://chaijs.com/api/bdd/#method_ownproperty
|
4461 | * @see https://on.cypress.io/assertions
|
4462 | */
|
4463 | (chainer: 'have.ownProperty', property: string): Chainable<Subject>
|
4464 | /**
|
4465 | * Asserts that the target has a property with the given key `name`.
|
4466 | * @example
|
4467 | * cy.wrap({ a: 1 }).should('have.property', 'a')
|
4468 | * cy.wrap({ a: 1 }).should('have.property', 'a', 1)
|
4469 | * @see http://chaijs.com/api/bdd/#method_property
|
4470 | * @see https://on.cypress.io/assertions
|
4471 | */
|
4472 | (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>
|
4473 | /**
|
4474 | * Asserts that the target has its own property descriptor with the given key name.
|
4475 | * @example
|
4476 | * cy.wrap({a: 1}).should('have.ownPropertyDescriptor', 'a', { value: 1 })
|
4477 | * @see http://chaijs.com/api/bdd/#method_ownpropertydescriptor
|
4478 | * @see https://on.cypress.io/assertions
|
4479 | */
|
4480 | (chainer: 'have.ownPropertyDescriptor' | 'haveOwnPropertyDescriptor', name: string, descriptor?: PropertyDescriptor): Chainable<Subject>
|
4481 | /**
|
4482 | * Asserts that the target string contains the given substring `str`.
|
4483 | * @example
|
4484 | * cy.wrap('foobar').should('have.string', 'bar')
|
4485 | * @see http://chaijs.com/api/bdd/#method_string
|
4486 | * @see https://on.cypress.io/assertions
|
4487 | */
|
4488 | (chainer: 'have.string', match: string | RegExp): Chainable<Subject>
|
4489 | /**
|
4490 | * When the target is a string, `.include` asserts that the given string `val` is a substring of the target.
|
4491 | * @example
|
4492 | * cy.wrap('foobar').should('include', 'foo')
|
4493 | * @see http://chaijs.com/api/bdd/#method_include
|
4494 | * @see https://on.cypress.io/assertions
|
4495 | */
|
4496 | (chainer: 'include' | 'deep.include' | 'nested.include' | 'own.include' | 'deep.own.include' | 'deep.nested.include', value: any): Chainable<Subject>
|
4497 | /**
|
4498 | * When the target is a string, `.include` asserts that the given string `val` is a substring of the target.
|
4499 | * @example
|
4500 | * cy.wrap([1, 2, 3]).should('include.members', [1, 2])
|
4501 | * @see http://chaijs.com/api/bdd/#method_members
|
4502 | * @see https://on.cypress.io/assertions
|
4503 | */
|
4504 | (chainer: 'include.members' | 'include.ordered.members' | 'include.deep.ordered.members', value: any[]): Chainable<Subject>
|
4505 | /**
|
4506 | * When one argument is provided, `.increase` asserts that the given function `subject` returns a greater number when it's
|
4507 | * invoked after invoking the target function compared to when it's invoked beforehand.
|
4508 | * `.increase` also causes all `.by` assertions that follow in the chain to assert how much greater of a number is returned.
|
4509 | * It's often best to assert that the return value increased by the expected amount, rather than asserting it increased by any amount.
|
4510 | *
|
4511 | * When two arguments are provided, `.increase` asserts that the value of the given object `subject`'s `prop` property is greater after
|
4512 | * invoking the target function compared to beforehand.
|
4513 | *
|
4514 | * @example
|
4515 | * let val = 1
|
4516 | * function addTwo() { val += 2 }
|
4517 | * function getVal() { return val }
|
4518 | * cy.wrap(addTwo).should('increase', getVal)
|
4519 | *
|
4520 | * const myObj = { val: 1 }
|
4521 | * function addTwo() { myObj.val += 2 }
|
4522 | * cy.wrap(addTwo).should('increase', myObj, 'val')
|
4523 | * @see http://chaijs.com/api/bdd/#method_increase
|
4524 | * @see https://on.cypress.io/assertions
|
4525 | */
|
4526 | (chainer: 'increase', value: object, property?: string): Chainable<Subject>
|
4527 | /**
|
4528 | * Asserts that the target matches the given regular expression `re`.
|
4529 | * @example
|
4530 | * cy.wrap('foobar').should('match', /^foo/)
|
4531 | * @see http://chaijs.com/api/bdd/#method_match
|
4532 | * @see https://on.cypress.io/assertions
|
4533 | */
|
4534 | (chainer: 'match', value: RegExp): Chainable<Subject>
|
4535 | /**
|
4536 | * 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.
|
4537 | * @example
|
4538 | * class Cat {
|
4539 | * meow() {}
|
4540 | * }
|
4541 | * cy.wrap(new Cat()).should('respondTo', 'meow')
|
4542 | * @see http://chaijs.com/api/bdd/#method_respondto
|
4543 | * @see https://on.cypress.io/assertions
|
4544 | */
|
4545 | (chainer: 'respondTo', value: string): Chainable<Subject>
|
4546 | /**
|
4547 | * Invokes the given `matcher` function with the target being passed as the first argument, and asserts that the value returned is truthy.
|
4548 | * @example
|
4549 | * cy.wrap(1).should('satisfy', (num) => num > 0)
|
4550 | * @see http://chaijs.com/api/bdd/#method_satisfy
|
4551 | * @see https://on.cypress.io/assertions
|
4552 | */
|
4553 | (chainer: 'satisfy', fn: (val: any) => boolean): Chainable<Subject>
|
4554 | /**
|
4555 | * When no arguments are provided, `.throw` invokes the target function and asserts that an error is thrown.
|
4556 | * 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.
|
4557 | * @example
|
4558 | * function badFn() { throw new TypeError('Illegal salmon!') }
|
4559 | * cy.wrap(badFn).should('throw')
|
4560 | * cy.wrap(badFn).should('throw', 'salmon')
|
4561 | * cy.wrap(badFn).should('throw', /salmon/)
|
4562 | * @see http://chaijs.com/api/bdd/#method_throw
|
4563 | * @see https://on.cypress.io/assertions
|
4564 | */
|
4565 | (chainer: 'throw', value?: string | RegExp): Chainable<Subject>
|
4566 | /**
|
4567 | * When no arguments are provided, `.throw` invokes the target function and asserts that an error is thrown.
|
4568 | * 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.
|
4569 | * @example
|
4570 | * function badFn() { throw new TypeError('Illegal salmon!') }
|
4571 | * cy.wrap(badFn).should('throw')
|
4572 | * cy.wrap(badFn).should('throw', 'salmon')
|
4573 | * cy.wrap(badFn).should('throw', /salmon/)
|
4574 | * @see http://chaijs.com/api/bdd/#method_throw
|
4575 | * @see https://on.cypress.io/assertions
|
4576 | */
|
4577 | // tslint:disable-next-line ban-types
|
4578 | (chainer: 'throw', error: Error | Function, expected?: string | RegExp): Chainable<Subject>
|
4579 | /**
|
4580 | * Asserts that the target is a member of the given array list.
|
4581 | * @example
|
4582 | * cy.wrap(1).should('be.oneOf', [1, 2, 3])
|
4583 | * @see http://chaijs.com/api/bdd/#method_oneof
|
4584 | * @see https://on.cypress.io/assertions
|
4585 | */
|
4586 | (chainer: 'be.oneOf', list: ReadonlyArray<any>): Chainable<Subject>
|
4587 | /**
|
4588 | * Asserts that the target is extensible, which means that new properties can be added to it.
|
4589 | * @example
|
4590 | * cy.wrap({a: 1}).should('be.extensible')
|
4591 | * @see http://chaijs.com/api/bdd/#method_extensible
|
4592 | * @see https://on.cypress.io/assertions
|
4593 | */
|
4594 | (chainer: 'be.extensible'): Chainable<Subject>
|
4595 | /**
|
4596 | * 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.
|
4597 | * @example
|
4598 | * let sealedObject = Object.seal({})
|
4599 | * let frozenObject = Object.freeze({})
|
4600 | * cy.wrap(sealedObject).should('be.sealed')
|
4601 | * cy.wrap(frozenObject).should('be.sealed')
|
4602 | * @see http://chaijs.com/api/bdd/#method_sealed
|
4603 | * @see https://on.cypress.io/assertions
|
4604 | */
|
4605 | (chainer: 'be.sealed'): Chainable<Subject>
|
4606 | /**
|
4607 | * 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.
|
4608 | * @example
|
4609 | * let frozenObject = Object.freeze({})
|
4610 | * cy.wrap(frozenObject).should('be.frozen')
|
4611 | * @see http://chaijs.com/api/bdd/#method_frozen
|
4612 | * @see https://on.cypress.io/assertions
|
4613 | */
|
4614 | (chainer: 'be.frozen'): Chainable<Subject>
|
4615 | /**
|
4616 | * Asserts that the target is a number, and isn't `NaN` or positive/negative `Infinity`.
|
4617 | * @example
|
4618 | * cy.wrap(1).should('be.finite')
|
4619 | * @see http://chaijs.com/api/bdd/#method_finite
|
4620 | * @see https://on.cypress.io/assertions
|
4621 | */
|
4622 | (chainer: 'be.finite'): Chainable<Subject>
|
4623 |
|
4624 | // chai.not
|
4625 | /**
|
4626 | * Asserts that the target's `type` is not equal to the given string type.
|
4627 | * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
4628 | * https://github.com/chaijs/type-detect.
|
4629 | * @example
|
4630 | * cy.wrap('foo').should('not.be.a', 'number')
|
4631 | * @see http://chaijs.com/api/bdd/#method_a
|
4632 | * @see https://on.cypress.io/assertions
|
4633 | */
|
4634 | (chainer: 'not.be.a', type: string): Chainable<Subject>
|
4635 | /**
|
4636 | * Asserts that the target is a not number or not a date greater than the given number or date n respectively.
|
4637 | * However, it's often best to assert that the target is equal to its expected value.
|
4638 | * @example
|
4639 | * cy.wrap(6).should('not.be.above', 10)
|
4640 | * @see http://chaijs.com/api/bdd/#method_above
|
4641 | * @see https://on.cypress.io/assertions
|
4642 | */
|
4643 | (chainer: 'not.be.above', value: number | Date): Chainable<Subject>
|
4644 | /**
|
4645 | * Asserts that the target's `type` is not equal to the given string type.
|
4646 | * Types are case insensitive. See the `type-detect` project page for info on the type detection algorithm:
|
4647 | * https://github.com/chaijs/type-detect.
|
4648 | * @example
|
4649 | * cy.wrap('foo').should('not.be.an', 'object')
|
4650 | * @alias a
|
4651 | * @see http://chaijs.com/api/bdd/#method_a
|
4652 | * @see https://on.cypress.io/assertions
|
4653 | */
|
4654 | (chainer: 'not.be.an', value: string): Chainable<Subject>
|
4655 | /**
|
4656 | * 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.
|
4657 | * However, it's often best to assert that the target is equal to its expected value.
|
4658 | * @example
|
4659 | * cy.wrap(6).should('not.be.at.least', 10)
|
4660 | * @see http://chaijs.com/api/bdd/#method_least
|
4661 | * @see https://on.cypress.io/assertions
|
4662 | */
|
4663 | (chainer: 'not.be.at.least', value: number | Date): Chainable<Subject>
|
4664 | /**
|
4665 | * 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.
|
4666 | * However, it's often best to assert that the target is equal to its expected value.
|
4667 | * @example
|
4668 | * cy.wrap(4).should('not.be.below', 1)
|
4669 | * @see http://chaijs.com/api/bdd/#method_below
|
4670 | * @see https://on.cypress.io/assertions
|
4671 | */
|
4672 | (chainer: 'not.be.below', value: number): Chainable<Subject>
|
4673 | /**
|
4674 | * Asserts that the target is not an `arguments` object.
|
4675 | * @example
|
4676 | * cy.wrap(1).should('not.be.arguments')
|
4677 | * @see http://chaijs.com/api/bdd/#method_arguments
|
4678 | * @see https://on.cypress.io/assertions
|
4679 | */
|
4680 | (chainer: 'not.be.arguments'): Chainable<Subject>
|
4681 | /**
|
4682 | * 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.
|
4683 | * @example
|
4684 | * cy.wrap(5.1).should('not.be.approximately', 6, 0.5)
|
4685 | * @alias closeTo
|
4686 | * @see http://chaijs.com/api/bdd/#method_closeto
|
4687 | * @see https://on.cypress.io/assertions
|
4688 | */
|
4689 | (chainer: 'not.be.approximately', value: number, delta: number): Chainable<Subject>
|
4690 | /**
|
4691 | * 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.
|
4692 | * @example
|
4693 | * cy.wrap(5.1).should('not.be.closeTo', 6, 0.5)
|
4694 | * @see http://chaijs.com/api/bdd/#method_closeto
|
4695 | * @see https://on.cypress.io/assertions
|
4696 | */
|
4697 | (chainer: 'not.be.closeTo', value: number, delta: number): Chainable<Subject>
|
4698 | /**
|
4699 | * When the target is a not string or array, .empty asserts that the target's length property is strictly (===) equal to 0
|
4700 | * @example
|
4701 | * cy.wrap([1]).should('not.be.empty')
|
4702 | * cy.wrap('foo').should('not.be.empty')
|
4703 | * @see http://chaijs.com/api/bdd/#method_empty
|
4704 | * @see https://on.cypress.io/assertions
|
4705 | */
|
4706 | (chainer: 'not.be.empty'): Chainable<Subject>
|
4707 | /**
|
4708 | * Asserts that the target is not an instance of the given `constructor`.
|
4709 | * @example
|
4710 | * cy.wrap([1, 2]).should('not.be.instanceOf', String)
|
4711 | * @see http://chaijs.com/api/bdd/#method_instanceof
|
4712 | * @see https://on.cypress.io/assertions
|
4713 | */
|
4714 | (chainer: 'not.be.instanceOf', value: any): Chainable<Subject>
|
4715 | /**
|
4716 | * Asserts that the target is not strictly (`===`) equal to `false`.
|
4717 | * @example
|
4718 | * cy.wrap(true).should('not.be.false')
|
4719 | * @see http://chaijs.com/api/bdd/#method_false
|
4720 | * @see https://on.cypress.io/assertions
|
4721 | */
|
4722 | (chainer: 'not.be.false'): Chainable<Subject>
|
4723 | /**
|
4724 | * Asserts that the target is a not number or a date greater than the given number or date n respectively.
|
4725 | * However, it's often best to assert that the target is equal to its expected value.
|
4726 | * @example
|
4727 | * cy.wrap(6).should('be.greaterThan', 7)
|
4728 | * @alias above
|
4729 | * @see http://chaijs.com/api/bdd/#method_above
|
4730 | * @see https://on.cypress.io/assertions
|
4731 | */
|
4732 | (chainer: 'not.be.greaterThan', value: number): Chainable<Subject>
|
4733 | /**
|
4734 | * Asserts that the target is a not number or a date greater than the given number or date n respectively.
|
4735 | * However, it's often best to assert that the target is equal to its expected value.
|
4736 | * @example
|
4737 | * cy.wrap(6).should('not.be.gt', 7)
|
4738 | * @alias above
|
4739 | * @see http://chaijs.com/api/bdd/#method_above
|
4740 | * @see https://on.cypress.io/assertions
|
4741 | */
|
4742 | (chainer: 'not.be.gt', value: number): Chainable<Subject>
|
4743 | /**
|
4744 | * Asserts that the target is a not number or a `n` date greater than or equal to the given number or date n respectively.
|
4745 | * However, it's often best to assert that the target is equal to its expected value.
|
4746 | * @example
|
4747 | * cy.wrap(6).should('not.be.gte', 7)
|
4748 | * @alias least
|
4749 | * @see http://chaijs.com/api/bdd/#method_least
|
4750 | * @see https://on.cypress.io/assertions
|
4751 | */
|
4752 | (chainer: 'not.be.gte', value: number): Chainable<Subject>
|
4753 | /**
|
4754 | * Asserts that the target is not a number or a `n` date less than or equal to the given number or date n respectively.
|
4755 | * However, it's often best to assert that the target is equal to its expected value.
|
4756 | * @example
|
4757 | * cy.wrap(4).should('not.be.lessThan', 3)
|
4758 | * @alias below
|
4759 | * @see http://chaijs.com/api/bdd/#method_below
|
4760 | * @see https://on.cypress.io/assertions
|
4761 | */
|
4762 | (chainer: 'not.be.lessThan', value: number): Chainable<Subject>
|
4763 | /**
|
4764 | * Asserts that the target is not a number or a `n` date less than or equal to the given number or date n respectively.
|
4765 | * However, it's often best to assert that the target is equal to its expected value.
|
4766 | * @example
|
4767 | * cy.wrap(4).should('not.be.lt', 3)
|
4768 | * @alias below
|
4769 | * @see http://chaijs.com/api/bdd/#method_below
|
4770 | * @see https://on.cypress.io/assertions
|
4771 | */
|
4772 | (chainer: 'not.be.lt', value: number): Chainable<Subject>
|
4773 | /**
|
4774 | * Asserts that the target is not a number or a date less than or equal to the given number or date n respectively.
|
4775 | * However, it's often best to assert that the target is equal to its expected value.
|
4776 | * @example
|
4777 | * cy.wrap(4).should('not.be.lte', 3)
|
4778 | * @alias most
|
4779 | * @see http://chaijs.com/api/bdd/#method_most
|
4780 | * @see https://on.cypress.io/assertions
|
4781 | */
|
4782 | (chainer: 'not.be.lte', value: number): Chainable<Subject>
|
4783 | /**
|
4784 | * 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.
|
4785 | * @example
|
4786 | * cy.wrap(0).should('not.be.ok')
|
4787 | * @see http://chaijs.com/api/bdd/#method_ok
|
4788 | * @see https://on.cypress.io/assertions
|
4789 | */
|
4790 | (chainer: 'not.be.ok'): Chainable<Subject>
|
4791 | /**
|
4792 | * Asserts that the target is not strictly (`===`) equal to true.
|
4793 | * @example
|
4794 | * cy.wrap(false).should('not.be.true')
|
4795 | * @see http://chaijs.com/api/bdd/#method_true
|
4796 | * @see https://on.cypress.io/assertions
|
4797 | */
|
4798 | (chainer: 'not.be.true'): Chainable<Subject>
|
4799 | /**
|
4800 | * Asserts that the target is not strictly (`===`) equal to undefined.
|
4801 | * @example
|
4802 | * cy.wrap(true).should('not.be.undefined')
|
4803 | * @see http://chaijs.com/api/bdd/#method_undefined
|
4804 | * @see https://on.cypress.io/assertions
|
4805 | */
|
4806 | (chainer: 'not.be.undefined'): Chainable<Subject>
|
4807 | /**
|
4808 | * Asserts that the target is strictly (`===`) equal to null.
|
4809 | * @example
|
4810 | * cy.wrap(null).should('not.be.null')
|
4811 | * @see http://chaijs.com/api/bdd/#method_null
|
4812 | * @see https://on.cypress.io/assertions
|
4813 | */
|
4814 | (chainer: 'not.be.null'): Chainable<Subject>
|
4815 | /**
|
4816 | * Asserts that the target is strictly (`===`) equal to NaN.
|
4817 | * @example
|
4818 | * cy.wrap(NaN).should('not.be.NaN')
|
4819 | * @see http://chaijs.com/api/bdd/#method_nan
|
4820 | * @see https://on.cypress.io/assertions
|
4821 | */
|
4822 | (chainer: 'not.be.NaN'): Chainable<Subject>
|
4823 | /**
|
4824 | * 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.
|
4825 | * However, it's often best to assert that the target is equal to its expected value.
|
4826 | * @example
|
4827 | * cy.wrap(3).should('not.be.within', 5, 10)
|
4828 | * @see http://chaijs.com/api/bdd/#method_within
|
4829 | * @see https://on.cypress.io/assertions
|
4830 | */
|
4831 | (chainer: 'not.be.within', start: number, end: number): Chainable<Subject>
|
4832 | (chainer: 'not.be.within', start: Date, end: Date): Chainable<Subject>
|
4833 | /**
|
4834 | * 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.
|
4835 | * However, it's often best to assert that `subject` is equal to its expected value.
|
4836 | * @example
|
4837 | * let dots = ''
|
4838 | * function addDot() { dots += '.' }
|
4839 | * function getDots() { return dots }
|
4840 | * cy.wrap(() => {}).should('not.change', getDots)
|
4841 | * @see http://chaijs.com/api/bdd/#method_change
|
4842 | * @see https://on.cypress.io/assertions
|
4843 | */
|
4844 | (chainer: 'not.change', fn: (...args: any[]) => any): Chainable<Subject>
|
4845 | /**
|
4846 | * 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.
|
4847 | * @example
|
4848 | * const myObj = { dots: '' }
|
4849 | * function addDot() { myObj.dots += '.' }
|
4850 | * cy.wrap(() => {}).should('not.change', myObj, 'dots')
|
4851 | * @see http://chaijs.com/api/bdd/#method_change
|
4852 | * @see https://on.cypress.io/assertions
|
4853 | */
|
4854 | (chainer: 'not.change', obj: object, prop: string): Chainable<Subject>
|
4855 | /**
|
4856 | * When the target is a string, `.include` asserts that the given string val is a substring of the target.
|
4857 | * @example
|
4858 | * cy.wrap('tester').should('not.contain', 'foo')
|
4859 | * @alias include
|
4860 | * @see http://chaijs.com/api/bdd/#method_include
|
4861 | * @see https://on.cypress.io/assertions
|
4862 | */
|
4863 | (chainer: 'not.contain', value: any): Chainable<Subject>
|
4864 | /**
|
4865 | * 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.
|
4866 | * `.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.
|
4867 | * @example
|
4868 | * let val = 1
|
4869 | * function subtractTwo() { val -= 2 }
|
4870 | * function getVal() { return val }
|
4871 | * cy.wrap(() => {}).should('not.decrease', getVal)
|
4872 | * @see http://chaijs.com/api/bdd/#method_decrease
|
4873 | * @see https://on.cypress.io/assertions
|
4874 | */
|
4875 | (chainer: 'not.decrease', fn: (...args: any[]) => any): Chainable<Subject>
|
4876 | /**
|
4877 | * 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.
|
4878 | * @example
|
4879 | * const myObj = { val: 1 }
|
4880 | * function subtractTwo() { myObj.val -= 2 }
|
4881 | * cy.wrap(() => {}).should('not.decrease', myObj, 'val')
|
4882 | * @see http://chaijs.com/api/bdd/#method_decrease
|
4883 | * @see https://on.cypress.io/assertions
|
4884 | */
|
4885 | (chainer: 'not.decrease', obj: object, prop: string): Chainable<Subject>
|
4886 | /**
|
4887 | * 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.
|
4888 | * @example
|
4889 | * cy.wrap({ a: 1 }).should('not.deep.equal', { b: 1 })
|
4890 | * @see http://chaijs.com/api/bdd/#method_deep
|
4891 | * @see https://on.cypress.io/assertions
|
4892 | */
|
4893 | (chainer: 'not.deep.equal', value: Subject): Chainable<Subject>
|
4894 | /**
|
4895 | * 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.
|
4896 | * @example
|
4897 | * cy.wrap(null).should('not.exist')
|
4898 | * @see http://chaijs.com/api/bdd/#method_exist
|
4899 | * @see https://on.cypress.io/assertions
|
4900 | */
|
4901 | (chainer: 'not.exist'): Chainable<Subject>
|
4902 | /**
|
4903 | * Asserts that the target is not strictly (`===`) equal to the given `val`.
|
4904 | * @example
|
4905 | * cy.wrap(1).should('not.eq', 2)
|
4906 | * @alias equal
|
4907 | * @see http://chaijs.com/api/bdd/#method_equal
|
4908 | * @see https://on.cypress.io/assertions
|
4909 | */
|
4910 | (chainer: 'not.eq', value: any): Chainable<Subject>
|
4911 | /**
|
4912 | * 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.
|
4913 | * @example
|
4914 | * cy.wrap({a: 1}).should('not.eql', {c: 1}).and('not.equal', {a: 1})
|
4915 | * @see http://chaijs.com/api/bdd/#method_eql
|
4916 | * @see https://on.cypress.io/assertions
|
4917 | */
|
4918 | (chainer: 'not.eql', value: any): Chainable<Subject>
|
4919 | /**
|
4920 | * Asserts that the target is not strictly (`===`) equal to the given `val`.
|
4921 | * @example
|
4922 | * cy.wrap(1).should('not.equal', 2)
|
4923 | * @see http://chaijs.com/api/bdd/#method_equal
|
4924 | * @see https://on.cypress.io/assertions
|
4925 | */
|
4926 | (chainer: 'not.equal', value: any): Chainable<Subject>
|
4927 | /**
|
4928 | * 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.
|
4929 | * @example
|
4930 | * cy.wrap({ a: 1, b: 2 }).should('not.have.all.keys', 'c', 'd')
|
4931 | * @see http://chaijs.com/api/bdd/#method_all
|
4932 | * @see https://on.cypress.io/assertions
|
4933 | */
|
4934 | (chainer: 'not.have.all.keys' | 'not.have.keys' | 'not.have.deep.keys' | 'not.have.all.deep.keys', ...value: string[]): Chainable<Subject>
|
4935 | /**
|
4936 | * 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.
|
4937 | * @example
|
4938 | * cy.wrap({ a: 1, b: 2 }).should('not.have.any.keys', 'c')
|
4939 | * @see http://chaijs.com/api/bdd/#method_any
|
4940 | * @see https://on.cypress.io/assertions
|
4941 | */
|
4942 | (chainer: 'not.have.any.keys' | 'not.include.any.keys', ...value: string[]): Chainable<Subject>
|
4943 | /**
|
4944 | * 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.
|
4945 | * @example
|
4946 | * cy.wrap({ x: {a: 1 }}).should('not.have.deep.property', 'y', { a: 1 })
|
4947 | * @see http://chaijs.com/api/bdd/#method_property
|
4948 | * @see https://on.cypress.io/assertions
|
4949 | */
|
4950 | (chainer: 'not.have.deep.property', value: string, obj: object): Chainable<Subject>
|
4951 | /**
|
4952 | * Asserts that the target's `length` property is not equal to the given number `n`.
|
4953 | * @example
|
4954 | * cy.wrap([1, 2, 3]).should('not.have.length', 2)
|
4955 | * cy.wrap('foo').should('not.have.length', 2)
|
4956 | * @alias lengthOf
|
4957 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4958 | * @see https://on.cypress.io/assertions
|
4959 | */
|
4960 | (chainer: 'not.have.length' | 'not.have.lengthOf', value: number): Chainable<Subject>
|
4961 | /**
|
4962 | * Asserts that the target's `length` property is not greater than to the given number `n`.
|
4963 | * @example
|
4964 | * cy.wrap([1, 2, 3]).should('not.have.length.greaterThan', 4)
|
4965 | * cy.wrap('foo').should('not.have.length.greaterThan', 4)
|
4966 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4967 | * @see https://on.cypress.io/assertions
|
4968 | */
|
4969 | (chainer: 'not.have.length.greaterThan' | 'not.have.lengthOf.greaterThan', value: number): Chainable<Subject>
|
4970 | /**
|
4971 | * Asserts that the target's `length` property is not greater than to the given number `n`.
|
4972 | * @example
|
4973 | * cy.wrap([1, 2, 3]).should('not.have.length.gt', 4)
|
4974 | * cy.wrap('foo').should('not.have.length.gt', 4)
|
4975 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4976 | * @see https://on.cypress.io/assertions
|
4977 | */
|
4978 | (chainer: 'not.have.length.gt' | 'not.have.lengthOf.gt' | 'not.have.length.above' | 'not.have.lengthOf.above', value: number): Chainable<Subject>
|
4979 | /**
|
4980 | * Asserts that the target's `length` property is not greater than or equal to the given number `n`.
|
4981 | * @example
|
4982 | * cy.wrap([1, 2, 3]).should('not.have.length.gte', 4)
|
4983 | * cy.wrap('foo').should('not.have.length.gte', 4)
|
4984 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4985 | * @see https://on.cypress.io/assertions
|
4986 | */
|
4987 | (chainer: 'not.have.length.gte' | 'not.have.lengthOf.gte' | 'not.have.length.at.least' | 'not.have.lengthOf.at.least', value: number): Chainable<Subject>
|
4988 | /**
|
4989 | * Asserts that the target's `length` property is less than to the given number `n`.
|
4990 | * @example
|
4991 | * cy.wrap([1, 2, 3]).should('have.length.lessThan', 2)
|
4992 | * cy.wrap('foo').should('have.length.lessThan', 2)
|
4993 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
4994 | * @see https://on.cypress.io/assertions
|
4995 | */
|
4996 | (chainer: 'not.have.length.lessThan' | 'not.have.lengthOf.lessThan', value: number): Chainable<Subject>
|
4997 | /**
|
4998 | * Asserts that the target's `length` property is not less than to the given number `n`.
|
4999 | * @example
|
5000 | * cy.wrap([1, 2, 3]).should('not.have.length.lt', 2)
|
5001 | * cy.wrap('foo').should('not.have.length.lt', 2)
|
5002 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
5003 | * @see https://on.cypress.io/assertions
|
5004 | */
|
5005 | (chainer: 'not.have.length.lt' | 'not.have.lengthOf.lt' | 'not.have.length.below' | 'not.have.lengthOf.below', value: number): Chainable<Subject>
|
5006 | /**
|
5007 | * Asserts that the target's `length` property is not less than or equal to the given number `n`.
|
5008 | * @example
|
5009 | * cy.wrap([1, 2, 3]).should('not.have.length.lte', 2)
|
5010 | * cy.wrap('foo').should('not.have.length.lte', 2)
|
5011 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
5012 | * @see https://on.cypress.io/assertions
|
5013 | */
|
5014 | (chainer: 'not.have.length.lte' | 'not.have.lengthOf.lte' | 'not.have.length.at.most' | 'not.have.lengthOf.at.most', value: number): Chainable<Subject>
|
5015 | /**
|
5016 | * Asserts that the target's `length` property is within `start` and `finish`.
|
5017 | * @example
|
5018 | * cy.wrap([1, 2, 3]).should('not.have.length.within', 6, 12)
|
5019 | * @see http://chaijs.com/api/bdd/#method_lengthof
|
5020 | * @see https://on.cypress.io/assertions
|
5021 | */
|
5022 | (chainer: 'not.have.length.within' | 'not.have.lengthOf.within', start: number, finish: number): Chainable<Subject>
|
5023 | /**
|
5024 | * Asserts that the target array does not have the same members as the given array `set`.
|
5025 | * @example
|
5026 | * cy.wrap([1, 2, 3]).should('not.have.members', [4, 5, 6])
|
5027 | * @see http://chaijs.com/api/bdd/#method_members
|
5028 | * @see https://on.cypress.io/assertions
|
5029 | */
|
5030 | (chainer: 'not.have.members' | 'not.have.deep.members', values: any[]): Chainable<Subject>
|
5031 | /**
|
5032 | * Asserts that the target array does not have the same members as the given array where order matters.
|
5033 | * @example
|
5034 | * cy.wrap([1, 2, 3]).should('not. have.ordered.members', [4, 5, 6])
|
5035 | * @see http://chaijs.com/api/bdd/#method_members
|
5036 | * @see https://on.cypress.io/assertions
|
5037 | */
|
5038 | (chainer: 'not.have.ordered.members', values: any[]): Chainable<Subject>
|
5039 | /**
|
5040 | * Causes all `.property` and `.include` assertions that follow in the chain to ignore inherited properties.
|
5041 | * @example
|
5042 | * Object.prototype.b = 2
|
5043 | * cy.wrap({ a: 1 }).should('have.property', 'a').and('not.have.ownProperty', 'b')
|
5044 | * @see http://chaijs.com/api/bdd/#method_ownproperty
|
5045 | * @see https://on.cypress.io/assertions
|
5046 | */
|
5047 | (chainer: 'not.have.ownProperty', property: string): Chainable<Subject>
|
5048 | /**
|
5049 | * Asserts that the target has a property with the given key `name`.
|
5050 | * @example
|
5051 | * cy.wrap({ a: 1 }).should('not.have.property', 'b')
|
5052 | * cy.wrap({ a: 1 }).should('not.have.property', 'b', 1)
|
5053 | * @see http://chaijs.com/api/bdd/#method_property
|
5054 | * @see https://on.cypress.io/assertions
|
5055 | */
|
5056 | (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>
|
5057 | /**
|
5058 | * Asserts that the target has its own property descriptor with the given key name.
|
5059 | * @example
|
5060 | * cy.wrap({a: 1}).should('not.have.ownPropertyDescriptor', 'a', { value: 2 })
|
5061 | * @see http://chaijs.com/api/bdd/#method_ownpropertydescriptor
|
5062 | * @see https://on.cypress.io/assertions
|
5063 | */
|
5064 | (chainer: 'not.have.ownPropertyDescriptor' | 'not.haveOwnPropertyDescriptor', name: string, descriptor?: PropertyDescriptor): Chainable<Subject>
|
5065 | /**
|
5066 | * Asserts that the target string does not contains the given substring `str`.
|
5067 | * @example
|
5068 | * cy.wrap('foobar').should('not.have.string', 'baz')
|
5069 | * @see http://chaijs.com/api/bdd/#method_string
|
5070 | * @see https://on.cypress.io/assertions
|
5071 | */
|
5072 | (chainer: 'not.have.string', match: string | RegExp): Chainable<Subject>
|
5073 | /**
|
5074 | * When the target is a string, `.include` asserts that the given string `val` is not a substring of the target.
|
5075 | * @example
|
5076 | * cy.wrap('foobar').should('not.include', 'baz')
|
5077 | * @see http://chaijs.com/api/bdd/#method_include
|
5078 | * @see https://on.cypress.io/assertions
|
5079 | */
|
5080 | (chainer: 'not.include' | 'not.deep.include' | 'not.nested.include' | 'not.own.include' | 'not.deep.own.include' | 'not.deep.nested.include', value: any): Chainable<Subject>
|
5081 | /**
|
5082 | * When the target is a string, `.include` asserts that the given string `val` is not a substring of the target.
|
5083 | * @example
|
5084 | * cy.wrap([1, 2, 3]).should('not.include.members', [4, 5])
|
5085 | * @see http://chaijs.com/api/bdd/#method_members
|
5086 | * @see https://on.cypress.io/assertions
|
5087 | */
|
5088 | (chainer: 'not.include.members' | 'not.include.ordered.members' | 'not.include.deep.ordered.members', value: any[]): Chainable<Subject>
|
5089 | /**
|
5090 | * When one argument is provided, `.increase` asserts that the given function `subject` returns a greater number when it's
|
5091 | * invoked after invoking the target function compared to when it's invoked beforehand.
|
5092 | * `.increase` also causes all `.by` assertions that follow in the chain to assert how much greater of a number is returned.
|
5093 | * It's often best to assert that the return value increased by the expected amount, rather than asserting it increased by any amount.
|
5094 | *
|
5095 | * When two arguments are provided, `.increase` asserts that the value of the given object `subject`'s `prop` property is greater after
|
5096 | * invoking the target function compared to beforehand.
|
5097 | *
|
5098 | * @example
|
5099 | * let val = 1
|
5100 | * function addTwo() { val += 2 }
|
5101 | * function getVal() { return val }
|
5102 | * cy.wrap(() => {}).should('not.increase', getVal)
|
5103 | *
|
5104 | * const myObj = { val: 1 }
|
5105 | * function addTwo() { myObj.val += 2 }
|
5106 | * cy.wrap(addTwo).should('increase', myObj, 'val')
|
5107 | * @see http://chaijs.com/api/bdd/#method_increase
|
5108 | * @see https://on.cypress.io/assertions
|
5109 | */
|
5110 | (chainer: 'not.increase', value: object, property?: string): Chainable<Subject>
|
5111 | /**
|
5112 | * Asserts that the target does not match the given regular expression `re`.
|
5113 | * @example
|
5114 | * cy.wrap('foobar').should('not.match', /baz$/)
|
5115 | * @see http://chaijs.com/api/bdd/#method_match
|
5116 | * @see https://on.cypress.io/assertions
|
5117 | */
|
5118 | (chainer: 'not.match', value: RegExp): Chainable<Subject>
|
5119 | /**
|
5120 | * 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.
|
5121 | * @example
|
5122 | * class Cat {
|
5123 | * meow() {}
|
5124 | * }
|
5125 | * cy.wrap(new Cat()).should('not.respondTo', 'bark')
|
5126 | * @see http://chaijs.com/api/bdd/#method_respondto
|
5127 | * @see https://on.cypress.io/assertions
|
5128 | */
|
5129 | (chainer: 'not.respondTo', value: string): Chainable<Subject>
|
5130 | /**
|
5131 | * Invokes the given `matcher` function with the target being passed as the first argument, and asserts that the value returned is falsy.
|
5132 | * @example
|
5133 | * cy.wrap(1).should('not.satisfy', (num) => num < 0)
|
5134 | * @see http://chaijs.com/api/bdd/#method_satisfy
|
5135 | * @see https://on.cypress.io/assertions
|
5136 | */
|
5137 | (chainer: 'not.satisfy', fn: (val: any) => boolean): Chainable<Subject>
|
5138 | /**
|
5139 | * When no arguments are provided, `.throw` invokes the target function and asserts that no error is thrown.
|
5140 | * 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.
|
5141 | * @example
|
5142 | * function badFn() { console.log('Illegal salmon!') }
|
5143 | * cy.wrap(badFn).should('not.throw')
|
5144 | * cy.wrap(badFn).should('not.throw', 'salmon')
|
5145 | * cy.wrap(badFn).should('not.throw', /salmon/)
|
5146 | * @see http://chaijs.com/api/bdd/#method_throw
|
5147 | * @see https://on.cypress.io/assertions
|
5148 | */
|
5149 | (chainer: 'not.throw', value?: string | RegExp): Chainable<Subject>
|
5150 | /**
|
5151 | * When no arguments are provided, `.throw` invokes the target function and asserts that no error is thrown.
|
5152 | * 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.
|
5153 | * @example
|
5154 | * function badFn() { console.log('Illegal salmon!') }
|
5155 | * cy.wrap(badFn).should('not.throw')
|
5156 | * cy.wrap(badFn).should('not.throw', 'salmon')
|
5157 | * cy.wrap(badFn).should('not.throw', /salmon/)
|
5158 | * @see http://chaijs.com/api/bdd/#method_throw
|
5159 | * @see https://on.cypress.io/assertions
|
5160 | */
|
5161 | // tslint:disable-next-line ban-types
|
5162 | (chainer: 'not.throw', error: Error | Function, expected?: string | RegExp): Chainable<Subject>
|
5163 | /**
|
5164 | * Asserts that the target is a member of the given array list.
|
5165 | * @example
|
5166 | * cy.wrap(42).should('not.be.oneOf', [1, 2, 3])
|
5167 | * @see http://chaijs.com/api/bdd/#method_oneof
|
5168 | * @see https://on.cypress.io/assertions
|
5169 | */
|
5170 | (chainer: 'not.be.oneOf', list: ReadonlyArray<any>): Chainable<Subject>
|
5171 | /**
|
5172 | * Asserts that the target is extensible, which means that new properties can be added to it.
|
5173 | * @example
|
5174 | * let o = Object.seal({})
|
5175 | * cy.wrap(o).should('not.be.extensible')
|
5176 | * @see http://chaijs.com/api/bdd/#method_extensible
|
5177 | * @see https://on.cypress.io/assertions
|
5178 | */
|
5179 | (chainer: 'not.be.extensible'): Chainable<Subject>
|
5180 | /**
|
5181 | * 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.
|
5182 | * @example
|
5183 | * cy.wrap({a: 1}).should('be.sealed')
|
5184 | * cy.wrap({a: 1}).should('be.sealed')
|
5185 | * @see http://chaijs.com/api/bdd/#method_sealed
|
5186 | * @see https://on.cypress.io/assertions
|
5187 | */
|
5188 | (chainer: 'not.be.sealed'): Chainable<Subject>
|
5189 | /**
|
5190 | * 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.
|
5191 | * @example
|
5192 | * cy.wrap({a: 1}).should('not.be.frozen')
|
5193 | * @see http://chaijs.com/api/bdd/#method_frozen
|
5194 | * @see https://on.cypress.io/assertions
|
5195 | */
|
5196 | (chainer: 'not.be.frozen'): Chainable<Subject>
|
5197 | /**
|
5198 | * Asserts that the target is a number, and isn't `NaN` or positive/negative `Infinity`.
|
5199 | * @example
|
5200 | * cy.wrap(NaN).should('not.be.finite')
|
5201 | * cy.wrap(Infinity).should('not.be.finite')
|
5202 | * @see http://chaijs.com/api/bdd/#method_finite
|
5203 | * @see https://on.cypress.io/assertions
|
5204 | */
|
5205 | (chainer: 'not.be.finite'): Chainable<Subject>
|
5206 |
|
5207 | // sinon-chai
|
5208 | /**
|
5209 | * Assert spy/stub was called the `new` operator.
|
5210 | * 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.
|
5211 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
5212 | * @see https://on.cypress.io/assertions
|
5213 | */
|
5214 | (chainer: 'be.always.calledWithNew' | 'always.have.been.calledWithNew'): Chainable<Subject>
|
5215 | /**
|
5216 | * Assert if spy was always called with matching arguments (and possibly others).
|
5217 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithmatcharg1-arg2-
|
5218 | * @see https://on.cypress.io/assertions
|
5219 | */
|
5220 | (chainer: 'be.always.calledWithMatch' | 'always.have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
|
5221 | /**
|
5222 | * Assert spy always returned the provided value.
|
5223 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysreturnedobj
|
5224 | * @see https://on.cypress.io/assertions
|
5225 | */
|
5226 | (chainer: 'always.returned' | 'have.always.returned', value: any): Chainable<Subject>
|
5227 | /**
|
5228 | * `true` if the spy was called at least once
|
5229 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalled
|
5230 | * @see https://on.cypress.io/assertions
|
5231 | */
|
5232 | (chainer: 'be.called' | 'have.been.called'): Chainable<Subject>
|
5233 | /**
|
5234 | * Assert spy was called after `anotherSpy`
|
5235 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledafteranotherspy
|
5236 | * @see https://on.cypress.io/assertions
|
5237 | */
|
5238 | (chainer: 'be.calledAfter' | 'have.been.calledAfter', spy: sinon.SinonSpy): Chainable<Subject>
|
5239 | /**
|
5240 | * Assert spy was called before `anotherSpy`
|
5241 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledbeforeanotherspy
|
5242 | * @see https://on.cypress.io/assertions
|
5243 | */
|
5244 | (chainer: 'be.calledBefore' | 'have.been.calledBefore', spy: sinon.SinonSpy): Chainable<Subject>
|
5245 | /**
|
5246 | * 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)).
|
5247 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonobj
|
5248 | * @see https://on.cypress.io/assertions
|
5249 | */
|
5250 | (chainer: 'be.calledOn' | 'have.been.calledOn', context: any): Chainable<Subject>
|
5251 | /**
|
5252 | * Assert spy was called exactly once
|
5253 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonce
|
5254 | * @see https://on.cypress.io/assertions
|
5255 | */
|
5256 | (chainer: 'be.calledOnce' | 'have.been.calledOnce'): Chainable<Subject>
|
5257 | /**
|
5258 | * Assert spy was called exactly three times
|
5259 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledthrice
|
5260 | * @see https://on.cypress.io/assertions
|
5261 | */
|
5262 | (chainer: 'be.calledThrice' | 'have.been.calledThrice'): Chainable<Subject>
|
5263 | /**
|
5264 | * Assert spy was called exactly twice
|
5265 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledtwice
|
5266 | * @see https://on.cypress.io/assertions
|
5267 | */
|
5268 | (chainer: 'be.calledTwice' | 'have.been.calledTwice'): Chainable<Subject>
|
5269 | /**
|
5270 | * Assert spy was called at least once with the provided arguments and no others.
|
5271 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithexactlyarg1-arg2-
|
5272 | * @see https://on.cypress.io/assertions
|
5273 | */
|
5274 | (chainer: 'be.calledWithExactly' | 'have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
|
5275 | /**
|
5276 | * Assert spy was called with matching arguments (and possibly others).
|
5277 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithmatcharg1-arg2-
|
5278 | * @see https://on.cypress.io/assertions
|
5279 | */
|
5280 | (chainer: 'be.calledWithMatch' | 'have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
|
5281 | /**
|
5282 | * Assert spy/stub was called the `new` operator.
|
5283 | * 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.
|
5284 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
5285 | * @see https://on.cypress.io/assertions
|
5286 | */
|
5287 | (chainer: 'be.calledWithNew' | 'have.been.calledWithNew'): Chainable<Subject>
|
5288 | /**
|
5289 | * Assert spy always threw an exception.
|
5290 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysthrew
|
5291 | * @see https://on.cypress.io/assertions
|
5292 | */
|
5293 | (chainer: 'have.always.thrown', value?: Error | typeof Error | string): Chainable<Subject>
|
5294 | /**
|
5295 | * Assert the number of calls.
|
5296 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycallcount
|
5297 | * @see https://on.cypress.io/assertions
|
5298 | */
|
5299 | (chainer: 'have.callCount', value: number): Chainable<Subject>
|
5300 | /**
|
5301 | * Assert spy threw an exception at least once.
|
5302 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spythrew
|
5303 | * @see https://on.cypress.io/assertions
|
5304 | */
|
5305 | (chainer: 'have.thrown', value?: Error | typeof Error | string): Chainable<Subject>
|
5306 | /**
|
5307 | * Assert spy returned the provided value at least once. (see [matchers](http://sinonjs.org/releases/v4.1.3/spies/#matchers))
|
5308 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyreturnedobj
|
5309 | * @see https://on.cypress.io/assertions
|
5310 | */
|
5311 | (chainer: 'returned' | 'have.returned', value: any): Chainable<Subject>
|
5312 | /**
|
5313 | * Assert spy was called before anotherSpy, and no spy calls occurred between spy and anotherSpy.
|
5314 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelybeforeanotherspy
|
5315 | * @see https://on.cypress.io/assertions
|
5316 | */
|
5317 | (chainer: 'be.calledImmediatelyBefore' | 'have.been.calledImmediatelyBefore', anotherSpy: sinon.SinonSpy): Chainable<Subject>
|
5318 | /**
|
5319 | * Assert spy was called after anotherSpy, and no spy calls occurred between anotherSpy and spy.
|
5320 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelyafteranotherspy
|
5321 | * @see https://on.cypress.io/assertions
|
5322 | */
|
5323 | (chainer: 'be.calledImmediatelyAfter' | 'have.been.calledImmediatelyAfter', anotherSpy: sinon.SinonSpy): Chainable<Subject>
|
5324 | /**
|
5325 | * Assert the spy was always called with obj as this
|
5326 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledonobj
|
5327 | * @see https://on.cypress.io/assertions
|
5328 | */
|
5329 | (chainer: 'be.always.calledOn' | 'always.have.been.calledOn', obj: any): Chainable<Subject>
|
5330 | /**
|
5331 | * Assert spy was called at least once with the provided arguments.
|
5332 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
|
5333 | * @see https://on.cypress.io/assertions
|
5334 | */
|
5335 | (chainer: 'be.calledWith' | 'have.been.calledWith', ...args: any[]): Chainable<Subject>
|
5336 | /**
|
5337 | * Assert spy was always called with the provided arguments (and possibly others).
|
5338 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwitharg1-arg2-
|
5339 | * @see https://on.cypress.io/assertions
|
5340 | */
|
5341 | (chainer: 'be.always.calledWith' | 'always.have.been.calledWith', ...args: any[]): Chainable<Subject>
|
5342 | /**
|
5343 | * Assert spy was called at exactly once with the provided arguments.
|
5344 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
|
5345 | * @see https://on.cypress.io/assertions
|
5346 | */
|
5347 | (chainer: 'be.calledOnceWith' | 'have.been.calledOnceWith', ...args: any[]): Chainable<Subject>
|
5348 | /**
|
5349 | * Assert spy was always called with the exact provided arguments.
|
5350 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithexactlyarg1-arg2-
|
5351 | * @see https://on.cypress.io/assertions
|
5352 | */
|
5353 | (chainer: 'be.always.calledWithExactly' | 'have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
|
5354 | /**
|
5355 | * Assert spy was called at exactly once with the provided arguments.
|
5356 | * @see http://sinonjs.org/releases/v4.1.3/spies/#
|
5357 | * @see https://on.cypress.io/assertions
|
5358 | */
|
5359 | (chainer: 'be.calledOnceWithExactly' | 'have.been.calledOnceWithExactly', ...args: any[]): Chainable<Subject>
|
5360 | /**
|
5361 | * Assert spy always returned the provided value.
|
5362 | * @see http://sinonjs.org/releases/v4.1.3/spies/#
|
5363 | * @see https://on.cypress.io/assertions
|
5364 | */
|
5365 | (chainer: 'have.always.returned', obj: any): Chainable<Subject>
|
5366 |
|
5367 | // sinon-chai.not
|
5368 | /**
|
5369 | * Assert spy/stub was not called the `new` operator.
|
5370 | * 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.
|
5371 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
5372 | * @see https://on.cypress.io/assertions
|
5373 | */
|
5374 | (chainer: 'not.be.always.calledWithNew' | 'not.always.have.been.calledWithNew'): Chainable<Subject>
|
5375 | /**
|
5376 | * Assert if spy was not always called with matching arguments (and possibly others).
|
5377 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithmatcharg1-arg2-
|
5378 | * @see https://on.cypress.io/assertions
|
5379 | */
|
5380 | (chainer: 'not.be.always.calledWithMatch' | 'not.always.have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
|
5381 | /**
|
5382 | * Assert spy not always returned the provided value.
|
5383 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysreturnedobj
|
5384 | * @see https://on.cypress.io/assertions
|
5385 | */
|
5386 | (chainer: 'not.always.returned' | 'not.have.always.returned', value: any): Chainable<Subject>
|
5387 | /**
|
5388 | * `true` if the spy was not called at least once
|
5389 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalled
|
5390 | * @see https://on.cypress.io/assertions
|
5391 | */
|
5392 | (chainer: 'not.be.called' | 'not.have.been.called'): Chainable<Subject>
|
5393 | /**
|
5394 | * Assert spy was not.called after `anotherSpy`
|
5395 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledafteranotherspy
|
5396 | * @see https://on.cypress.io/assertions
|
5397 | */
|
5398 | (chainer: 'not.be.calledAfter' | 'not.have.been.calledAfter', spy: sinon.SinonSpy): Chainable<Subject>
|
5399 | /**
|
5400 | * Assert spy was not called before `anotherSpy`
|
5401 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledbeforeanotherspy
|
5402 | * @see https://on.cypress.io/assertions
|
5403 | */
|
5404 | (chainer: 'not.be.calledBefore' | 'not.have.been.calledBefore', spy: sinon.SinonSpy): Chainable<Subject>
|
5405 | /**
|
5406 | * 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)).
|
5407 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonobj
|
5408 | * @see https://on.cypress.io/assertions
|
5409 | */
|
5410 | (chainer: 'not.be.calledOn' | 'not.have.been.calledOn', context: any): Chainable<Subject>
|
5411 | /**
|
5412 | * Assert spy was not called exactly once
|
5413 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledonce
|
5414 | * @see https://on.cypress.io/assertions
|
5415 | */
|
5416 | (chainer: 'not.be.calledOnce' | 'not.have.been.calledOnce'): Chainable<Subject>
|
5417 | /**
|
5418 | * Assert spy was not called exactly three times
|
5419 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledthrice
|
5420 | * @see https://on.cypress.io/assertions
|
5421 | */
|
5422 | (chainer: 'not.be.calledThrice' | 'not.have.been.calledThrice'): Chainable<Subject>
|
5423 | /**
|
5424 | * Assert spy was not called exactly twice
|
5425 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledtwice
|
5426 | * @see https://on.cypress.io/assertions
|
5427 | */
|
5428 | (chainer: 'not.be.calledTwice' | 'not.have.been.calledTwice'): Chainable<Subject>
|
5429 | /**
|
5430 | * Assert spy was not called at least once with the provided arguments and no others.
|
5431 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithexactlyarg1-arg2-
|
5432 | * @see https://on.cypress.io/assertions
|
5433 | */
|
5434 | (chainer: 'not.be.calledWithExactly' | 'not.have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
|
5435 | /**
|
5436 | * Assert spy was not called with matching arguments (and possibly others).
|
5437 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithmatcharg1-arg2-
|
5438 | * @see https://on.cypress.io/assertions
|
5439 | */
|
5440 | (chainer: 'not.be.calledWithMatch' | 'not.have.been.calledWithMatch', ...args: any[]): Chainable<Subject>
|
5441 | /**
|
5442 | * Assert spy/stub was not called the `new` operator.
|
5443 | * 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.
|
5444 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwithnew
|
5445 | * @see https://on.cypress.io/assertions
|
5446 | */
|
5447 | (chainer: 'not.be.calledWithNew' | 'not.have.been.calledWithNew'): Chainable<Subject>
|
5448 | /**
|
5449 | * Assert spy did not always throw an exception.
|
5450 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwaysthrew
|
5451 | * @see https://on.cypress.io/assertions
|
5452 | */
|
5453 | (chainer: 'not.have.always.thrown', value?: Error | typeof Error | string): Chainable<Subject>
|
5454 | /**
|
5455 | * Assert not the number of calls.
|
5456 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycallcount
|
5457 | * @see https://on.cypress.io/assertions
|
5458 | */
|
5459 | (chainer: 'not.have.callCount', value: number): Chainable<Subject>
|
5460 | /**
|
5461 | * Assert spy did not throw an exception at least once.
|
5462 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spythrew
|
5463 | * @see https://on.cypress.io/assertions
|
5464 | */
|
5465 | (chainer: 'not.have.thrown', value?: Error | typeof Error | string): Chainable<Subject>
|
5466 | /**
|
5467 | * Assert spy did not return the provided value at least once. (see [matchers](http://sinonjs.org/releases/v4.1.3/spies/#matchers))
|
5468 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyreturnedobj
|
5469 | * @see https://on.cypress.io/assertions
|
5470 | */
|
5471 | (chainer: 'not.returned' | 'not.have.returned', value: any): Chainable<Subject>
|
5472 | /**
|
5473 | * Assert spy was called before anotherSpy, and no spy calls occurred between spy and anotherSpy.
|
5474 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelybeforeanotherspy
|
5475 | * @see https://on.cypress.io/assertions
|
5476 | */
|
5477 | (chainer: 'not.be.calledImmediatelyBefore' | 'not.have.been.calledImmediatelyBefore', anotherSpy: sinon.SinonSpy): Chainable<Subject>
|
5478 | /**
|
5479 | * Assert spy was called after anotherSpy, and no spy calls occurred between anotherSpy and spy.
|
5480 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledimmediatelyafteranotherspy
|
5481 | * @see https://on.cypress.io/assertions
|
5482 | */
|
5483 | (chainer: 'not.be.calledImmediatelyAfter' | 'not.have.been.calledImmediatelyAfter', anotherSpy: sinon.SinonSpy): Chainable<Subject>
|
5484 | /**
|
5485 | * Assert the spy was always called with obj as this
|
5486 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledonobj
|
5487 | * @see https://on.cypress.io/assertions
|
5488 | */
|
5489 | (chainer: 'not.be.always.calledOn' | 'not.always.have.been.calledOn', obj: any): Chainable<Subject>
|
5490 | /**
|
5491 | * Assert spy was called at least once with the provided arguments.
|
5492 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
|
5493 | * @see https://on.cypress.io/assertions
|
5494 | */
|
5495 | (chainer: 'not.be.calledWith' | 'not.have.been.calledWith', ...args: any[]): Chainable<Subject>
|
5496 | /**
|
5497 | * Assert spy was always called with the provided arguments (and possibly others).
|
5498 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwitharg1-arg2-
|
5499 | * @see https://on.cypress.io/assertions
|
5500 | */
|
5501 | (chainer: 'not.be.always.calledWith' | 'not.always.have.been.calledWith', ...args: any[]): Chainable<Subject>
|
5502 | /**
|
5503 | * Assert spy was called at exactly once with the provided arguments.
|
5504 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spycalledwitharg1-arg2-
|
5505 | * @see https://on.cypress.io/assertions
|
5506 | */
|
5507 | (chainer: 'not.be.calledOnceWith' | 'not.have.been.calledOnceWith', ...args: any[]): Chainable<Subject>
|
5508 | /**
|
5509 | * Assert spy was always called with the exact provided arguments.
|
5510 | * @see http://sinonjs.org/releases/v4.1.3/spies/#spyalwayscalledwithexactlyarg1-arg2-
|
5511 | * @see https://on.cypress.io/assertions
|
5512 | */
|
5513 | (chainer: 'not.be.always.calledWithExactly' | 'not.have.been.calledWithExactly', ...args: any[]): Chainable<Subject>
|
5514 | /**
|
5515 | * Assert spy was called at exactly once with the provided arguments.
|
5516 | * @see http://sinonjs.org/releases/v4.1.3/spies/#
|
5517 | * @see https://on.cypress.io/assertions
|
5518 | */
|
5519 | (chainer: 'not.be.calledOnceWithExactly' | 'not.have.been.calledOnceWithExactly', ...args: any[]): Chainable<Subject>
|
5520 | /**
|
5521 | * Assert spy always returned the provided value.
|
5522 | * @see http://sinonjs.org/releases/v4.1.3/spies/#
|
5523 | * @see https://on.cypress.io/assertions
|
5524 | */
|
5525 | (chainer: 'not.have.always.returned', obj: any): Chainable<Subject>
|
5526 |
|
5527 | // jquery-chai
|
5528 | /**
|
5529 | * Assert that at least one element of the selection is checked, using `.is(':checked')`.
|
5530 | * @example
|
5531 | * cy.get('#result').should('be.checked')
|
5532 | * @see http://chaijs.com/plugins/chai-jquery/#checked
|
5533 | * @see https://on.cypress.io/assertions
|
5534 | */
|
5535 | (chainer: 'be.checked'): Chainable<Subject>
|
5536 | /**
|
5537 | * Assert that at least one element of the selection is disabled, using `.is(':disabled')`.
|
5538 | * @example
|
5539 | * cy.get('#result').should('be.disabled')
|
5540 | * @see http://chaijs.com/plugins/chai-jquery/#disabled
|
5541 | * @see https://on.cypress.io/assertions
|
5542 | */
|
5543 | (chainer: 'be.disabled'): Chainable<Subject>
|
5544 | /**
|
5545 | * 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.
|
5546 | * @example
|
5547 | * cy.get('#result').should('be.empty')
|
5548 | * @see http://chaijs.com/plugins/chai-jquery/#empty
|
5549 | * @see https://on.cypress.io/assertions
|
5550 | */
|
5551 | (chainer: 'be.empty'): Chainable<Subject>
|
5552 | /**
|
5553 | * Assert that at least one element of the selection is enabled, using `.is(':enabled')`.
|
5554 | * @example
|
5555 | * cy.get('#result').should('be.enabled')
|
5556 | * @see http://chaijs.com/plugins/chai-jquery/#enabled
|
5557 | * @see https://on.cypress.io/assertions
|
5558 | */
|
5559 | (chainer: 'be.enabled'): Chainable<Subject>
|
5560 | /**
|
5561 | * Assert that at least one element of the selection is hidden, using `.is(':hidden')`.
|
5562 | * @example
|
5563 | * cy.get('#result').should('be.hidden')
|
5564 | * @see http://chaijs.com/plugins/chai-jquery/#hidden
|
5565 | * @see https://on.cypress.io/assertions
|
5566 | */
|
5567 | (chainer: 'be.hidden'): Chainable<Subject>
|
5568 | /**
|
5569 | * Assert that at least one element of the selection is selected, using `.is(':selected')`.
|
5570 | * @example
|
5571 | * cy.get('#result').should('be.selected')
|
5572 | * @see http://chaijs.com/plugins/chai-jquery/#selected
|
5573 | * @see https://on.cypress.io/assertions
|
5574 | */
|
5575 | (chainer: 'be.selected'): Chainable<Subject>
|
5576 | /**
|
5577 | * Assert that at least one element of the selection is visible, using `.is(':visible')`.
|
5578 | * @example
|
5579 | * cy.get('#result').should('be.visible')
|
5580 | * @see http://chaijs.com/plugins/chai-jquery/#visible
|
5581 | * @see https://on.cypress.io/assertions
|
5582 | */
|
5583 | (chainer: 'be.visible'): Chainable<Subject>
|
5584 | /**
|
5585 | * 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.
|
5586 | * @example
|
5587 | * cy.get('#result').should('contain', 'text')
|
5588 | * @see http://chaijs.com/plugins/chai-jquery/#containtext
|
5589 | * @see https://on.cypress.io/assertions
|
5590 | */
|
5591 | (chainer: 'contain', value: string): Chainable<Subject>
|
5592 | /**
|
5593 | * Assert that at least one element of the selection is focused.
|
5594 | * @example
|
5595 | * cy.get('#result').should('have.focus')
|
5596 | * cy.get('#result').should('be.focused')
|
5597 | * @see https://on.cypress.io/assertions
|
5598 | */
|
5599 | (chainer: 'have.focus'): Chainable<Subject>
|
5600 | /**
|
5601 | * Assert that at least one element of the selection is focused.
|
5602 | * @example
|
5603 | * cy.get('#result').should('be.focused')
|
5604 | * cy.get('#result').should('have.focus')
|
5605 | * @see https://on.cypress.io/assertions
|
5606 | */
|
5607 | (chainer: 'be.focused'): Chainable<Subject>
|
5608 | /**
|
5609 | * 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.
|
5610 | * @example
|
5611 | * cy.get('#result').should('exist')
|
5612 | * @see http://chaijs.com/plugins/chai-jquery/#exist
|
5613 | * @see https://on.cypress.io/assertions
|
5614 | */
|
5615 | (chainer: 'exist'): Chainable<Subject>
|
5616 | /**
|
5617 | * 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.
|
5618 | * @example
|
5619 | * cy.get('#result').should('have.attr', 'role')
|
5620 | * cy.get('#result').should('have.attr', 'role', 'menu')
|
5621 | * @see http://chaijs.com/plugins/chai-jquery/#attrname-value
|
5622 | * @see https://on.cypress.io/assertions
|
5623 | */
|
5624 | (chainer: 'have.attr', value: string, match?: string): Chainable<Subject>
|
5625 | /**
|
5626 | * 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.
|
5627 | * @example
|
5628 | * cy.get('#result').should('have.class', 'success')
|
5629 | * @see http://chaijs.com/plugins/chai-jquery/#classclassname
|
5630 | * @see https://on.cypress.io/assertions
|
5631 | */
|
5632 | (chainer: 'have.class', value: string): Chainable<Subject>
|
5633 | /**
|
5634 | * 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.
|
5635 | * @example
|
5636 | * cy.get('#result').should('have.css', 'display', 'none')
|
5637 | * @see http://chaijs.com/plugins/chai-jquery/#cssname-value
|
5638 | * @see https://on.cypress.io/assertions
|
5639 | */
|
5640 | (chainer: 'have.css', value: string, match?: string): Chainable<Subject>
|
5641 | /**
|
5642 | * 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.
|
5643 | * @example
|
5644 | * cy.get('#result').should('have.data', 'foo', 'bar')
|
5645 | * @see http://chaijs.com/plugins/chai-jquery/#dataname-value
|
5646 | * @see https://on.cypress.io/assertions
|
5647 | */
|
5648 | (chainer: 'have.data', value: string, match?: string): Chainable<Subject>
|
5649 | /**
|
5650 | * Assert that the selection contains at least one element which has a descendant matching the given selector, using `.has()`.
|
5651 | * @example
|
5652 | * cy.get('#result').should('have.descendants', 'h1')
|
5653 | * @see http://chaijs.com/plugins/chai-jquery/#descendantsselector
|
5654 | * @see https://on.cypress.io/assertions
|
5655 | */
|
5656 | (chainer: 'have.descendants', selector: string): Chainable<Subject>
|
5657 | /**
|
5658 | * Assert that the html of the first element of the selection is equal to the given html, using `.html()`.
|
5659 | * @example
|
5660 | * cy.get('#result').should('have.html', '<em>John Doe</em>')
|
5661 | * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
|
5662 | * @see https://on.cypress.io/assertions
|
5663 | */
|
5664 | (chainer: 'have.html', value: string): Chainable<Subject>
|
5665 | /**
|
5666 | * Assert that the html of the first element of the selection partially contains the given html, using `.html()`.
|
5667 | * @example
|
5668 | * cy.get('#result').should('contain.html', '<em>John Doe</em>')
|
5669 | * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
|
5670 | * @see https://on.cypress.io/assertions
|
5671 | */
|
5672 | (chainer: 'contain.html', value: string): Chainable<Subject>
|
5673 | /**
|
5674 | * Assert that the html of the first element of the selection partially contains the given html, using `.html()`.
|
5675 | * @example
|
5676 | * cy.get('#result').should('include.html', '<em>John Doe</em>')
|
5677 | * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
|
5678 | * @see https://on.cypress.io/assertions
|
5679 | */
|
5680 | (chainer: 'include.html', value: string): Chainable<Subject>
|
5681 | /**
|
5682 | * Assert that the first element of the selection has the given id, using `.attr('id')`.
|
5683 | * @example
|
5684 | * cy.get('#result').should('have.id', 'result')
|
5685 | * @see http://chaijs.com/plugins/chai-jquery/#idid
|
5686 | * @see https://on.cypress.io/assertions
|
5687 | */
|
5688 | (chainer: 'have.id', value: string, match?: string): Chainable<Subject>
|
5689 | /**
|
5690 | * 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.
|
5691 | * @example
|
5692 | * cy.get('#result').should('have.prop', 'disabled')
|
5693 | * cy.get('#result').should('have.prop', 'disabled', false)
|
5694 | * @see http://chaijs.com/plugins/chai-jquery/#propname-value
|
5695 | * @see https://on.cypress.io/assertions
|
5696 | */
|
5697 | (chainer: 'have.prop', value: string, match?: any): Chainable<Subject>
|
5698 | /**
|
5699 | * Assert that the text of the first element of the selection is equal to the given text, using `.text()`.
|
5700 | * @example
|
5701 | * cy.get('#result').should('have.text', 'John Doe')
|
5702 | * @see http://chaijs.com/plugins/chai-jquery/#texttext
|
5703 | * @see https://on.cypress.io/assertions
|
5704 | */
|
5705 | (chainer: 'have.text', value: string): Chainable<Subject>
|
5706 | /**
|
5707 | * Assert that the text of the first element of the selection partially contains the given text, using `.text()`.
|
5708 | * @example
|
5709 | * cy.get('#result').should('contain.text', 'John Doe')
|
5710 | * @see http://chaijs.com/plugins/chai-jquery/#texttext
|
5711 | * @see https://on.cypress.io/assertions
|
5712 | */
|
5713 | (chainer: 'contain.text', value: string): Chainable<Subject>
|
5714 | /**
|
5715 | * Assert that the text of the first element of the selection partially contains the given text, using `.text()`.
|
5716 | * @example
|
5717 | * cy.get('#result').should('include.text', 'John Doe')
|
5718 | * @see http://chaijs.com/plugins/chai-jquery/#texttext
|
5719 | * @see https://on.cypress.io/assertions
|
5720 | */
|
5721 | (chainer: 'include.text', value: string): Chainable<Subject>
|
5722 | /**
|
5723 | * Assert that the first element of the selection has the given value, using `.val()`.
|
5724 | * @example
|
5725 | * cy.get('textarea').should('have.value', 'foo bar baz')
|
5726 | * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
|
5727 | * @see https://on.cypress.io/assertions
|
5728 | */
|
5729 | (chainer: 'have.value', value: string): Chainable<Subject>
|
5730 | /**
|
5731 | * Assert that the first element of the selection partially contains the given value, using `.val()`.
|
5732 | * @example
|
5733 | * cy.get('textarea').should('contain.value', 'foo bar baz')
|
5734 | * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
|
5735 | * @see https://on.cypress.io/assertions
|
5736 | */
|
5737 | (chainer: 'contain.value', value: string): Chainable<Subject>
|
5738 | /**
|
5739 | * Assert that the first element of the selection partially contains the given value, using `.val()`.
|
5740 | * @example
|
5741 | * cy.get('textarea').should('include.value', 'foo bar baz')
|
5742 | * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
|
5743 | * @see https://on.cypress.io/assertions
|
5744 | */
|
5745 | (chainer: 'include.value', value: string): Chainable<Subject>
|
5746 | /**
|
5747 | * 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.
|
5748 | * @example
|
5749 | * cy.get('#result').should('match', ':empty')
|
5750 | * @see http://chaijs.com/plugins/chai-jquery/#matchselector
|
5751 | * @see https://on.cypress.io/assertions
|
5752 | */
|
5753 | (chainer: 'match', value: string): Chainable<Subject>
|
5754 |
|
5755 | // jquery-chai.not
|
5756 | /**
|
5757 | * Assert that at least one element of the selection is not checked, using `.is(':checked')`.
|
5758 | * @example
|
5759 | * cy.get('#result').should('not.be.checked')
|
5760 | * @see http://chaijs.com/plugins/chai-jquery/#checked
|
5761 | * @see https://on.cypress.io/assertions
|
5762 | */
|
5763 | (chainer: 'not.be.checked'): Chainable<Subject>
|
5764 | /**
|
5765 | * Assert that at least one element of the selection is not disabled, using `.is(':disabled')`.
|
5766 | * @example
|
5767 | * cy.get('#result').should('not.be.disabled')
|
5768 | * @see http://chaijs.com/plugins/chai-jquery/#disabled
|
5769 | * @see https://on.cypress.io/assertions
|
5770 | */
|
5771 | (chainer: 'not.be.disabled'): Chainable<Subject>
|
5772 | /**
|
5773 | * 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.
|
5774 | * @example
|
5775 | * cy.get('#result').should('not.be.empty')
|
5776 | * @see http://chaijs.com/plugins/chai-jquery/#empty
|
5777 | * @see https://on.cypress.io/assertions
|
5778 | */
|
5779 | (chainer: 'not.be.empty'): Chainable<Subject>
|
5780 | /**
|
5781 | * Assert that at least one element of the selection is not enabled, using `.is(':enabled')`.
|
5782 | * @example
|
5783 | * cy.get('#result').should('not.be.enabled')
|
5784 | * @see http://chaijs.com/plugins/chai-jquery/#enabled
|
5785 | * @see https://on.cypress.io/assertions
|
5786 | */
|
5787 | (chainer: 'not.be.enabled'): Chainable<Subject>
|
5788 | /**
|
5789 | * Assert that at least one element of the selection is not hidden, using `.is(':hidden')`.
|
5790 | * @example
|
5791 | * cy.get('#result').should('not.be.hidden')
|
5792 | * @see http://chaijs.com/plugins/chai-jquery/#hidden
|
5793 | * @see https://on.cypress.io/assertions
|
5794 | */
|
5795 | (chainer: 'not.be.hidden'): Chainable<Subject>
|
5796 | /**
|
5797 | * Assert that at least one element of the selection is not selected, using `.is(':selected')`.
|
5798 | * @example
|
5799 | * cy.get('#result').should('not.be.selected')
|
5800 | * @see http://chaijs.com/plugins/chai-jquery/#selected
|
5801 | * @see https://on.cypress.io/assertions
|
5802 | */
|
5803 | (chainer: 'not.be.selected'): Chainable<Subject>
|
5804 | /**
|
5805 | * Assert that at least one element of the selection is not visible, using `.is(':visible')`.
|
5806 | * @example
|
5807 | * cy.get('#result').should('not.be.visible')
|
5808 | * @see http://chaijs.com/plugins/chai-jquery/#visible
|
5809 | * @see https://on.cypress.io/assertions
|
5810 | */
|
5811 | (chainer: 'not.be.visible'): Chainable<Subject>
|
5812 | /**
|
5813 | * Assert that no element of the selection is focused.
|
5814 | * @example
|
5815 | * cy.get('#result').should('not.have.focus')
|
5816 | * cy.get('#result').should('not.be.focused')
|
5817 | * @see https://on.cypress.io/assertions
|
5818 | */
|
5819 | (chainer: 'not.have.focus'): Chainable<Subject>
|
5820 | /**
|
5821 | * Assert that no element of the selection is focused.
|
5822 | * @example
|
5823 | * cy.get('#result').should('not.be.focused')
|
5824 | * cy.get('#result').should('not.have.focus')
|
5825 | * @see https://on.cypress.io/assertions
|
5826 | */
|
5827 | (chainer: 'not.be.focused'): Chainable<Subject>
|
5828 | /**
|
5829 | * 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.
|
5830 | * @example
|
5831 | * cy.get('#result').should('not.contain', 'text')
|
5832 | * @see http://chaijs.com/plugins/chai-jquery/#containtext
|
5833 | * @see https://on.cypress.io/assertions
|
5834 | */
|
5835 | (chainer: 'not.contain', value: string): Chainable<Subject>
|
5836 | /**
|
5837 | * 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.
|
5838 | * @example
|
5839 | * cy.get('#result').should('not.exist')
|
5840 | * @see http://chaijs.com/plugins/chai-jquery/#exist
|
5841 | * @see https://on.cypress.io/assertions
|
5842 | */
|
5843 | (chainer: 'not.exist'): Chainable<Subject>
|
5844 | /**
|
5845 | * 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.
|
5846 | * @example
|
5847 | * cy.get('#result').should('not.have.attr', 'role')
|
5848 | * cy.get('#result').should('not.have.attr', 'role', 'menu')
|
5849 | * @see http://chaijs.com/plugins/chai-jquery/#attrname-value
|
5850 | * @see https://on.cypress.io/assertions
|
5851 | */
|
5852 | (chainer: 'not.have.attr', value: string, match?: string): Chainable<Subject>
|
5853 | /**
|
5854 | * 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.
|
5855 | * @example
|
5856 | * cy.get('#result').should('not.have.class', 'success')
|
5857 | * @see http://chaijs.com/plugins/chai-jquery/#classclassname
|
5858 | * @see https://on.cypress.io/assertions
|
5859 | */
|
5860 | (chainer: 'not.have.class', value: string): Chainable<Subject>
|
5861 | /**
|
5862 | * 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.
|
5863 | * @example
|
5864 | * cy.get('#result').should('not.have.css', 'display', 'none')
|
5865 | * @see http://chaijs.com/plugins/chai-jquery/#cssname-value
|
5866 | * @see https://on.cypress.io/assertions
|
5867 | */
|
5868 | (chainer: 'not.have.css', value: string, match?: string): Chainable<Subject>
|
5869 | /**
|
5870 | * 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.
|
5871 | * @example
|
5872 | * cy.get('#result').should('not.have.data', 'foo', 'bar')
|
5873 | * @see http://chaijs.com/plugins/chai-jquery/#dataname-value
|
5874 | * @see https://on.cypress.io/assertions
|
5875 | */
|
5876 | (chainer: 'not.have.data', value: string, match?: string): Chainable<Subject>
|
5877 | /**
|
5878 | * Assert that the selection does not contain at least one element which has a descendant matching the given selector, using `.has()`.
|
5879 | * @example
|
5880 | * cy.get('#result').should('not.have.descendants', 'h1')
|
5881 | * @see http://chaijs.com/plugins/chai-jquery/#descendantsselector
|
5882 | * @see https://on.cypress.io/assertions
|
5883 | */
|
5884 | (chainer: 'not.have.descendants', selector: string): Chainable<Subject>
|
5885 | /**
|
5886 | * Assert that the html of the first element of the selection is not equal to the given html, using `.html()`.
|
5887 | * @example
|
5888 | * cy.get('#result').should('not.have.html', '<em>John Doe</em>')
|
5889 | * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
|
5890 | * @see https://on.cypress.io/assertions
|
5891 | */
|
5892 | (chainer: 'not.have.html', value: string): Chainable<Subject>
|
5893 | /**
|
5894 | * Assert that the html of the first element of the selection does not contain the given html, using `.html()`.
|
5895 | * @example
|
5896 | * cy.get('#result').should('not.contain.html', '<em>John Doe</em>')
|
5897 | * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
|
5898 | * @see https://on.cypress.io/assertions
|
5899 | */
|
5900 | (chainer: 'not.contain.html', value: string): Chainable<Subject>
|
5901 | /**
|
5902 | * Assert that the html of the first element of the selection does not contain the given html, using `.html()`.
|
5903 | * @example
|
5904 | * cy.get('#result').should('not.include.html', '<em>John Doe</em>')
|
5905 | * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
|
5906 | * @see https://on.cypress.io/assertions
|
5907 | */
|
5908 | (chainer: 'not.include.html', value: string): Chainable<Subject>
|
5909 | /**
|
5910 | * Assert that the first element of the selection does not have the given id, using `.attr('id')`.
|
5911 | * @example
|
5912 | * cy.get('#result').should('not.have.id', 'result')
|
5913 | * @see http://chaijs.com/plugins/chai-jquery/#idid
|
5914 | * @see https://on.cypress.io/assertions
|
5915 | */
|
5916 | (chainer: 'not.have.id', value: string, match?: string): Chainable<Subject>
|
5917 | /**
|
5918 | * 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.
|
5919 | * @example
|
5920 | * cy.get('#result').should('not.have.prop', 'disabled')
|
5921 | * cy.get('#result').should('not.have.prop', 'disabled', false)
|
5922 | * @see http://chaijs.com/plugins/chai-jquery/#propname-value
|
5923 | * @see https://on.cypress.io/assertions
|
5924 | */
|
5925 | (chainer: 'not.have.prop', value: string, match?: any): Chainable<Subject>
|
5926 | /**
|
5927 | * Assert that the text of the first element of the selection is not equal to the given text, using `.text()`.
|
5928 | * @example
|
5929 | * cy.get('#result').should('not.have.text', 'John Doe')
|
5930 | * @see http://chaijs.com/plugins/chai-jquery/#texttext
|
5931 | * @see https://on.cypress.io/assertions
|
5932 | */
|
5933 | (chainer: 'not.have.text', value: string): Chainable<Subject>
|
5934 | /**
|
5935 | * Assert that the text of the first element of the selection does not contain the given text, using `.text()`.
|
5936 | * @example
|
5937 | * cy.get('#result').should('not.contain.text', 'John Doe')
|
5938 | * @see http://chaijs.com/plugins/chai-jquery/#texttext
|
5939 | * @see https://on.cypress.io/assertions
|
5940 | */
|
5941 | (chainer: 'not.contain.text', value: string): Chainable<Subject>
|
5942 | /**
|
5943 | * Assert that the text of the first element of the selection does not contain the given text, using `.text()`.
|
5944 | * @example
|
5945 | * cy.get('#result').should('not.include.text', 'John Doe')
|
5946 | * @see http://chaijs.com/plugins/chai-jquery/#texttext
|
5947 | * @see https://on.cypress.io/assertions
|
5948 | */
|
5949 | (chainer: 'not.include.text', value: string): Chainable<Subject>
|
5950 | /**
|
5951 | * Assert that the first element of the selection does not have the given value, using `.val()`.
|
5952 | * @example
|
5953 | * cy.get('textarea').should('not.have.value', 'foo bar baz')
|
5954 | * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
|
5955 | * @see https://on.cypress.io/assertions
|
5956 | */
|
5957 | (chainer: 'not.have.value', value: string): Chainable<Subject>
|
5958 | /**
|
5959 | * Assert that the first element of the selection does not contain the given value, using `.val()`.
|
5960 | * @example
|
5961 | * cy.get('textarea').should('not.contain.value', 'foo bar baz')
|
5962 | * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
|
5963 | * @see https://on.cypress.io/assertions
|
5964 | */
|
5965 | (chainer: 'not.contain.value', value: string): Chainable<Subject>
|
5966 | /**
|
5967 | * Assert that the first element of the selection does not contain the given value, using `.val()`.
|
5968 | * @example
|
5969 | * cy.get('textarea').should('not.include.value', 'foo bar baz')
|
5970 | * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
|
5971 | * @see https://on.cypress.io/assertions
|
5972 | */
|
5973 | (chainer: 'not.include.value', value: string): Chainable<Subject>
|
5974 | /**
|
5975 | * 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.
|
5976 | * @example
|
5977 | * cy.get('#result').should('not.match', ':empty')
|
5978 | * @see http://chaijs.com/plugins/chai-jquery/#matchselector
|
5979 | * @see https://on.cypress.io/assertions
|
5980 | */
|
5981 | (chainer: 'not.match', value: string): Chainable<Subject>
|
5982 |
|
5983 | // fallback
|
5984 | /**
|
5985 | * Create an assertion. Assertions are automatically retried until they pass or time out.
|
5986 | * Ctrl+Space will invoke auto-complete in most editors.
|
5987 | * @see https://on.cypress.io/should
|
5988 | */
|
5989 | (chainers: string, value?: any): Chainable<Subject>
|
5990 | (chainers: string, value: any, match: any): Chainable<Subject>
|
5991 |
|
5992 | /**
|
5993 | * Create an assertion. Assertions are automatically retried until they pass or time out.
|
5994 | * 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.
|
5995 | * 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.
|
5996 | * @example
|
5997 | * cy
|
5998 | * .get('p')
|
5999 | * .should(($p) => {
|
6000 | * // should have found 3 elements
|
6001 | * expect($p).to.have.length(3)
|
6002 | *
|
6003 | * // make sure the first contains some text content
|
6004 | * expect($p.first()).to.contain('Hello World')
|
6005 | *
|
6006 | * // use jquery's map to grab all of their classes
|
6007 | * // jquery's map returns a new jquery object
|
6008 | * const classes = $p.map((i, el) => {
|
6009 | * return Cypress.$(el).attr('class')
|
6010 | * })
|
6011 | *
|
6012 | * // call classes.get() to make this a plain array
|
6013 | * expect(classes.get()).to.deep.eq([
|
6014 | * 'text-primary',
|
6015 | * 'text-danger',
|
6016 | * 'text-default'
|
6017 | * ])
|
6018 | * })
|
6019 | * @see https://on.cypress.io/should
|
6020 | */
|
6021 | (fn: (currentSubject: Subject) => void): Chainable<Subject>
|
6022 | }
|
6023 |
|
6024 | interface AfterBrowserLaunchDetails {
|
6025 | webSocketDebuggerUrl: string
|
6026 | }
|
6027 |
|
6028 | interface BeforeBrowserLaunchOptions {
|
6029 | extensions: string[]
|
6030 | preferences: { [key: string]: any }
|
6031 | args: string[]
|
6032 | env: { [key: string]: any }
|
6033 | }
|
6034 |
|
6035 | interface Dimensions {
|
6036 | width: number
|
6037 | height: number
|
6038 | }
|
6039 |
|
6040 | interface ScreenshotDetails {
|
6041 | size: number
|
6042 | takenAt: string
|
6043 | duration: number
|
6044 | dimensions: Dimensions
|
6045 | multipart: boolean
|
6046 | pixelRatio: number
|
6047 | name: string
|
6048 | specName: string
|
6049 | testFailure: boolean
|
6050 | path: string
|
6051 | scaled: boolean
|
6052 | blackout: string[]
|
6053 | }
|
6054 |
|
6055 | interface AfterScreenshotReturnObject {
|
6056 | path?: string
|
6057 | size?: number
|
6058 | dimensions?: Dimensions
|
6059 | }
|
6060 |
|
6061 | interface FileObject extends NodeEventEmitter {
|
6062 | filePath: string
|
6063 | outputPath: string
|
6064 | shouldWatch: boolean
|
6065 | }
|
6066 |
|
6067 | /**
|
6068 | * Individual task callback. Receives a single argument and _should_ return
|
6069 | * anything but `undefined` or a promise that resolves anything but `undefined`
|
6070 | * TODO: find a way to express "anything but undefined" in TypeScript
|
6071 | */
|
6072 | type Task = (value: any) => any
|
6073 |
|
6074 | interface Tasks {
|
6075 | [key: string]: Task
|
6076 | }
|
6077 |
|
6078 | interface SystemDetails {
|
6079 | osName: string
|
6080 | osVersion: string
|
6081 | }
|
6082 |
|
6083 | interface BeforeRunDetails {
|
6084 | browser?: Browser
|
6085 | config: ConfigOptions
|
6086 | cypressVersion: string
|
6087 | group?: string
|
6088 | parallel?: boolean
|
6089 | runUrl?: string
|
6090 | specs?: Spec[]
|
6091 | specPattern?: string[]
|
6092 | system: SystemDetails
|
6093 | tag?: string
|
6094 | autoCancelAfterFailures?: number | false
|
6095 | }
|
6096 |
|
6097 | interface DevServerConfig {
|
6098 | specs: Spec[]
|
6099 | cypressConfig: PluginConfigOptions
|
6100 | devServerEvents: NodeJS.EventEmitter
|
6101 | }
|
6102 |
|
6103 | interface ResolvedDevServerConfig {
|
6104 | port: number
|
6105 | close: (done?: (err?: Error) => any) => void
|
6106 | }
|
6107 |
|
6108 | interface PluginEvents {
|
6109 | (action: 'after:browser:launch', fn: (browser: Browser, browserLaunchDetails: AfterBrowserLaunchDetails) => void | Promise<void>): void
|
6110 | (action: 'after:run', fn: (results: CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult) => void | Promise<void>): void
|
6111 | (action: 'after:screenshot', fn: (details: ScreenshotDetails) => void | AfterScreenshotReturnObject | Promise<AfterScreenshotReturnObject>): void
|
6112 | (action: 'after:spec', fn: (spec: Spec, results: CypressCommandLine.RunResult) => void | Promise<void>): void
|
6113 | (action: 'before:run', fn: (runDetails: BeforeRunDetails) => void | Promise<void>): void
|
6114 | (action: 'before:spec', fn: (spec: Spec) => void | Promise<void>): void
|
6115 | (action: 'before:browser:launch', fn: (browser: Browser, afterBrowserLaunchOptions: BeforeBrowserLaunchOptions) => void | Promise<void> | BeforeBrowserLaunchOptions | Promise<BeforeBrowserLaunchOptions>): void
|
6116 | (action: 'file:preprocessor', fn: (file: FileObject) => string | Promise<string>): void
|
6117 | (action: 'dev-server:start', fn: (file: DevServerConfig) => Promise<ResolvedDevServerConfig>): void
|
6118 | (action: 'task', tasks: Tasks): void
|
6119 | }
|
6120 |
|
6121 | interface CodeFrame {
|
6122 | frame: string
|
6123 | language: string
|
6124 | line: number
|
6125 | column: number
|
6126 | absoluteFile: string
|
6127 | originalFile: string
|
6128 | relativeFile: string
|
6129 | }
|
6130 |
|
6131 | interface CypressError extends Error {
|
6132 | docsUrl?: string
|
6133 | codeFrame?: CodeFrame
|
6134 | }
|
6135 |
|
6136 | // for just a few events like "window:alert" it makes sense to allow passing cy.stub() or
|
6137 | // a user callback function. Others probably only need a callback function.
|
6138 |
|
6139 | /**
|
6140 | * These events come from the application currently under test (your application).
|
6141 | * These are the most useful events for you to listen to.
|
6142 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6143 | */
|
6144 | interface Actions {
|
6145 | /**
|
6146 | * 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.
|
6147 | * Cypress will fail the test when this fires.
|
6148 | * 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.
|
6149 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6150 | * @example
|
6151 | ```
|
6152 | // likely want to do this in a support file
|
6153 | // so it's applied to all spec files
|
6154 | // cypress/support/{e2e|component}.js
|
6155 |
|
6156 | Cypress.on('uncaught:exception', (err, runnable) => {
|
6157 | // returning false here prevents Cypress from
|
6158 | // failing the test
|
6159 | return false
|
6160 | })
|
6161 | // stub "window.alert" in a single test
|
6162 | it('shows alert', () => {
|
6163 | const stub = cy.stub()
|
6164 | cy.on('window:alert', stub)
|
6165 | // trigger application code that calls alert(...)
|
6166 | .then(() => {
|
6167 | expect(stub).to.have.been.calledOnce
|
6168 | })
|
6169 | })
|
6170 | ```
|
6171 | */
|
6172 | (action: 'uncaught:exception', fn: (error: Error, runnable: Mocha.Runnable, promise?: Promise<any>) => false | void): Cypress
|
6173 | /**
|
6174 | * Fires when your app calls the global `window.confirm()` method.
|
6175 | * Cypress will auto accept confirmations. Return `false` from this event and the confirmation will be canceled.
|
6176 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6177 | * @example
|
6178 | ```
|
6179 | cy.on('window:confirm', (str) => {
|
6180 | console.log(str)
|
6181 | return false // simulate "Cancel"
|
6182 | })
|
6183 | ```
|
6184 | */
|
6185 | (action: 'window:confirm', fn: ((text: string) => false | void) | SinonSpyAgent<sinon.SinonSpy> | SinonSpyAgent<sinon.SinonStub>): Cypress
|
6186 | /**
|
6187 | * Fires when your app calls the global `window.alert()` method.
|
6188 | * Cypress will auto accept alerts. You cannot change this behavior.
|
6189 | * @example
|
6190 | ```
|
6191 | const stub = cy.stub()
|
6192 | cy.on('window:alert', stub)
|
6193 | // assume the button calls window.alert()
|
6194 | cy.get('.my-button')
|
6195 | .click()
|
6196 | .then(() => {
|
6197 | expect(stub).to.have.been.calledOnce
|
6198 | })
|
6199 | ```
|
6200 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6201 | */
|
6202 | (action: 'window:alert', fn: ((text: string) => void) | SinonSpyAgent<sinon.SinonSpy> | SinonSpyAgent<sinon.SinonStub>): Cypress
|
6203 | /**
|
6204 | * Fires as the page begins to load, but before any of your applications JavaScript has executed.
|
6205 | * This fires at the exact same time as `cy.visit()` `onBeforeLoad` callback.
|
6206 | * Useful to modify the window on a page transition.
|
6207 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6208 | */
|
6209 | (action: 'window:before:load', fn: (win: AUTWindow) => void): Cypress
|
6210 | /**
|
6211 | * Fires after all your resources have finished loading after a page transition.
|
6212 | * This fires at the exact same time as a `cy.visit()` `onLoad` callback.
|
6213 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6214 | */
|
6215 | (action: 'window:load', fn: (win: AUTWindow) => void): Cypress
|
6216 | /**
|
6217 | * Fires when your application is about to navigate away.
|
6218 | * The real event object is provided to you.
|
6219 | * Your app may have set a `returnValue` on the event, which is useful to assert on.
|
6220 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6221 | */
|
6222 | (action: 'window:before:unload', fn: (event: BeforeUnloadEvent) => void): Cypress
|
6223 | /**
|
6224 | * Fires when your application is has unloaded and is navigating away.
|
6225 | * The real event object is provided to you. This event is not cancelable.
|
6226 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6227 | */
|
6228 | (action: 'window:unload', fn: (event: Event) => void): Cypress
|
6229 | /**
|
6230 | * Fires whenever Cypress detects that your application's URL has changed.
|
6231 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6232 | */
|
6233 | (action: 'url:changed', fn: (url: string) => void): Cypress
|
6234 | /**
|
6235 | * Fires when the test has failed. It is technically possible to prevent the test
|
6236 | * from actually failing by binding to this event and invoking an async `done` callback.
|
6237 | * However this is **strongly discouraged**. Tests should never legitimately fail.
|
6238 | * This event exists because it's extremely useful for debugging purposes.
|
6239 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6240 | */
|
6241 | (action: 'fail', fn: (error: CypressError, mocha: Mocha.Runnable) => void): Cypress
|
6242 | /**
|
6243 | * Fires whenever the viewport changes via a `cy.viewport()` or naturally when
|
6244 | * Cypress resets the viewport to the default between tests. Useful for debugging purposes.
|
6245 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6246 | */
|
6247 | (action: 'viewport:changed', fn: (viewport: Viewport) => void): Cypress
|
6248 | /**
|
6249 | * Fires whenever **Cypress** is scrolling your application.
|
6250 | * This event is fired when Cypress is {% url 'waiting for and calculating
|
6251 | * actionability' interacting-with-elements %}. It will scroll to 'uncover'
|
6252 | * elements currently being covered. This event is extremely useful to debug why
|
6253 | * Cypress may think an element is not interactive.
|
6254 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6255 | */
|
6256 | (action: 'scrolled', fn: ($el: JQuery) => void): Cypress
|
6257 | /**
|
6258 | * Fires when a cy command is first invoked and enqueued to be run later.
|
6259 | * Useful for debugging purposes if you're confused about the order in which commands will execute.
|
6260 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6261 | */
|
6262 | (action: 'command:enqueued', fn: (command: EnqueuedCommandAttributes) => void): Cypress
|
6263 | /**
|
6264 | * Fires when cy begins actually running and executing your command.
|
6265 | * Useful for debugging and understanding how the command queue is async.
|
6266 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6267 | */
|
6268 | (action: 'command:start', fn: (command: CommandQueue) => void): Cypress
|
6269 | /**
|
6270 | * Fires when cy finishes running and executing your command.
|
6271 | * Useful for debugging and understanding how commands are handled.
|
6272 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6273 | */
|
6274 | (action: 'command:end', fn: (command: CommandQueue) => void): Cypress
|
6275 | /**
|
6276 | * Fires when a command is skipped, namely the `should` command.
|
6277 | * Useful for debugging and understanding how commands are handled.
|
6278 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6279 | */
|
6280 | (action: 'skipped:command:end', fn: (command: CommandQueue) => void): Cypress
|
6281 | /**
|
6282 | * Fires whenever a command begins its retrying routines.
|
6283 | * This is called on the trailing edge after Cypress has internally
|
6284 | * waited for the retry interval. Useful to understand **why** a command is retrying,
|
6285 | * and generally includes the actual error causing the retry to happen.
|
6286 | * When commands fail the final error is the one that actually bubbles up to fail the test.
|
6287 | * This event is essentially to debug why Cypress is failing.
|
6288 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6289 | */
|
6290 | (action: 'command:retry', fn: (command: CommandQueue) => void): Cypress
|
6291 | /**
|
6292 | * Fires whenever a command emits this event so it can be displayed in the Command Log.
|
6293 | * Useful to see how internal cypress commands utilize the {% url 'Cypress.log()' cypress-log %} API.
|
6294 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6295 | */
|
6296 | (action: 'log:added', fn: (attributes: ObjectLike, log: any) => void): Cypress
|
6297 | /**
|
6298 | * Fires whenever a command's attributes changes.
|
6299 | * This event is debounced to prevent it from firing too quickly and too often.
|
6300 | * Useful to see how internal cypress commands utilize the {% url 'Cypress.log()' cypress-log %} API.
|
6301 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6302 | */
|
6303 | (action: 'log:changed', fn: (attributes: ObjectLike, log: any) => void): Cypress
|
6304 | /**
|
6305 | * Fires before the test and all **before** and **beforeEach** hooks run.
|
6306 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6307 | */
|
6308 | (action: 'test:before:run', fn: (attributes: ObjectLike, test: Mocha.Test) => void): Cypress
|
6309 | /**
|
6310 | * Fires before the test and all **before** and **beforeEach** hooks run.
|
6311 | * If a `Promise` is returned, it will be awaited before proceeding.
|
6312 | */
|
6313 | (action: 'test:before:run:async', fn: (attributes: ObjectLike, test: Mocha.Test) => void | Promise<any>): Cypress
|
6314 | /**
|
6315 | * Fires after the test and all **afterEach** and **after** hooks run.
|
6316 | * @see https://on.cypress.io/catalog-of-events#App-Events
|
6317 | */
|
6318 | (action: 'test:after:run', fn: (attributes: ObjectLike, test: Mocha.Test) => void): Cypress
|
6319 | }
|
6320 |
|
6321 | // $CommandQueue from `command_queue.coffee` - a lot to type. Might be more useful if it was written in TS
|
6322 | interface CommandQueue extends ObjectLike {
|
6323 | logs(filters: any): any
|
6324 | add(obj: any): any
|
6325 | get(): any
|
6326 | get<K extends keyof CommandQueue>(key: string): CommandQueue[K]
|
6327 | toJSON(): string[]
|
6328 | create(): CommandQueue
|
6329 | }
|
6330 |
|
6331 | /**
|
6332 | * 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.
|
6333 | */
|
6334 | interface Clock {
|
6335 | /**
|
6336 | * Move the clock the specified number of `milliseconds`.
|
6337 | * Any timers within the affected range of time will be called.
|
6338 | * @param time Number in ms to advance the clock
|
6339 | * @see https://on.cypress.io/tick
|
6340 | */
|
6341 | tick(time: number): void
|
6342 | /**
|
6343 | * Restore all overridden native functions.
|
6344 | * This is automatically called between tests, so should not generally be needed.
|
6345 | * @see https://on.cypress.io/clock
|
6346 | * @example
|
6347 | * cy.clock()
|
6348 | * cy.visit('/')
|
6349 | * ...
|
6350 | * cy.clock().then(clock => {
|
6351 | * clock.restore()
|
6352 | * })
|
6353 | * // or use this shortcut
|
6354 | * cy.clock().invoke('restore')
|
6355 | */
|
6356 | restore(): void
|
6357 | /**
|
6358 | * Change the time without invoking any timers.
|
6359 | *
|
6360 | * Default value with no argument or undefined is 0.
|
6361 | *
|
6362 | * This can be useful if you need to change the time by an hour
|
6363 | * while there is a setInterval registered that may otherwise run thousands
|
6364 | * of times.
|
6365 | * @see https://on.cypress.io/clock
|
6366 | * @example
|
6367 | * cy.clock()
|
6368 | * cy.visit('/')
|
6369 | * ...
|
6370 | * cy.clock().then(clock => {
|
6371 | * clock.setSystemTime(60 * 60 * 1000)
|
6372 | * })
|
6373 | * // or use this shortcut
|
6374 | * cy.clock().invoke('setSystemTime', 60 * 60 * 1000)
|
6375 | */
|
6376 | setSystemTime(now?: number | Date): void
|
6377 | }
|
6378 |
|
6379 | interface Cookie {
|
6380 | name: string
|
6381 | value: string
|
6382 | path: string
|
6383 | domain: string
|
6384 | hostOnly?: boolean
|
6385 | httpOnly: boolean
|
6386 | secure: boolean
|
6387 | expiry?: number
|
6388 | sameSite?: SameSiteStatus
|
6389 | }
|
6390 |
|
6391 | interface EnqueuedCommandAttributes {
|
6392 | id: string
|
6393 | name: string
|
6394 | args: any[]
|
6395 | type: string
|
6396 | chainerId: string
|
6397 | injected: boolean
|
6398 | userInvocationStack?: string
|
6399 | query?: boolean
|
6400 | fn(...args: any[]): any
|
6401 | }
|
6402 |
|
6403 | interface Command {
|
6404 | get<K extends keyof EnqueuedCommandAttributes>(attr: K): EnqueuedCommandAttributes[K]
|
6405 | get(): EnqueuedCommandAttributes
|
6406 | set<K extends keyof EnqueuedCommandAttributes>(key: K, value: EnqueuedCommandAttributes[K]): Log
|
6407 | set(options: Partial<EnqueuedCommandAttributes>): Log
|
6408 | }
|
6409 |
|
6410 | interface Exec {
|
6411 | code: number
|
6412 | stdout: string
|
6413 | stderr: string
|
6414 | }
|
6415 |
|
6416 | type TypedArray =
|
6417 | | Int8Array
|
6418 | | Uint8Array
|
6419 | | Uint8ClampedArray
|
6420 | | Int16Array
|
6421 | | Uint16Array
|
6422 | | Int32Array
|
6423 | | Uint32Array
|
6424 | | Float32Array
|
6425 | | Float64Array
|
6426 |
|
6427 | type FileReference = string | BufferType | FileReferenceObject | TypedArray
|
6428 | interface FileReferenceObject {
|
6429 | /*
|
6430 | * Buffers will be used as-is, while strings will be interpreted as an alias or a file path.
|
6431 | * All other types will have `Buffer.from(JSON.stringify())` applied.
|
6432 | */
|
6433 | contents: any
|
6434 | fileName?: string
|
6435 | mimeType?: string
|
6436 | lastModified?: number
|
6437 | }
|
6438 |
|
6439 | interface LogAttrs {
|
6440 | url: string
|
6441 | consoleProps: ObjectLike
|
6442 | }
|
6443 |
|
6444 | interface Log {
|
6445 | end(): Log
|
6446 | error(error: Error): Log
|
6447 | finish(): void
|
6448 | get<K extends keyof LogConfig>(attr: K): LogConfig[K]
|
6449 | get(): LogConfig
|
6450 | set<K extends keyof LogConfig>(key: K, value: LogConfig[K]): Log
|
6451 | set(options: Partial<LogConfig>): Log
|
6452 | snapshot(name?: string, options?: { at?: number, next: string }): Log
|
6453 | }
|
6454 |
|
6455 | interface LogConfig extends Timeoutable {
|
6456 | /** Unique id for the log, in the form of '<origin>-<number>' */
|
6457 | id: string
|
6458 | /** The JQuery element for the command. This will highlight the command in the main window when debugging */
|
6459 | $el: JQuery
|
6460 | /** The scope of the log entry. If child, will appear nested below parents, prefixed with '-' */
|
6461 | type: 'parent' | 'child'
|
6462 | /** Allows the name of the command to be overwritten */
|
6463 | name: string
|
6464 | /** Override *name* for display purposes only */
|
6465 | displayName: string
|
6466 | /** additional information to include in the log */
|
6467 | message: any
|
6468 | /** Set to false if you want to control the finishing of the command in the log yourself */
|
6469 | autoEnd: boolean
|
6470 | /** Set to true to immediately finish the log */
|
6471 | end: boolean
|
6472 | /** Return an object that will be printed in the dev tools console */
|
6473 | consoleProps(): ObjectLike
|
6474 | }
|
6475 |
|
6476 | interface Response<T> {
|
6477 | allRequestResponses: any[]
|
6478 | body: T
|
6479 | duration: number
|
6480 | headers: { [key: string]: string | string[] }
|
6481 | isOkStatusCode: boolean
|
6482 | redirects?: string[]
|
6483 | redirectedToUrl?: string
|
6484 | requestHeaders: { [key: string]: string }
|
6485 | status: number
|
6486 | statusText: string
|
6487 | }
|
6488 |
|
6489 | interface Server extends RouteOptions {
|
6490 | enable: boolean
|
6491 | ignore: (xhr: any) => boolean
|
6492 | }
|
6493 |
|
6494 | interface Viewport {
|
6495 | viewportWidth: number
|
6496 | viewportHeight: number
|
6497 | }
|
6498 |
|
6499 | type Encodings = 'ascii' | 'base64' | 'binary' | 'hex' | 'latin1' | 'utf8' | 'utf-8' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' | null
|
6500 | type PositionType = 'topLeft' | 'top' | 'topRight' | 'left' | 'center' | 'right' | 'bottomLeft' | 'bottom' | 'bottomRight'
|
6501 | 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'
|
6502 | interface Offset {
|
6503 | top: number
|
6504 | left: number
|
6505 | }
|
6506 |
|
6507 | // Diff taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766
|
6508 | type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]
|
6509 | type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
|
6510 |
|
6511 | /**
|
6512 | * Public interface for the global "cy" object. If you want to add
|
6513 | * a custom property to this object, you should extend this interface.
|
6514 | * @see https://on.cypress.io/typescript#Types-for-custom-commands
|
6515 | *
|
6516 | ```
|
6517 | // in your TS file
|
6518 | declare namespace Cypress {
|
6519 | interface cy {
|
6520 | // declare additional properties on "cy" object, like
|
6521 | // label: string
|
6522 | }
|
6523 | interface Chainable {
|
6524 | // declare additional custom commands as methods, like
|
6525 | // login(username: string, password: string)
|
6526 | }
|
6527 | }
|
6528 | ```
|
6529 | */
|
6530 | interface cy extends Chainable<undefined> { }
|
6531 | }
|
6532 |
|
6533 | declare namespace Mocha {
|
6534 | interface TestFunction {
|
6535 | /**
|
6536 | * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
|
6537 | * as a thunk.
|
6538 | */
|
6539 | (title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
|
6540 |
|
6541 | /**
|
6542 | * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
|
6543 | * as a thunk.
|
6544 | */
|
6545 | (title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
|
6546 | }
|
6547 | interface ExclusiveTestFunction {
|
6548 | /**
|
6549 | * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
|
6550 | * as a thunk.
|
6551 | */
|
6552 | (title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
|
6553 |
|
6554 | /**
|
6555 | * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
|
6556 | * as a thunk.
|
6557 | */
|
6558 | (title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
|
6559 | }
|
6560 | interface PendingTestFunction {
|
6561 | /**
|
6562 | * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
|
6563 | * as a thunk.
|
6564 | */
|
6565 | (title: string, config: Cypress.TestConfigOverrides, fn?: Func): Test
|
6566 |
|
6567 | /**
|
6568 | * Describe a specification or test-case with the given `title`, TestOptions, and callback `fn` acting
|
6569 | * as a thunk.
|
6570 | */
|
6571 | (title: string, config: Cypress.TestConfigOverrides, fn?: AsyncFunc): Test
|
6572 | }
|
6573 |
|
6574 | interface SuiteFunction {
|
6575 | /**
|
6576 | * Describe a "suite" with the given `title`, TestOptions, and callback `fn` containing
|
6577 | * nested suites.
|
6578 | */
|
6579 | (title: string, config: Cypress.SuiteConfigOverrides, fn: (this: Suite) => void): Suite
|
6580 | }
|
6581 |
|
6582 | interface ExclusiveSuiteFunction {
|
6583 | /**
|
6584 | * Describe a "suite" with the given `title`, TestOptions, and callback `fn` containing
|
6585 | * nested suites. Indicates this suite should be executed exclusively.
|
6586 | */
|
6587 | (title: string, config: Cypress.SuiteConfigOverrides, fn: (this: Suite) => void): Suite
|
6588 | }
|
6589 |
|
6590 | interface PendingSuiteFunction {
|
6591 | (title: string, config: Cypress.SuiteConfigOverrides, fn: (this: Suite) => void): Suite | void
|
6592 | }
|
6593 | }
|
6594 |
|
\ | No newline at end of file |