@@ -23,26 +23,7 @@ npm install --save-dev testcafe @testing-library/testcafe
23
23
` testcafe-testing-library ` provides custom Selectors allowing you to query the
24
24
dom.
25
25
26
- ### for v2.x:
27
-
28
- Add ` testcafe-testing-library ` to your test fixture's ` beforeEach ` hook:
29
-
30
- ``` javascript
31
- import {
32
- getByText , // or any other queries you want
33
- addTestcafeTestingLibrary ,
34
- } from ' @testing-library/testcafe'
35
-
36
- fixture` selectors` .beforeEach (addTestcafeTestingLibrary)
37
- .page ` http://localhost:13370`
38
- ```
39
-
40
- ### for v3.x+ (requires testcafe 1.4.0 or greater)
41
-
42
- ` addTestcafeTestingLibrary ` was removed in 3.x, instead you can now [ inject
43
- clientScripts] [ inject ] as of testcafe 1.4.0. For now, the path has to be used,
44
- but this will hopefully be changed to a module soon (pending a change to
45
- testcafe to support ` umd:main ` in package.json.
26
+ Add the following to your .testcaferc.json file:
46
27
47
28
``` json
48
29
"clientScripts" : [
@@ -150,9 +131,7 @@ window.TestingLibraryDom.configure({ testIdAttribute: 'data-automation-id' })
150
131
151
132
By default the selectors come pre-bound to ` document.body ` , so no need to
152
133
provide a container. However, if you want to restrict your query using a
153
- container, you can use ` within ` . Note similar to using a testcafe
154
- ` ClientFunction ` so you will need to await ` within ` , and you can't make
155
- assertions on it like you can using a ` Selector ` . ` within ` can take either a
134
+ container, you can use ` within ` which can take either a
156
135
string or a query (get[ All] By* , query[ All] By* , find[ All] By\* ).
157
136
158
137
### Examples using ` within `
0 commit comments