Skip to content

Commit b6f741b

Browse files
Adds comma to testcafe example code
1 parent 21c7ace commit b6f741b

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

docs/testcafe-testing-library/intro.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ title: Testcafe Testing Library
55

66
## Introduction
77

8-
[`testcafe-testing-library`][gh] allows the use of dom testing library queries within
9-
[Testcafe](https://devexpress.github.io/testcafe/) for cross-browser end-to-end web
10-
testing.
8+
[`testcafe-testing-library`][gh] allows the use of dom testing library queries
9+
within [Testcafe](https://devexpress.github.io/testcafe/) for cross-browser
10+
end-to-end web testing.
1111

12-
If you are new to the testing-library approach for writing tests, check out the [this guide on which query to use](https://testing-library.com/docs/guide-which-query) as well as the [cheat sheet](https://testing-library.com/docs/dom-testing-library/cheatsheet).
12+
If you are new to the testing-library approach for writing tests, check out the
13+
[this guide on which query to use](https://testing-library.com/docs/guide-which-query)
14+
as well as the
15+
[cheat sheet](https://testing-library.com/docs/dom-testing-library/cheatsheet).
1316

1417
## Install
18+
1519
```
1620
npm install --save-dev testcafe @testing-library/testcafe
1721
```
@@ -35,15 +39,19 @@ You can now import & use get[All]By*, query[All]By*, find[All]By\* selectors in
3539
your tests.
3640
[See `DOM Testing Library` API for reference](dom-testing-library/api-queries.md)
3741

38-
> A note about queries in testcafe. Testcafe has [built in waiting](https://devexpress.github.io/testcafe/documentation/test-api/built-in-waiting-mechanisms.html#wait-mechanism-for-selectors), for this reason, there's no difference between `queryBy` and `findBy` queries in testcafe testing library. `getBy` queries will throw an exception (as designed) so they will fail immediately and do not work with the built in waiting that Testcafe provides.
42+
> A note about queries in testcafe. Testcafe has
43+
> [built in waiting](https://devexpress.github.io/testcafe/documentation/test-api/built-in-waiting-mechanisms.html#wait-mechanism-for-selectors),
44+
> for this reason, there's no difference between `queryBy` and `findBy` queries
45+
> in testcafe testing library. `getBy` queries will throw an exception (as
46+
> designed) so they will fail immediately and do not work with the built in
47+
> waiting that Testcafe provides.
3948
4049
## Examples
4150

4251
To show some simple examples (from
4352
[https://github.com/testing-library/testcafe-testing-library/blob/master/tests/testcafe/selectors.js](https://github.com/testing-library/testcafe-testing-library/blob/master/tests/testcafe/selectors.js)):
4453

4554
```javascript
46-
4755
test('getByPlaceHolderText', async t => {
4856
await t.typeText(
4957
getByPlaceholderText('Placeholder Text'),
@@ -116,7 +124,7 @@ test('still works after browser page load and reload', async t => {
116124

117125
```json
118126
"clientScripts": [
119-
"./node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js"
127+
"./node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js",
120128
"./path/to/my-app-testcafe.config.js"
121129
]
122130
```
@@ -131,8 +139,8 @@ window.TestingLibraryDom.configure({ testIdAttribute: 'data-automation-id' })
131139

132140
By default the selectors come pre-bound to `document.body`, so no need to
133141
provide a container. However, if you want to restrict your query using a
134-
container, you can use `within` which can take either a
135-
string or a query (get[All]By*, query[All]By*, find[All]By\*).
142+
container, you can use `within` which can take either a string or a query
143+
(get[All]By*, query[All]By*, find[All]By\*).
136144

137145
### Examples using `within`
138146

0 commit comments

Comments
 (0)