testing-library / cypress-testing-library

🐅 Simple and complete custom Cypress commands and utilities that encourage good testing practices.
http://npm.im/@testing-library/cypress
MIT License
1.8k stars 152 forks source link

Feature request - specify attribute for findByTestId or surface findByAttribute #192

Closed penx closed 3 years ago

penx commented 3 years ago

I'd like to use data-test-id rather than data-testid for findByTestId, but I don't think that's currently possible with cypress-testing-library.

Can the attribute be configurable in findByTestId, or can findByAttribute be surfaced?

leschdom commented 3 years ago

It should be possible (haven't tried it myself though): https://github.com/testing-library/cypress-testing-library#config-testidattribute

penx commented 3 years ago

oops sorry, I had searched but clearly not hard enough 😀