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

feat: support data-qa selector in selector playground #25475

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

lmiller1990
Copy link
Contributor

@lmiller1990 lmiller1990 commented Jan 17, 2023

User facing changelog

Support data-qa selector in Selector Playground in addition to data-cy, data-test and data-testid.

Additional details

It's common to use data-qa when indicating selectors used in End to End tests. QA engineers are one of the most common cohorts using Cypress Studio, so it follows we should respect data-qa alongside data-test* and data-cy.

Steps to test

You can point this branch at a project with data-qa and try using Selector Playground. I also recorded a video so you can see it in action.

simplescreenrecorder-2023-01-17_11.15.19.mp4

How has the user experience changed?

PR Tasks

@cypress
Copy link

cypress bot commented Jan 17, 2023

Copy link
Contributor

@marktnoonan marktnoonan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to add this for Studio. I was surprised when I noticed that Studio doesn't seem to use the onElement callback available for Selector Playground, since it would be good to customize this for recording tests. #25305 (comment)

@emilyrohrbough
Copy link
Member

@lmiller1990 You say it's common to use data-qa as a selector. Do you have any stats on how common this is?

@lmiller1990
Copy link
Contributor Author

lmiller1990 commented Jan 18, 2023

@lmiller1990 You say it's common to use data-qa as a selector. Do you have any stats on how common this is?

@emilyrohrbough I mainly used my intuition and anecdotal experience here, but for some numbers, checking GitHub:

image

For comparison:

  • data-qa: 295K
  • data-test: 700K
  • data-testid: 1M

Not as popular but still common enough (imo). Thoughts? I think this is common enough to justify adding, and there's little to no downside.

@mjhenkes mjhenkes removed the request for review from rockindahizzy January 19, 2023 15:01
@emilyrohrbough
Copy link
Member

@lmiller1990 Sounds good to me to add data-qa. This seems to solve part of this user's by providing data-qa support, but isn't actually adding support for data-*. I think that's fine but maybe updating the issue request would clarifying what was accomplished when this is closed?

@lmiller1990
Copy link
Contributor Author

lmiller1990 commented Jan 19, 2023

Oh oops, good point @emilyrohrbough, updated it. #25305 (Cypress Studio to utilize data-qa attribute if present for element selection)

@lmiller1990 lmiller1990 merged commit ad0b2a3 into develop Jan 20, 2023
@lmiller1990 lmiller1990 deleted the feat/issue-25305-data-qa branch January 20, 2023 00:34
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 24, 2023

Released in 12.4.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.4.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress Studio to utilize data-qa attribute if present for element selection
4 participants