diff --git a/types/testing-library__cypress/index.d.ts b/types/testing-library__cypress/index.d.ts new file mode 100644 index 0000000000..6ae5ee63c8 --- /dev/null +++ b/types/testing-library__cypress/index.d.ts @@ -0,0 +1,698 @@ +// Type definitions for @testing-library/cypress 4.1 +// Project: https://github.com/testing-library/cypress-testing-library +// Definitions by: Aaron Mc Adam +// Basti Buck +// Stefano Magni +// Justin Hall +// Brian Ng +// Airat Aminev +// Simon Jespersen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +import { + Matcher, + MatcherOptions as DTLMatcherOptions, + SelectorMatcherOptions as DTLSelectorMatcherOptions, +} from '@testing-library/dom' + +import * as JQuery from 'jquery' + +export interface CTLMatcherOptions { + timeout?: number +} + +export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions +export type SelectorMatcherOptions = DTLSelectorMatcherOptions | CTLMatcherOptions + +declare global { + namespace Cypress { + interface Chainable { + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + queryByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + queryAllByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + getByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + getAllByPlaceholderText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryBySelectText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + queryBySelectText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllBySelectText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + queryAllBySelectText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getBySelectText(id: Matcher, options?: MatcherOptions): Chainable> + getBySelectText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllBySelectText(id: Matcher, options?: MatcherOptions): Chainable + getAllBySelectText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + queryByText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + queryAllByText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + getByText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByText(id: Matcher, options?: SelectorMatcherOptions): Chainable + getAllByText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + queryByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + queryAllByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + getByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable + getAllByLabelText( + id: Matcher, + options?: SelectorMatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByAltText(id: Matcher, options?: MatcherOptions): Chainable> + queryByAltText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByAltText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + queryAllByAltText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByAltText(id: Matcher, options?: MatcherOptions): Chainable> + getByAltText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByAltText(id: Matcher, options?: MatcherOptions): Chainable + getAllByAltText( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByTestId(id: Matcher, options?: MatcherOptions): Chainable> + queryByTestId( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByTestId(id: Matcher, options?: MatcherOptions): Chainable> + queryAllByTestId( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByTestId(id: Matcher, options?: MatcherOptions): Chainable> + getByTestId( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByTestId(id: Matcher, options?: MatcherOptions): Chainable + getAllByTestId( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByTitle(id: Matcher, options?: MatcherOptions): Chainable> + queryByTitle( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByTitle(id: Matcher, options?: MatcherOptions): Chainable> + queryAllByTitle( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByTitle(id: Matcher, options?: MatcherOptions): Chainable> + getByTitle( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByTitle(id: Matcher, options?: MatcherOptions): Chainable + getAllByTitle( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByDisplayValue( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + queryByDisplayValue( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByDisplayValue( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + queryAllByDisplayValue( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByDisplayValue( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + getByDisplayValue( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByDisplayValue(id: Matcher, options?: MatcherOptions): Chainable + getAllByDisplayValue( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryByRole(id: Matcher, options?: MatcherOptions): Chainable> + queryByRole( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + queryAllByRole(id: Matcher, options?: MatcherOptions): Chainable> + queryAllByRole( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getByRole(id: Matcher, options?: MatcherOptions): Chainable> + getByRole( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + + /** + * dom-testing-library helpers for Cypress + * + * `getBy*` APIs search for an element and throw an error if nothing found + * `getAllBy*` APIs search for all elements and an error if nothing found + * `queryBy*` APIs search for an element and returns null if nothing found + * `queryAllBy*` APIs search for all elements and return empty array if nothing found + * + * @see https://github.com/testing-library/cypress-testing-library#usage + * @see https://github.com/testing-library/dom-testing-library#table-of-contents + */ + getAllByRole(id: Matcher, options?: MatcherOptions): Chainable + getAllByRole( + id: Matcher, + options?: MatcherOptions, + ): Chainable> + } + } +} + +declare const Cypress: Cypress.Chainable +export default Cypress diff --git a/types/testing-library__cypress/testing-library__cypress-tests.ts b/types/testing-library__cypress/testing-library__cypress-tests.ts new file mode 100644 index 0000000000..17058fb350 --- /dev/null +++ b/types/testing-library__cypress/testing-library__cypress-tests.ts @@ -0,0 +1,45 @@ +import Cypress from '@testing-library/cypress' + +// 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') + +// 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') + +// 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') + +// 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') diff --git a/types/testing-library__cypress/tsconfig.json b/types/testing-library__cypress/tsconfig.json new file mode 100644 index 0000000000..50ddfed592 --- /dev/null +++ b/types/testing-library__cypress/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@testing-library/cypress": [ + "testing-library__cypress" + ], + "@testing-library/dom": [ + "testing-library__dom" + ] + } + }, + "files": [ + "index.d.ts", + "testing-library__cypress-tests.ts" + ] +} diff --git a/types/testing-library__cypress/tslint.json b/types/testing-library__cypress/tslint.json new file mode 100644 index 0000000000..bf034b1408 --- /dev/null +++ b/types/testing-library__cypress/tslint.json @@ -0,0 +1,13 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "semicolon": [ + true, + "never" + ], + "whitespace": [ + false + ], + "no-unnecessary-generics": false + } +}