cypress 16.1.1 → 16.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/angular/angular/dist/index.js +6 -7
  2. package/angular/angular/package.json +7 -22
  3. package/angular/dist/index.js +6 -7
  4. package/angular/package.json +7 -22
  5. package/dist/bin/cypress +2 -2
  6. package/dist/{cli-BUzHfIQ2.js → cli-DoJnc1F1.js} +6 -5
  7. package/dist/cli.js +2 -2
  8. package/dist/{cypress-D0g_F_Y2.js → cypress-BTgp4zGi.js} +1 -1
  9. package/dist/cypress.js +3 -3
  10. package/dist/exec/spawn.js +1 -1
  11. package/dist/index.js +3 -3
  12. package/dist/{spawn-BNsy7yWl.js → spawn-zPuxj7Kz.js} +34 -37
  13. package/dist/{tap-E19yanov.js → tap-D2mHgoNE.js} +2 -2
  14. package/mount-utils/dist/index.js +0 -1
  15. package/mount-utils/mount-utils/dist/index.js +0 -1
  16. package/mount-utils/mount-utils/package.json +14 -14
  17. package/mount-utils/package.json +14 -14
  18. package/package.json +4 -4
  19. package/react/dist/cypress-react.cjs.js +5 -6
  20. package/react/dist/cypress-react.esm-bundler.js +5 -6
  21. package/react/package.json +26 -46
  22. package/react/react/dist/cypress-react.cjs.js +5 -6
  23. package/react/react/dist/cypress-react.esm-bundler.js +5 -6
  24. package/react/react/package.json +26 -46
  25. package/svelte/dist/cypress-svelte.cjs.js +0 -1
  26. package/svelte/dist/cypress-svelte.esm-bundler.js +0 -1
  27. package/svelte/package.json +24 -22
  28. package/svelte/svelte/dist/cypress-svelte.cjs.js +0 -1
  29. package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +0 -1
  30. package/svelte/svelte/package.json +24 -22
  31. package/types/aria-query/index.d.ts +343 -0
  32. package/types/cy-chai.d.ts +99 -2
  33. package/types/cypress.d.ts +301 -49
  34. package/vue/dist/cypress-vue.cjs.js +1 -2
  35. package/vue/dist/cypress-vue.esm-bundler.js +1 -2
  36. package/vue/package.json +35 -42
  37. package/vue/vue/dist/cypress-vue.cjs.js +1 -2
  38. package/vue/vue/dist/cypress-vue.esm-bundler.js +1 -2
  39. package/vue/vue/package.json +35 -42
@@ -79,6 +79,14 @@ declare namespace Cypress {
79
79
  (task: 'net', eventName: string, frame: any): Promise<void>
80
80
  }
81
81
 
82
+ /**
83
+ * Trigger action
84
+ * @private
85
+ */
86
+ interface ActionTrigger {
87
+ <T = (any[] | void)>(action: string, ...args: any[]): T
88
+ }
89
+
82
90
  type BrowserName = 'electron' | 'chrome' | 'chromium' | 'firefox' | 'edge' | string
83
91
 
84
92
  type BrowserChannel = 'stable' | 'canary' | 'beta' | 'dev' | 'nightly' | string
@@ -296,6 +304,25 @@ declare namespace Cypress {
296
304
  */
297
305
  type AUTWindow = Window & typeof globalThis & ApplicationWindow
298
306
 
307
+ /**
308
+ * The object yielded by `cy.location()`, describing the current URL of the Application Under Test (AUT).
309
+ * It is a plain object, not the AUT's `window.location`, so it has no methods such as `assign()` or `reload()`.
310
+ *
311
+ * @see https://on.cypress.io/location
312
+ */
313
+ interface AUTLocation {
314
+ hash: string
315
+ host: string
316
+ hostname: string
317
+ href: string
318
+ origin: string
319
+ pathname: string
320
+ port: string
321
+ protocol: string
322
+ search: string
323
+ searchParams: URLSearchParams
324
+ }
325
+
299
326
  /**
300
327
  * The interface for user-defined properties in Window object under test.
301
328
  */
@@ -597,6 +624,16 @@ declare namespace Cypress {
597
624
  * Returns a jQuery object obtained by wrapping an object in jQuery.
598
625
  */
599
626
  wrap(wrappingElement_function: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((index: number) => string | JQuery)): JQuery
627
+ /**
628
+ * Returns the elements matching a jQuery selector, as a jQuery object.
629
+ * Without a `context`, it searches the document that Cypress's own scripts
630
+ * run in, not your application. To search your application, pass its
631
+ * document or an element in it as `context`.
632
+ * @example
633
+ * cy.document().then((doc) => {
634
+ * const $buttons = Cypress.dom.query('button', doc)
635
+ * })
636
+ */
600
637
  query(selector: JQuery.Selector, context?: Element | JQuery): JQuery
601
638
  /**
602
639
  * Returns an array of raw elements pulled out from a jQuery object.
@@ -606,7 +643,6 @@ declare namespace Cypress {
606
643
  * Returns a boolean indicating whether an object is a DOM object.
607
644
  */
608
645
  isDom(obj: any): boolean
609
- isType(element: JQuery | HTMLElement, type: string): boolean
610
646
  /**
611
647
  * Returns a boolean indicating whether an element is visible.
612
648
  */
@@ -617,15 +653,29 @@ declare namespace Cypress {
617
653
  isHidden(element: JQuery | HTMLElement, methodName?: string, options?: object): boolean
618
654
  /**
619
655
  * Returns a boolean indicating whether an element can receive focus.
656
+ * Accepts a DOM element or a jQuery object. For a jQuery object with
657
+ * more than one element, returns `true` if any of them can receive focus.
620
658
  */
621
659
  isFocusable(element: JQuery | HTMLElement): boolean
660
+ /**
661
+ * Returns a boolean indicating whether an element accepts typed text: a
662
+ * `<textarea>`, a contenteditable element, or an `<input>` whose `type` is
663
+ * `text`, `password`, `email`, `number`, `date`, `week`, `month`, `time`,
664
+ * `datetime`, `datetime-local`, `search`, `url`, or `tel`.
665
+ * Accepts a DOM element or a jQuery object. For a jQuery object, checks its
666
+ * first element.
667
+ */
622
668
  isTextLike(element: JQuery | HTMLElement): boolean
623
669
  /**
624
- * Returns a boolean indicating whether an element is scrollable.
670
+ * Returns a boolean indicating whether an element or the window is scrollable.
671
+ * Accepts the window, a DOM element, or a jQuery object. For a jQuery object,
672
+ * checks its first element.
625
673
  */
626
674
  isScrollable(element: Window | JQuery | HTMLElement): boolean
627
675
  /**
628
676
  * Returns a boolean indicating whether an element currently has focus.
677
+ * Accepts a DOM element or a jQuery object. For a jQuery object, checks
678
+ * its first element.
629
679
  */
630
680
  isFocused(element: JQuery | HTMLElement): boolean
631
681
  /**
@@ -636,9 +686,16 @@ declare namespace Cypress {
636
686
  * Returns a boolean indicating whether an element is attached to the DOM.
637
687
  */
638
688
  isAttached(element: JQuery | HTMLElement | Window | Document): boolean
689
+ /**
690
+ * Returns a boolean indicating whether an element matches a jQuery selector.
691
+ * For a jQuery object with more than one element, returns `true` if any of
692
+ * them match. Accepts a DOM element or a jQuery object.
693
+ */
639
694
  isSelector(element: JQuery | HTMLElement, selector: JQuery.Selector): boolean
640
695
  /**
641
- * Returns a boolean indicating whether an element is a descendent of another element.
696
+ * Returns a boolean indicating whether `element2` is `element1` or is
697
+ * inside it. Each argument can be a DOM element or a jQuery object.
698
+ * For a jQuery object, checks its first element.
642
699
  */
643
700
  isDescendent(element1: JQuery | HTMLElement, element2: JQuery | HTMLElement): boolean
644
701
  /**
@@ -661,22 +718,146 @@ declare namespace Cypress {
661
718
  * Returns a boolean indicating whether an object is a jQuery object.
662
719
  */
663
720
  isJquery(obj: any): obj is JQuery
721
+ /**
722
+ * Returns a boolean indicating whether an `<input>` or `<button>` has the
723
+ * given `type`, or any of the given types when `type` is an array. It reads
724
+ * the element's `type` property rather than its attribute, so an `<input>`
725
+ * with an unrecognized `type` counts as `'text'`, and a `<button>` with no
726
+ * `type` counts as `'submit'`. Returns `false` for any other element.
727
+ * Accepts a DOM element or a jQuery object. For a jQuery object, checks its
728
+ * first element.
729
+ */
664
730
  isInputType(element: JQuery | HTMLElement, type: string | string[]): boolean
665
- stringify(element: JQuery | HTMLElement, form: string): string
666
- getElements(element: JQuery): JQuery | HTMLElement[]
731
+ /**
732
+ * Returns a string representation of an element, the window, or the document.
733
+ * `'long'` (the default) returns the element's HTML with its content
734
+ * abbreviated, and `'short'` returns its tag name with its id or classes.
735
+ */
736
+ stringify(element: JQuery | HTMLElement | Window | Document, form?: 'long' | 'short'): string
737
+ /**
738
+ * Returns the raw elements in a jQuery object: the element itself when it
739
+ * holds one, an array of elements when it holds more than one, and
740
+ * `undefined` when it is empty.
741
+ */
742
+ getElements(element: JQuery): HTMLElement | HTMLElement[] | undefined
743
+ /**
744
+ * Returns the selector that `cy.contains()` uses to find elements whose
745
+ * text includes `text`, plus submit buttons whose `value` has `text` as one
746
+ * of its space-separated words. `filter` limits the search to elements
747
+ * matching a selector, and can list several selectors separated by commas.
748
+ * Matching ignores case unless `options.matchCase` is `true`.
749
+ *
750
+ * The selector relies on pseudo-classes that only Cypress's copy of jQuery
751
+ * understands, so run it with `Cypress.$` or `Cypress.dom.query()`, not
752
+ * `document.querySelectorAll()`.
753
+ * @example
754
+ * Cypress.dom.getContainsSelector('Log in', 'button', { matchCase: true })
755
+ */
667
756
  getContainsSelector(text: string, filter?: string, options?: CaseMatchable): JQuery.Selector
668
- getFirstDeepestElement(elements: HTMLElement[], index?: number): HTMLElement
669
- getWindowByElement(element: JQuery | HTMLElement): JQuery | HTMLElement
757
+ /**
758
+ * Picks one element from a list of matches, the way `cy.contains()` does.
759
+ * Starting at `index` (default `0`) and skipping `<script>` and `<style>`,
760
+ * it moves on to the next element in the list for as long as that element
761
+ * is nested inside the current one, and stops at the deepest. If that
762
+ * element is inside an `<a>`, `<button>`, `<label>`, or submit `<input>`
763
+ * that is also in the list, it picks that ancestor instead.
764
+ *
765
+ * Returns a jQuery object holding the chosen element.
766
+ */
767
+ getFirstDeepestElement(elements: JQuery, index?: number): JQuery
768
+ /**
769
+ * Returns the window that contains an element or a document, or the window
770
+ * itself when passed a window. Accepts any of these, or a jQuery object
771
+ * holding one. For a jQuery object, uses its first element.
772
+ */
773
+ getWindowByElement(element: JQuery<HTMLElement | Document | Window> | HTMLElement | Document | Window): Window
774
+ /**
775
+ * Returns a sentence explaining why an element is not visible.
776
+ * Accepts a DOM element or a jQuery object.
777
+ */
670
778
  getReasonIsHidden(element: JQuery | HTMLElement, options?: object): string
671
- getFirstScrollableParent(element: JQuery | HTMLElement): JQuery | HTMLElement
672
- getFirstFixedOrStickyPositionParent(element: JQuery | HTMLElement): JQuery | HTMLElement
673
- getFirstStickyPositionParent(element: JQuery | HTMLElement): JQuery | HTMLElement
674
- getCoordsByPosition(left: number, top: number, xPosition?: string, yPosition?: string): number
779
+ /**
780
+ * Returns the closest ancestor of an element that can scroll, as a jQuery
781
+ * object, or `null` if there is none. The element itself is not checked.
782
+ * It walks out of shadow roots to their hosts and can return `<html>`.
783
+ * Returns `null` right away for `<html>`, `<body>`, or the document.
784
+ * Accepts a DOM element or a jQuery object. For a jQuery object, starts
785
+ * from its first element.
786
+ */
787
+ getFirstScrollableParent(element: JQuery | HTMLElement): JQuery | null
788
+ /**
789
+ * Returns the element, or its closest ancestor, whose CSS `position` is
790
+ * `fixed` or `sticky`, as a jQuery object, or `null` if there is none.
791
+ * It walks out of shadow roots to their hosts. Returns `null` right away for
792
+ * `<html>`, `<body>`, or the document.
793
+ * Accepts a DOM element or a jQuery object. For a jQuery object, starts
794
+ * from its first element.
795
+ */
796
+ getFirstFixedOrStickyPositionParent(element: JQuery | HTMLElement): JQuery | null
797
+ /**
798
+ * Returns the element, or its closest ancestor, whose CSS `position` is
799
+ * `sticky`, as a jQuery object, or `null` if there is none. It walks out of
800
+ * shadow roots to their hosts. Returns `null` right away for `<html>`,
801
+ * `<body>`, or the document.
802
+ * Accepts a DOM element or a jQuery object. For a jQuery object, starts
803
+ * from its first element.
804
+ */
805
+ getFirstStickyPositionParent(element: JQuery | HTMLElement): JQuery | null
806
+ /**
807
+ * Rounds a point to whole pixels so it stays inside the element it targets.
808
+ * `xPosition` (`'left'`, `'center'`, or `'right'`) and `yPosition` (`'top'`,
809
+ * `'center'`, or `'bottom'`) say which edge the point sits on, and both
810
+ * default to `'center'`. A left or top edge rounds up, a center rounds down,
811
+ * and a right or bottom edge rounds down and then subtracts 1.
812
+ * Returns an object with `x` and `y`.
813
+ */
814
+ getCoordsByPosition(left: number, top: number, xPosition?: 'left' | 'center' | 'right', yPosition?: 'top' | 'center' | 'bottom'): { x: number, y: number }
815
+ /**
816
+ * Returns an element's `width`, `height`, `scrollTop`, and `scrollLeft`, and
817
+ * the position of its box measured three ways: `fromElViewport` is relative
818
+ * to the viewport of the window the element is in, `fromElWindow` is
819
+ * relative to that window's document (so it includes the window's scroll),
820
+ * and `fromAutWindow` is relative to your application's top-level window,
821
+ * adding the offsets of any iframes in between.
822
+ * Accepts a DOM element or a jQuery object. For a jQuery object, measures its
823
+ * first element.
824
+ */
675
825
  getElementPositioning(element: JQuery | HTMLElement): ElementPositioning
826
+ /**
827
+ * Returns the topmost element at a point in `doc`'s viewport, looking inside
828
+ * open shadow roots, or `null` when the point is outside the viewport.
829
+ */
676
830
  getElementAtPointFromViewport(doc: Document, x: number, y: number): Element | null
831
+ /**
832
+ * Returns the same measurements as `getElementPositioning()`, with `x` and
833
+ * `y` added to `fromElViewport`, `fromElWindow`, and `fromAutWindow` for a
834
+ * point at `position` inside the element. `position` defaults to `'center'`
835
+ * and can be `'topLeft'`, `'top'`, `'topRight'`, `'left'`, `'center'`,
836
+ * `'right'`, `'bottomLeft'`, `'bottom'`, or `'bottomRight'`. Any other value
837
+ * throws a `TypeError`.
838
+ * Accepts a DOM element or a jQuery object.
839
+ */
677
840
  getElementCoordinatesByPosition(element: JQuery | HTMLElement, position?: string): ElementCoordinates
841
+ /**
842
+ * Like `getElementCoordinatesByPosition()`, but the point is `x` and `y`
843
+ * pixels from the element's top-left corner, as in `.click(x, y)`. The
844
+ * returned `top` and `left` values are shifted by `x` and `y` as well.
845
+ * Accepts a DOM element or a jQuery object.
846
+ */
678
847
  getElementCoordinatesByPositionRelativeToXY(element: JQuery | HTMLElement, x: number, y: number): ElementPositioning
848
+ /**
849
+ * Returns the element that hosts editing for `element`: the closest element,
850
+ * starting with `element` itself, that has a `contenteditable` attribute
851
+ * other than `"false"`. If there is none, returns the document's `<html>`
852
+ * element, which is the editing host when the document is in `designMode`.
853
+ * Pass a DOM element.
854
+ */
679
855
  getHostContenteditable(element: HTMLElement): HTMLElement
856
+ /**
857
+ * Returns the start and end offsets of the current text selection in an
858
+ * `<input>`, a `<textarea>`, or a contenteditable element. Returns
859
+ * `{ start: 0, end: 0 }` for any other element. Pass a DOM element.
860
+ */
680
861
  getSelectionBounds(element: HTMLElement): { start: number, end: number }
681
862
  }
682
863
 
@@ -757,7 +938,7 @@ declare namespace Cypress {
757
938
  * Trigger action
758
939
  * @private
759
940
  */
760
- action: <T = (any[] | void)>(action: string, ...args: any[]) => T
941
+ action: ActionTrigger
761
942
 
762
943
  /**
763
944
  * Load files
@@ -1318,9 +1499,12 @@ declare namespace Cypress {
1318
1499
  /**
1319
1500
  * Save/Restore browser Cookies, LocalStorage, and SessionStorage data resulting from the supplied `setup` function.
1320
1501
  *
1502
+ * Yields the status of the session: `'created'` when `setup` ran for a new session, `'restored'` when a saved
1503
+ * session was restored, or `'recreated'` when a restored session failed validation and `setup` ran again.
1504
+ *
1321
1505
  * @see https://on.cypress.io/session
1322
1506
  */
1323
- session(id: string | object, setup: () => void, options?: SessionOptions): Chainable<null>
1507
+ session(id: string | object, setup: () => void, options?: SessionOptions): Chainable<'created' | 'restored' | 'recreated'>
1324
1508
 
1325
1509
  /**
1326
1510
  * Get the window.document of the page that is currently active.
@@ -1359,7 +1543,7 @@ declare namespace Cypress {
1359
1543
  * @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.
1360
1544
  * @example
1361
1545
  * cy.get('tbody>tr').eq(0) // Yield first 'tr' in 'tbody'
1362
- * cy.get('ul>li').eq('4') // Yield fifth 'li' in 'ul'
1546
+ * cy.get('ul>li').eq(4) // Yield fifth 'li' in 'ul'
1363
1547
  * cy.get('li').eq(-2) // Yields second from last 'li' element
1364
1548
  */
1365
1549
  eq<E extends Node = HTMLElement>(index: number, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
@@ -1481,6 +1665,30 @@ declare namespace Cypress {
1481
1665
  */
1482
1666
  get<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<JQuery<E>>
1483
1667
 
1668
+ /**
1669
+ * Get every element with the given ARIA role, optionally narrowed to
1670
+ * those whose accessible name matches `name`. Elements hidden from the
1671
+ * accessibility tree are skipped unless `hidden` is `true`.
1672
+ *
1673
+ * For a role that HTML has an element for, only that element matches by
1674
+ * default: `'button'` finds a `<button>`, not a `<div role="button">`.
1675
+ * Pass `native: false` to also match elements that get the role from a
1676
+ * `role` attribute.
1677
+ *
1678
+ * Chained off an element, it searches that element's descendants.
1679
+ *
1680
+ * @see https://on.cypress.io/getbyrole
1681
+ * @example
1682
+ * // A native <button>, never a <div role="button">
1683
+ * cy.getByRole('button', { name: 'Save' }).click()
1684
+ * // Widgets that HTML has no element for
1685
+ * cy.getByRole('tab', { name: 'Billing' }).click()
1686
+ * cy.get('nav').getByRole('menuitem', { name: /delete/i })
1687
+ * // A dialog rendered as <div role="dialog"> by a component library
1688
+ * cy.getByRole('dialog', { name: 'Settings', native: false })
1689
+ */
1690
+ getByRole<E extends Node = HTMLElement>(role: import('./aria-query').ARIARole | (string & {}), options?: Partial<GetByRoleOptions>): Chainable<JQuery<E>>
1691
+
1484
1692
  /**
1485
1693
  * Get a browser cookie by its name.
1486
1694
  *
@@ -1576,15 +1784,15 @@ declare namespace Cypress {
1576
1784
  last<E extends Node = HTMLElement>(options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1577
1785
 
1578
1786
  /**
1579
- * Get the global `window.location` object of the page that is currently active.
1787
+ * Yield a plain object describing the current URL of the application under test.
1580
1788
  *
1581
1789
  * @see https://on.cypress.io/location
1582
1790
  * @example
1583
1791
  * cy.location() // Get location object
1584
1792
  */
1585
- location(options?: Partial<Loggable & Timeoutable>): Chainable<Location>
1793
+ location(options?: Partial<Loggable & Timeoutable>): Chainable<AUTLocation>
1586
1794
  /**
1587
- * Get a part of the global `window.location` object of the page that is currently active.
1795
+ * Yield one property of a plain object describing the current URL of the application under test.
1588
1796
  *
1589
1797
  * @see https://on.cypress.io/location
1590
1798
  * @example
@@ -1593,7 +1801,7 @@ declare namespace Cypress {
1593
1801
  * // Assert on the href of the location
1594
1802
  * cy.location('href').should('contain', '/tag/tutorials')
1595
1803
  */
1596
- location<K extends keyof Location>(key: K, options?: Partial<Loggable & Timeoutable>): Chainable<Location[K]>
1804
+ location<K extends keyof AUTLocation>(key: K, options?: Partial<Loggable & Timeoutable>): Chainable<AUTLocation[K]>
1597
1805
 
1598
1806
  /**
1599
1807
  * Print a message to the Cypress Command Log.
@@ -1621,7 +1829,7 @@ declare namespace Cypress {
1621
1829
  *
1622
1830
  * @see https://on.cypress.io/next
1623
1831
  * @example
1624
- * cy.get('nav a:first').next('.menu-item)
1832
+ * cy.get('nav a:first').next('.menu-item')
1625
1833
  */
1626
1834
  next<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1627
1835
 
@@ -2793,6 +3001,41 @@ declare namespace Cypress {
2793
3001
  timeout: number
2794
3002
  }
2795
3003
 
3004
+ interface GetByRoleOptions extends Loggable, Timeoutable, Shadow {
3005
+ /**
3006
+ * Only match elements whose accessible name matches: the text a screen
3007
+ * reader announces for the element, taken from its label, its content,
3008
+ * `aria-label` or `aria-labelledby`. A string must match the whole name, a
3009
+ * regular expression is tested against it, and a function is called with
3010
+ * the name and the element.
3011
+ */
3012
+ name: string | number | RegExp | ((name: string, element: Element | null) => boolean)
3013
+ /**
3014
+ * Include elements that are hidden from the accessibility tree, such as
3015
+ * those with `aria-hidden="true"`, `display: none` or `visibility: hidden`.
3016
+ *
3017
+ * @default false
3018
+ */
3019
+ hidden: boolean
3020
+ /**
3021
+ * Only match elements whose tag gives them the role, like `<button>`,
3022
+ * skipping elements that only have it through a `role` attribute, like
3023
+ * `<div role="button">`. Set it to `false` to match both.
3024
+ *
3025
+ * Some widely used patterns get their role from a `role` attribute even
3026
+ * though HTML has an element for it, so they need `native: false`: an
3027
+ * `<input role="combobox">` (the native combobox is a `<select>` or an
3028
+ * `<input list>`) and an `<svg role="img">` (the native one is an `<img>`).
3029
+ *
3030
+ * Roles that HTML has no element for, such as `tab` or `menuitem`, can
3031
+ * only come from a `role` attribute, so they are always matched that way.
3032
+ * Passing `native: true` with one of those roles throws.
3033
+ *
3034
+ * @default true for roles that HTML has an element for
3035
+ */
3036
+ native: boolean
3037
+ }
3038
+
2796
3039
  /**
2797
3040
  * Options that check case sensitivity
2798
3041
  */
@@ -4006,14 +4249,14 @@ declare namespace Cypress {
4006
4249
  */
4007
4250
  cacheAcrossSpecs?: boolean
4008
4251
  /**
4009
- * Function to run immediately after the session is created and `setup` function runs or
4010
- * after a session is restored and the page is cleared. If this returns `false`, throws an
4011
- * exception, returns a Promise which resolves to `false` or rejects or contains any failing
4012
- * Cypress command, the session is considered invalid.
4252
+ * Function to run immediately after `setup` creates a session, or after a saved session is
4253
+ * restored. The session is invalid if this function throws an exception, contains a failing
4254
+ * Cypress command, returns a Promise that rejects or resolves to `false`, or returns nothing
4255
+ * and its last Cypress command yields `false`. Returning `false` directly, without a Promise,
4256
+ * does not invalidate the session.
4013
4257
  *
4014
4258
  * If validation fails immediately after `setup`, the test will fail.
4015
4259
  * If validation fails after restoring a session, `setup` will re-run.
4016
- * @default {false}
4017
4260
  */
4018
4261
  validate?: () => Promise<false | void> | void
4019
4262
  }
@@ -4236,6 +4479,13 @@ declare namespace Cypress {
4236
4479
  encoding: Encodings
4237
4480
  }
4238
4481
 
4482
+ /**
4483
+ * What the chai-jquery `match` assertion accepts for a DOM subject: anything jQuery's `.is()` accepts.
4484
+ *
4485
+ * @see http://chaijs.com/plugins/chai-jquery/#matchselector
4486
+ */
4487
+ type JQueryMatchable = string | Element | ArrayLike<Element> | JQuery<any> | ((this: Element, index: number, element: Element) => boolean)
4488
+
4239
4489
  // Kind of onerous, but has a nice auto-complete.
4240
4490
  /**
4241
4491
  * @see https://on.cypress.io/should
@@ -5890,10 +6140,11 @@ declare namespace Cypress {
5890
6140
  * @example
5891
6141
  * cy.get('#result').should('have.attr', 'role')
5892
6142
  * cy.get('#result').should('have.attr', 'role', 'menu')
6143
+ * cy.get('#result').should('have.attr', 'tabindex', 0)
5893
6144
  * @see http://chaijs.com/plugins/chai-jquery/#attrname-value
5894
6145
  * @see https://on.cypress.io/assertions
5895
6146
  */
5896
- (chainer: 'have.attr', value: string, match?: string): Chainable<Subject>
6147
+ (chainer: 'have.attr', value: string, match?: string | number): Chainable<Subject>
5897
6148
  /**
5898
6149
  * 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.
5899
6150
  * @example
@@ -5917,7 +6168,7 @@ declare namespace Cypress {
5917
6168
  * @see http://chaijs.com/plugins/chai-jquery/#dataname-value
5918
6169
  * @see https://on.cypress.io/assertions
5919
6170
  */
5920
- (chainer: 'have.data', value: string, match?: string): Chainable<Subject>
6171
+ (chainer: 'have.data', value: string, match?: string | number | boolean | null): Chainable<Subject>
5921
6172
  /**
5922
6173
  * Assert that the selection contains at least one element which has a descendant matching the given selector, using `.has()`.
5923
6174
  * @example
@@ -5951,13 +6202,13 @@ declare namespace Cypress {
5951
6202
  */
5952
6203
  (chainer: 'include.html', value: string): Chainable<Subject>
5953
6204
  /**
5954
- * Assert that the first element of the selection has the given id, using `.attr('id')`.
6205
+ * Assert that the first element of the selection has the given id, using `.prop('id')`.
5955
6206
  * @example
5956
6207
  * cy.get('#result').should('have.id', 'result')
5957
6208
  * @see http://chaijs.com/plugins/chai-jquery/#idid
5958
6209
  * @see https://on.cypress.io/assertions
5959
6210
  */
5960
- (chainer: 'have.id', value: string, match?: string): Chainable<Subject>
6211
+ (chainer: 'have.id', value: string | number): Chainable<Subject>
5961
6212
  /**
5962
6213
  * 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.
5963
6214
  * @example
@@ -5974,7 +6225,7 @@ declare namespace Cypress {
5974
6225
  * @see http://chaijs.com/plugins/chai-jquery/#texttext
5975
6226
  * @see https://on.cypress.io/assertions
5976
6227
  */
5977
- (chainer: 'have.text', value: string): Chainable<Subject>
6228
+ (chainer: 'have.text', value: string | number): Chainable<Subject>
5978
6229
  /**
5979
6230
  * Assert that the text of the first element of the selection partially contains the given text, using `.text()`.
5980
6231
  * @example
@@ -5982,7 +6233,7 @@ declare namespace Cypress {
5982
6233
  * @see http://chaijs.com/plugins/chai-jquery/#texttext
5983
6234
  * @see https://on.cypress.io/assertions
5984
6235
  */
5985
- (chainer: 'contain.text', value: string): Chainable<Subject>
6236
+ (chainer: 'contain.text', value: string | number): Chainable<Subject>
5986
6237
  /**
5987
6238
  * Assert that the text of the first element of the selection partially contains the given text, using `.text()`.
5988
6239
  * @example
@@ -5990,7 +6241,7 @@ declare namespace Cypress {
5990
6241
  * @see http://chaijs.com/plugins/chai-jquery/#texttext
5991
6242
  * @see https://on.cypress.io/assertions
5992
6243
  */
5993
- (chainer: 'include.text', value: string): Chainable<Subject>
6244
+ (chainer: 'include.text', value: string | number): Chainable<Subject>
5994
6245
  /**
5995
6246
  * Assert that the first element of the selection has the given value, using `.val()`.
5996
6247
  * @example
@@ -5998,7 +6249,7 @@ declare namespace Cypress {
5998
6249
  * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
5999
6250
  * @see https://on.cypress.io/assertions
6000
6251
  */
6001
- (chainer: 'have.value', value: string): Chainable<Subject>
6252
+ (chainer: 'have.value', value: string | number): Chainable<Subject>
6002
6253
  /**
6003
6254
  * Assert that the first element of the selection partially contains the given value, using `.val()`.
6004
6255
  * @example
@@ -6006,7 +6257,7 @@ declare namespace Cypress {
6006
6257
  * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
6007
6258
  * @see https://on.cypress.io/assertions
6008
6259
  */
6009
- (chainer: 'contain.value', value: string): Chainable<Subject>
6260
+ (chainer: 'contain.value', value: string | number): Chainable<Subject>
6010
6261
  /**
6011
6262
  * Assert that the first element of the selection partially contains the given value, using `.val()`.
6012
6263
  * @example
@@ -6014,15 +6265,15 @@ declare namespace Cypress {
6014
6265
  * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
6015
6266
  * @see https://on.cypress.io/assertions
6016
6267
  */
6017
- (chainer: 'include.value', value: string): Chainable<Subject>
6268
+ (chainer: 'include.value', value: string | number): Chainable<Subject>
6018
6269
  /**
6019
- * 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.
6270
+ * Assert that the selection matches a given selector, element, elements, jQuery object, or predicate, using `.is()`. Note that this overrides the built-in chai assertion. If the subject is not a DOM element or jQuery object, only a regular expression is accepted, and a regular expression never matches a DOM element or jQuery object.
6020
6271
  * @example
6021
6272
  * cy.get('#result').should('match', ':empty')
6022
6273
  * @see http://chaijs.com/plugins/chai-jquery/#matchselector
6023
6274
  * @see https://on.cypress.io/assertions
6024
6275
  */
6025
- (chainer: 'match', value: string): Chainable<Subject>
6276
+ (chainer: 'match', value: JQueryMatchable): Chainable<Subject>
6026
6277
 
6027
6278
  // jquery-chai.not
6028
6279
  /**
@@ -6118,10 +6369,11 @@ declare namespace Cypress {
6118
6369
  * @example
6119
6370
  * cy.get('#result').should('not.have.attr', 'role')
6120
6371
  * cy.get('#result').should('not.have.attr', 'role', 'menu')
6372
+ * cy.get('#result').should('not.have.attr', 'tabindex', 0)
6121
6373
  * @see http://chaijs.com/plugins/chai-jquery/#attrname-value
6122
6374
  * @see https://on.cypress.io/assertions
6123
6375
  */
6124
- (chainer: 'not.have.attr', value: string, match?: string): Chainable<Subject>
6376
+ (chainer: 'not.have.attr', value: string, match?: string | number): Chainable<Subject>
6125
6377
  /**
6126
6378
  * 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.
6127
6379
  * @example
@@ -6145,7 +6397,7 @@ declare namespace Cypress {
6145
6397
  * @see http://chaijs.com/plugins/chai-jquery/#dataname-value
6146
6398
  * @see https://on.cypress.io/assertions
6147
6399
  */
6148
- (chainer: 'not.have.data', value: string, match?: string): Chainable<Subject>
6400
+ (chainer: 'not.have.data', value: string, match?: string | number | boolean | null): Chainable<Subject>
6149
6401
  /**
6150
6402
  * Assert that the selection does not contain at least one element which has a descendant matching the given selector, using `.has()`.
6151
6403
  * @example
@@ -6179,13 +6431,13 @@ declare namespace Cypress {
6179
6431
  */
6180
6432
  (chainer: 'not.include.html', value: string): Chainable<Subject>
6181
6433
  /**
6182
- * Assert that the first element of the selection does not have the given id, using `.attr('id')`.
6434
+ * Assert that the first element of the selection does not have the given id, using `.prop('id')`.
6183
6435
  * @example
6184
6436
  * cy.get('#result').should('not.have.id', 'result')
6185
6437
  * @see http://chaijs.com/plugins/chai-jquery/#idid
6186
6438
  * @see https://on.cypress.io/assertions
6187
6439
  */
6188
- (chainer: 'not.have.id', value: string, match?: string): Chainable<Subject>
6440
+ (chainer: 'not.have.id', value: string | number): Chainable<Subject>
6189
6441
  /**
6190
6442
  * 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.
6191
6443
  * @example
@@ -6202,7 +6454,7 @@ declare namespace Cypress {
6202
6454
  * @see http://chaijs.com/plugins/chai-jquery/#texttext
6203
6455
  * @see https://on.cypress.io/assertions
6204
6456
  */
6205
- (chainer: 'not.have.text', value: string): Chainable<Subject>
6457
+ (chainer: 'not.have.text', value: string | number): Chainable<Subject>
6206
6458
  /**
6207
6459
  * Assert that the text of the first element of the selection does not contain the given text, using `.text()`.
6208
6460
  * @example
@@ -6210,7 +6462,7 @@ declare namespace Cypress {
6210
6462
  * @see http://chaijs.com/plugins/chai-jquery/#texttext
6211
6463
  * @see https://on.cypress.io/assertions
6212
6464
  */
6213
- (chainer: 'not.contain.text', value: string): Chainable<Subject>
6465
+ (chainer: 'not.contain.text', value: string | number): Chainable<Subject>
6214
6466
  /**
6215
6467
  * Assert that the text of the first element of the selection does not contain the given text, using `.text()`.
6216
6468
  * @example
@@ -6218,7 +6470,7 @@ declare namespace Cypress {
6218
6470
  * @see http://chaijs.com/plugins/chai-jquery/#texttext
6219
6471
  * @see https://on.cypress.io/assertions
6220
6472
  */
6221
- (chainer: 'not.include.text', value: string): Chainable<Subject>
6473
+ (chainer: 'not.include.text', value: string | number): Chainable<Subject>
6222
6474
  /**
6223
6475
  * Assert that the first element of the selection does not have the given value, using `.val()`.
6224
6476
  * @example
@@ -6226,7 +6478,7 @@ declare namespace Cypress {
6226
6478
  * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
6227
6479
  * @see https://on.cypress.io/assertions
6228
6480
  */
6229
- (chainer: 'not.have.value', value: string): Chainable<Subject>
6481
+ (chainer: 'not.have.value', value: string | number): Chainable<Subject>
6230
6482
  /**
6231
6483
  * Assert that the first element of the selection does not contain the given value, using `.val()`.
6232
6484
  * @example
@@ -6234,7 +6486,7 @@ declare namespace Cypress {
6234
6486
  * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
6235
6487
  * @see https://on.cypress.io/assertions
6236
6488
  */
6237
- (chainer: 'not.contain.value', value: string): Chainable<Subject>
6489
+ (chainer: 'not.contain.value', value: string | number): Chainable<Subject>
6238
6490
  /**
6239
6491
  * Assert that the first element of the selection does not contain the given value, using `.val()`.
6240
6492
  * @example
@@ -6242,15 +6494,15 @@ declare namespace Cypress {
6242
6494
  * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
6243
6495
  * @see https://on.cypress.io/assertions
6244
6496
  */
6245
- (chainer: 'not.include.value', value: string): Chainable<Subject>
6497
+ (chainer: 'not.include.value', value: string | number): Chainable<Subject>
6246
6498
  /**
6247
- * 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.
6499
+ * Assert that the selection does not match a given selector, element, elements, jQuery object, or predicate, using `.is()`. Note that this overrides the built-in chai assertion. If the subject is not a DOM element or jQuery object, only a regular expression is accepted, and a regular expression never matches a DOM element or jQuery object.
6248
6500
  * @example
6249
6501
  * cy.get('#result').should('not.match', ':empty')
6250
6502
  * @see http://chaijs.com/plugins/chai-jquery/#matchselector
6251
6503
  * @see https://on.cypress.io/assertions
6252
6504
  */
6253
- (chainer: 'not.match', value: string): Chainable<Subject>
6505
+ (chainer: 'not.match', value: JQueryMatchable): Chainable<Subject>
6254
6506
 
6255
6507
  // fallback
6256
6508
  /**
@@ -6354,7 +6606,7 @@ declare namespace Cypress {
6354
6606
 
6355
6607
  interface BeforeRunDetails {
6356
6608
  browser?: Browser
6357
- config: ConfigOptions
6609
+ config: PluginConfigOptions
6358
6610
  cypressVersion: string
6359
6611
  group?: string
6360
6612
  parallel?: boolean