Skip to content

Commit 8848b62

Browse files
author
Ben Monro
committed
docs: link to doc site for usage.
1 parent 9fb6b7b commit 8848b62

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

README.md

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -63,66 +63,9 @@ should be installed as one of your project's `devDependencies`:
6363
npm install --save-dev testcafe-testing-library
6464
```
6565

66-
### With typescript
67-
68-
TODO: Add typescript support #10 PRs welcome!
69-
70-
<!--
71-
Typings are defined under `cypress-testing-library/typings`, and should be added as follows in `tsconfig.json`:
72-
73-
```json
74-
{
75-
"compilerOptions": {
76-
"types": ["cypress", "../cypress-testing-library/typings"]
77-
}
78-
}
79-
```
80-
-->
81-
8266
## Usage
8367

84-
`testcafe-testing-library` provides custom Selectors allowing you to query the
85-
dom.
86-
87-
Add `testcafe-testing-library` to your test fixture's `beforeEach` hook:
88-
89-
```javascript
90-
import {
91-
getByText, //or any other queries you want
92-
addTestcafeTestingLibrary,
93-
} from 'testcafe-testing-library'
94-
95-
fixture`selectors`.beforeEach(addTestcafeTestingLibrary)
96-
.page`http://localhost:13370`
97-
```
98-
99-
You can now import & use `getBy`, `getAllBy`, `queryBy` and `queryAllBy`
100-
selectors in your tests.
101-
[See `dom-testing-library` API for reference](dom-testing-library/api-queries.md)
102-
103-
## Examples
104-
105-
To show some simple examples (from
106-
[https://github.com/benmonro/testcafe-testing-library/blob/master/tests/testcafe/selectors.js](https://github.com/benmonro/testcafe-testing-library/blob/master/tests/testcafe/selectors.js)):
107-
108-
```javascript
109-
test('getByPlaceHolderText', async t => {
110-
await t.typeText(
111-
getByPlaceholderText('Placeholder Text'),
112-
'Hello Placeholder',
113-
)
114-
})
115-
test('getByText', async t => {
116-
await t.click(getByText('getByText'))
117-
})
118-
119-
test('getByLabelText', async t => {
120-
await t.typeText(
121-
getByLabelText('Label For Input Labelled By Id'),
122-
'Hello Input Labelled By Id',
123-
)
124-
})
125-
```
68+
[Usage Docs](https://testing-library.com/docs/testcafe-testing-library/intro#usage)
12669

12770
## Other Solutions
12871

0 commit comments

Comments
 (0)