Cypress Testing Library extends Cypress's
Add this line to your project's
You can now use all of
DOM Testing Library's
queryAllBy commands off the global
DOM Testing Library docs for reference.
get*queries are not supported because for reasonable Cypress tests you need retryability and
find*queries already support that.
query*queries are no longer necessary since v5 and will be removed in v6.
find*fully support built-in Cypress assertions (removes the only use-case for
Typings should be added as follows in
You can find all Library definitions here.
To show some simple examples (from cypress/integration/find.spec.js):
Cypress Testing Library supports both jQuery elements and DOM nodes. This is
necessary because Cypress uses jQuery elements, while
DOM Testing Library
expects DOM nodes. When you pass a jQuery element as
container, it will get
the first DOM node from the collection and use that as the
DOM Testing Library functions.