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

Selector playground omits quotes for preferred data- attribute selectors #1884

Closed
silversteez opened this issue Jun 5, 2018 · 4 comments · Fixed by #18442
Closed

Selector playground omits quotes for preferred data- attribute selectors #1884

silversteez opened this issue Jun 5, 2018 · 4 comments · Fixed by #18442

Comments

@silversteez
Copy link

Current behavior:

When using selector playground to select elements with preferred data attributes (data-cy, data-test, data-testid), the provided selector is missing quotes around the value. The selector then fails to .get() the desired element during test.

Any other data- attribute works correctly.

Desired behavior:

Preferred data- attribute selectors should have quotes around the value

Steps to reproduce:

Use selector playground to select any element with a data-test="whatever" attribute

Versions

Cypress 3.0.1, Mac Os 10.12.5, Electron 59

@brian-mann
Copy link
Member

I believe there is a check that tests whether or not the quotes are necessary - and only conditionally adds them.

Can you provide an example / code / screenshot / whatever to show the behavior you're describing?

@brian-mann brian-mann added the stage: needs information Not enough info to reproduce the issue label Jun 5, 2018
@silversteez
Copy link
Author

Here are a few screenshots of the DOM and results offered by selector playground:

screen shot 2018-06-05 at 3 14 20 pm

screen shot 2018-06-05 at 3 14 10 pm

screen shot 2018-06-05 at 3 14 28 pm

Any non-preferred data- attribute includes the quotes:

screen shot 2018-06-05 at 3 17 08 pm

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Jun 6, 2018
@chrisbreiding
Copy link
Contributor

Looks like this is only an issue in electron. Chrome has no problem with cy.get('data-test=add-attribute-button]'). @brian-mann Do you recall the reason for this change? Any reason not to quote all attribute values?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 23, 2021

Released in 9.1.0.

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

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Nov 23, 2021
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants