Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record matching patterns support data-cy #185

Open
xchnshi opened this issue Nov 24, 2021 · 5 comments
Open

record matching patterns support data-cy #185

xchnshi opened this issue Nov 24, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@xchnshi
Copy link

xchnshi commented Nov 24, 2021

image
is it possible to add option supporting data-cy id? or event self defined keyword that mentioned in cypress best practise.

@xchnshi xchnshi changed the title record atching patterns support data-cy record matching patterns support data-cy Nov 24, 2021
@json2d
Copy link

json2d commented Apr 14, 2022

because it's documented as best practice, there really ought to be a mode that gives data-cy priority

@adam-stover
Copy link
Member

adam-stover commented Apr 15, 2022

Is it not currently prioritizing data-cy while in CSS selectors mode? It was written with the intent to prioritize data-cy first, then data-test, then data-testid, and only if those attributes are not present on the event target do we delegate to the finder library.

Is this not working as intended? If so please let us know and provide an example if possible.

} else if ((event.target as Element).hasAttribute('data-cy')) {

@json2d
Copy link

json2d commented Apr 15, 2022

it does work indeed! i made the wrong assumption based on the issue being still open.

@adam-stover
Copy link
Member

Thanks for testing! I'll update the documentation and close this issue after a couple days.

@adam-stover adam-stover added the documentation Improvements or additions to documentation label Apr 15, 2022
@xchnshi
Copy link
Author

xchnshi commented Jul 19, 2022

data-cy is the default behavior, please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants