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

fix: Allow option values containing quotation marks to be selected #29214

Merged

Conversation

davidfurey
Copy link
Contributor

Additional details

I believe this issue was introduced by #25016

PR Tasks

@CLAassistant
Copy link

CLAassistant commented Mar 28, 2024

CLA assistant check
All committers have signed the CLA.

@cypress-app-bot
Copy link
Collaborator

@jennifer-shehane
Copy link
Member

@davidfurey Could you add a changelog entry to this PR? Thanks! https://github.com/cypress-io/cypress/blob/develop/guides/writing-the-cypress-changelog.md

@davidfurey
Copy link
Contributor Author

@davidfurey Could you add a changelog entry to this PR? Thanks! https://github.com/cypress-io/cypress/blob/develop/guides/writing-the-cypress-changelog.md

Does this belong in cli/CHANGELOG.md?

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

@davidfurey For the changelog, this should be added to the cli/changelog.md file, not the file within the main changelog. (This isn't used anymore).

I verified that this fixes the previously failing test. Thanks for the contribution!

Before

Screenshot 2024-03-28 at 10 12 23 AM

After

Screenshot 2024-03-28 at 10 46 07 AM

@davidfurey davidfurey force-pushed the df/fix-select-quotation branch 2 times, most recently from 38530d1 to db8f4e7 Compare March 28, 2024 14:57
…es containing quotation marks can be selected
@davidfurey
Copy link
Contributor Author

Thanks for the speedy review @jennifer-shehane

I've updated the changelog

@@ -128,7 +128,7 @@ export default (Commands, Cypress, cy) => {
values.push(value)

// https://github.com/cypress-io/cypress/issues/24739
if (options.$el.find(`option[value="${value}"]`).length > 1) {
if (options.$el.find(`option[value="${value.replace(/"/g, '\\\"')}"]`).length > 1) {

Choose a reason for hiding this comment

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

@davidfurey Only if you have the spare cycles - but I'm curious as a RegEx noob what this logic actually does and how it resolves the bug. Would appreciate an explanation (but again, only if you have time). Thank you!

@jennifer-shehane
Copy link
Member

Going to merge with these chrome beta tests failing, this is a known issue we're investigating here: #29199

@jennifer-shehane jennifer-shehane merged commit 425ba79 into cypress-io:develop Mar 29, 2024
63 of 65 checks passed
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 2, 2024

Released in 13.7.2.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 2, 2024
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.

cy.select() fails if option value contains a quotation mark
6 participants