Skip to content

Commit 9ebc2f4

Browse files
authored
docs: add testIdAttribute configuration (#126)
1 parent eb797e3 commit 9ebc2f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ cy.findAllByText('Some Text').should('have.length', 1)
166166
cy.findByText('Some Text').should('exist')
167167
```
168168

169+
## Config testIdAttribute
170+
171+
If you would like to change the default testId from `data-testId` to `data-test-id`, add to your project's `cypress/support/index.js`:
172+
173+
```javascript
174+
import {configure} from '@testing-library/cypress'
175+
configure({testIdAttribute: 'data-test-id'})
176+
```
177+
178+
It accepts all configurations listed in [DOM testing library](https://testing-library.com/docs/dom-testing-library/api-configuration).
179+
169180
## Other Solutions
170181

171182
I'm not aware of any, if you are please [make a pull request][prs] and add it

0 commit comments

Comments
 (0)