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

cypress clicks links in checkbox labels since 13.5.1 #28342

Closed
DavesPlanet opened this issue Nov 15, 2023 · 2 comments
Closed

cypress clicks links in checkbox labels since 13.5.1 #28342

DavesPlanet opened this issue Nov 15, 2023 · 2 comments

Comments

@DavesPlanet
Copy link

DavesPlanet commented Nov 15, 2023

Current behavior

given a div with role="checkbox" and a link in the checkbox label, such as

  <div class="checkbox">
       <div id="DisclosureCheckbox"
            role="checkbox"
            aria-labelledby="DisclosureCheckbox_label"
            aria-checked="false" aria-required="true">
       </div>
       <label id="DisclosureCheckbox_label" for="DisclosureCheckbox">
           I have read and agree to the
           <span><a target="_blank"  href="http://google.com">Disclosure</a> (PDF).</span>
       </label>
   </div>
 

the following code previously checked the checkbox, but since yesterday it has been clicking on the link in the label, causing test failures in numerous projects.

cy.get('.checkbox > label').click()

Desired behavior

just wanted you to alert you to a breaking change in case it was not intended

Test code to reproduce

cy.get('.checkbox > label').click()
given the checkbox label also contains a link

Cypress Version

13.5.1

Node version

v20.9.0

Operating System

Win 10 enterprise

Debug Logs

No response

Other

No response

@DavesPlanet DavesPlanet changed the title cypress checks links in checkbox labels since 13.5.1 cypress clicks links in checkbox labels since 13.5.1 Nov 15, 2023
@jennifer-shehane
Copy link
Member

@DavesPlanet Thanks for reporting. Could you provide a fully reproducible example? I'm unable to reproduce this given the information we have. I ran a test with a label and checkbox similar to this and it is clicking the checkbox correctly in 13.5.1

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Nov 15, 2023
@DavesPlanet
Copy link
Author

apologies I cannot. I have spent the last hour on this and any minor deviation from our production code does not reproduce the issue, even excluding combinations of css files. We corrected the issue by removing all carrots from our package.json, which forced versions of things to stay the way they were. We know the issue first occurred today, the day after your release of 13.5.1 but I am afraid I will need to close this issue as un-reproduceable with anything but our full production suite. Even then it only failed for certain tests which included different css than other tests. Thank you for your time.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants