Fix testing-library__cypress by exposing @testing-library/dom#configure function (#38016)

* Use prettier on testing-library__cypress

* Fix testing-library__cypress by exposing @testing-library/dom#configure function
This commit is contained in:
Seb Insua
2019-08-29 23:57:40 -07:00
committed by Ron Buckton
parent 237d32828b
commit 0e4a03363c
3 changed files with 122 additions and 121 deletions
+83 -80
View File
@@ -1,4 +1,4 @@
// Type definitions for @testing-library/cypress 4.1
// Type definitions for @testing-library/cypress 4.2
// Project: https://github.com/testing-library/cypress-testing-library
// Definitions by: Aaron Mc Adam <https://github.com/aaronmcadam>
// Basti Buck <https://github.com/ppi-buck>
@@ -11,19 +11,20 @@
// TypeScript Version: 3.0
import {
configure,
Matcher,
MatcherOptions as DTLMatcherOptions,
SelectorMatcherOptions as DTLSelectorMatcherOptions,
} from '@testing-library/dom'
} from '@testing-library/dom';
import * as JQuery from 'jquery'
import * as JQuery from 'jquery';
export interface CTLMatcherOptions {
timeout?: number
timeout?: number;
}
export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions
export type SelectorMatcherOptions = DTLSelectorMatcherOptions | CTLMatcherOptions
export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions;
export type SelectorMatcherOptions = DTLSelectorMatcherOptions | CTLMatcherOptions;
declare global {
namespace Cypress {
@@ -42,11 +43,11 @@ declare global {
queryByPlaceholderText<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryByPlaceholderText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -62,11 +63,11 @@ declare global {
queryAllByPlaceholderText<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryAllByPlaceholderText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -82,11 +83,11 @@ declare global {
getByPlaceholderText<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
getByPlaceholderText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -102,11 +103,11 @@ declare global {
getAllByPlaceholderText<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
getAllByPlaceholderText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -122,11 +123,11 @@ declare global {
queryBySelectText<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryBySelectText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -142,11 +143,11 @@ declare global {
queryAllBySelectText<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryAllBySelectText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -159,11 +160,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getBySelectText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
getBySelectText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
getBySelectText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -176,11 +177,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getAllBySelectText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>
getAllBySelectText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>;
getAllBySelectText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -196,11 +197,11 @@ declare global {
queryByText<E extends Node = HTMLElement>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryByText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -216,11 +217,11 @@ declare global {
queryAllByText<E extends Node = HTMLElement>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryAllByText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -236,11 +237,11 @@ declare global {
getByText<E extends Node = HTMLElement>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
getByText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -253,11 +254,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getAllByText<E extends Node = HTMLElement>(id: Matcher, options?: SelectorMatcherOptions): Chainable<E[]>
getAllByText<E extends Node = HTMLElement>(id: Matcher, options?: SelectorMatcherOptions): Chainable<E[]>;
getAllByText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -273,11 +274,11 @@ declare global {
queryByLabelText<E extends Node = HTMLElement>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryByLabelText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -293,11 +294,11 @@ declare global {
queryAllByLabelText<E extends Node = HTMLElement>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryAllByLabelText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -313,11 +314,11 @@ declare global {
getByLabelText<E extends Node = HTMLElement>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
getByLabelText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -333,11 +334,11 @@ declare global {
getAllByLabelText<E extends Node = HTMLElement>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<E[]>
): Chainable<E[]>;
getAllByLabelText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: SelectorMatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -350,11 +351,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryByAltText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
queryByAltText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
queryByAltText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -370,11 +371,11 @@ declare global {
queryAllByAltText<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryAllByAltText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -387,11 +388,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getByAltText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
getByAltText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
getByAltText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -404,11 +405,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getAllByAltText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>
getAllByAltText<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>;
getAllByAltText<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -421,11 +422,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
queryByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
queryByTestId<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -438,11 +439,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryAllByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
queryAllByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
queryAllByTestId<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -455,11 +456,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
getByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
getByTestId<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -472,11 +473,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getAllByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>
getAllByTestId<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>;
getAllByTestId<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -489,11 +490,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
queryByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
queryByTitle<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -506,11 +507,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryAllByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
queryAllByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
queryAllByTitle<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -523,11 +524,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
getByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
getByTitle<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -540,11 +541,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getAllByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>
getAllByTitle<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>;
getAllByTitle<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -560,11 +561,11 @@ declare global {
queryByDisplayValue<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryByDisplayValue<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -580,11 +581,11 @@ declare global {
queryAllByDisplayValue<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
queryAllByDisplayValue<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -600,11 +601,11 @@ declare global {
getByDisplayValue<E extends Node = HTMLElement>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<E>>
): Chainable<JQuery<E>>;
getByDisplayValue<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -617,11 +618,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getAllByDisplayValue<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>
getAllByDisplayValue<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>;
getAllByDisplayValue<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -634,11 +635,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
queryByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
queryByRole<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -651,11 +652,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryAllByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
queryAllByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
queryAllByRole<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -668,11 +669,11 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>
getByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<JQuery<E>>;
getByRole<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<JQuery<HTMLElementTagNameMap[K]>>
): Chainable<JQuery<HTMLElementTagNameMap[K]>>;
/**
* dom-testing-library helpers for Cypress
@@ -685,14 +686,16 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
getAllByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>
getAllByRole<E extends Node = HTMLElement>(id: Matcher, options?: MatcherOptions): Chainable<E[]>;
getAllByRole<K extends keyof HTMLElementTagNameMap>(
id: Matcher,
options?: MatcherOptions,
): Chainable<Array<HTMLElementTagNameMap[K]>>
): Chainable<Array<HTMLElementTagNameMap[K]>>;
}
}
}
declare const Cypress: Cypress.Chainable
export default Cypress
declare const Cypress: Cypress.Chainable;
export default Cypress;
export { configure };
@@ -1,45 +1,47 @@
import Cypress from '@testing-library/cypress'
import Cypress, { configure } from '@testing-library/cypress';
configure({ testIdAttribute: 'data-myown-testid' });
// getBy*
Cypress.getByPlaceholderText('foo')
Cypress.getBySelectText('foo')
Cypress.getByText('foo')
Cypress.getByLabelText('foo')
Cypress.getByAltText('foo')
Cypress.getByTestId('foo')
Cypress.getByTitle('foo')
Cypress.getByDisplayValue('foo')
Cypress.getByRole('foo')
Cypress.getByPlaceholderText('foo');
Cypress.getBySelectText('foo');
Cypress.getByText('foo');
Cypress.getByLabelText('foo');
Cypress.getByAltText('foo');
Cypress.getByTestId('foo');
Cypress.getByTitle('foo');
Cypress.getByDisplayValue('foo');
Cypress.getByRole('foo');
// getAllBy*
Cypress.getAllByPlaceholderText('foo')
Cypress.getAllBySelectText('foo')
Cypress.getAllByText('foo')
Cypress.getAllByLabelText('foo')
Cypress.getAllByAltText('foo')
Cypress.getAllByTestId('foo')
Cypress.getAllByTitle('foo')
Cypress.getAllByDisplayValue('foo')
Cypress.getAllByRole('foo')
Cypress.getAllByPlaceholderText('foo');
Cypress.getAllBySelectText('foo');
Cypress.getAllByText('foo');
Cypress.getAllByLabelText('foo');
Cypress.getAllByAltText('foo');
Cypress.getAllByTestId('foo');
Cypress.getAllByTitle('foo');
Cypress.getAllByDisplayValue('foo');
Cypress.getAllByRole('foo');
// queryBy*
Cypress.queryByPlaceholderText('foo')
Cypress.queryBySelectText('foo')
Cypress.queryByText('foo')
Cypress.queryByLabelText('foo')
Cypress.queryByAltText('foo')
Cypress.queryByTestId('foo')
Cypress.queryByTitle('foo')
Cypress.queryByDisplayValue('foo')
Cypress.queryByRole('foo')
Cypress.queryByPlaceholderText('foo');
Cypress.queryBySelectText('foo');
Cypress.queryByText('foo');
Cypress.queryByLabelText('foo');
Cypress.queryByAltText('foo');
Cypress.queryByTestId('foo');
Cypress.queryByTitle('foo');
Cypress.queryByDisplayValue('foo');
Cypress.queryByRole('foo');
// queryAllBy*
Cypress.queryAllByPlaceholderText('foo')
Cypress.queryAllBySelectText('foo')
Cypress.queryAllByText('foo')
Cypress.queryAllByLabelText('foo')
Cypress.queryAllByAltText('foo')
Cypress.queryAllByTestId('foo')
Cypress.queryAllByTitle('foo')
Cypress.queryAllByDisplayValue('foo')
Cypress.queryAllByRole('foo')
Cypress.queryAllByPlaceholderText('foo');
Cypress.queryAllBySelectText('foo');
Cypress.queryAllByText('foo');
Cypress.queryAllByLabelText('foo');
Cypress.queryAllByAltText('foo');
Cypress.queryAllByTestId('foo');
Cypress.queryAllByTitle('foo');
Cypress.queryAllByDisplayValue('foo');
Cypress.queryAllByRole('foo');
@@ -1,10 +1,6 @@
{
"extends": "dtslint/dt.json",
"rules": {
"semicolon": [
true,
"never"
],
"whitespace": [
false
],