You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cypress-testing-library/intro.md
+22-23Lines changed: 22 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,15 @@ Add this line to your project's `cypress/support/commands.js`:
22
22
import '@testing-library/cypress/add-commands';
23
23
```
24
24
25
+
You can now use all of `DOM Testing Library`'s `findBy`, `findAllBy`, `queryBy`
26
+
and `queryAllBy` commands off the global `cy` object.
27
+
[See the `DOM Testing Library` docs for reference](https://testing-library.com/docs/dom-testing-library/api-queries).
28
+
29
+
> Note: the `get*` queries are not supported because for reasonable Cypress tests you
30
+
> need retryability and `find*` queries already support that. `query*` queries are no longer
31
+
> necessary since v5 and will be removed in v6. `find*` fully support built-in Cypress
32
+
> assertions (removes the only use-case for `query*`).
33
+
25
34
## With TypeScript
26
35
27
36
Typings are defined in `@types/testing-library__cypress` at [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__cypress),
@@ -35,40 +44,30 @@ and should be added as follows in `tsconfig.json`:
35
44
}
36
45
```
37
46
38
-
You can now use all of `DOM Testing Library`'s `getBy`, `getAllBy`, `queryBy`
39
-
and `queryAllBy` commands.
40
-
[See `DOM Testing Library` API for reference](dom-testing-library/api-queries.md)
47
+
You can find [all Library definitions here](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__cypress/index.d.ts).
41
48
42
49
## Examples
43
50
44
-
You can find [all library definitions here](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__cypress/index.d.ts).
45
-
46
-
To show some simple examples (from [https://github.com/testing-library/cypress-testing-library/tree/master/cypress/integration](https://github.com/testing-library/cypress-testing-library/tree/master/cypress/integration)):
51
+
To show some simple examples (from
52
+
[cypress/integration/query.spec.js](https://github.com/testing-library/cypress-testing-library/blob/master/cypress/integration/query.spec.js) or [cypress/integration/find.spec.js](https://github.com/testing-library/cypress-testing-library/blob/master/cypress/integration/find.spec.js)):
0 commit comments