Skip to content

Commit

Permalink
docs: add testIdAttribute configuration (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBoll authored Mar 5, 2020
1 parent eb797e3 commit 9ebc2f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ cy.findAllByText('Some Text').should('have.length', 1)
cy.findByText('Some Text').should('exist')
```

## Config testIdAttribute

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`:

```javascript
import {configure} from '@testing-library/cypress'
configure({testIdAttribute: 'data-test-id'})
```

It accepts all configurations listed in [DOM testing library](https://testing-library.com/docs/dom-testing-library/api-configuration).

## Other Solutions

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

0 comments on commit 9ebc2f4

Please sign in to comment.