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 hangs after specific click (involving Unstable_TrapFocus) #30630

Open
ruchamafr opened this issue Nov 17, 2024 · 5 comments
Open

Cypress hangs after specific click (involving Unstable_TrapFocus) #30630

ruchamafr opened this issue Nov 17, 2024 · 5 comments
Labels
Reproducible Can be reproduced stage: needs investigating Someone from Cypress needs to look at this type: bug type: performance 🏃‍♀️ Performance related

Comments

@ruchamafr
Copy link

ruchamafr commented Nov 17, 2024

Current behavior

cypress stuck after clicking and post request hang up

Desired behavior

cypress should continue to the next page

Test code to reproduce

it("save form anonymous before send  ", () => {
    Cypress.on("uncaught:exception", (err, runnable) => {
      return false;
    });
    cy.visit(
      "https://govforms.gov.il/mw/forms/[email protected]#!simpleFields",{timeout: 30000});
 
 cy.get("#id-1-0-mobxReactForm").type("yyyy")
 cy.wait(200);
 
    cy.get('[data-testid="saveButton"]').click();
 
    cy.get('[data-testid="otp-register-selectOption"]')
      .eq(1)
      .check({ force: true });
 
 
    cy.get('[data-testid="otp-register-field-email"]')
      .type("[email protected]")
      .blur().then(exists => {
        cy.wait(3000)
**here after click cypress stuck**
        cy.get('[data-testid="otp-register-continueButton"]').click({force: true,waitForAnimations: false,animationDistanceThreshold: 20}).then(() => {
          cy.wait('@preflight') });;
      });

})

Cypress Version

13.15.1

Node version

20.12.2

Operating System

windows 10

Debug Logs

No response

Other

No response

@mschile
Copy link
Contributor

mschile commented Nov 18, 2024

What exactly do you mean by Cypress is stuck? What are the console errors?

You may want to check out the Cypress Discord Community Discord chat, it can be helpful for debugging or answering questions on how to use Cypress.

Right now there doesn't seem to be enough information to reproduce the problem on our end. Forking Cypress Test Tiny makes sharing a reproducible example easier to share and easier for us to replicate your issue. This method also keeps the reproduction as simple as possible, which helps us eliminate potential causes and noise from the investigation.

@ruchamafr
Copy link
Author

ruchamafr commented Nov 19, 2024

thank you so much @mschile for answering me ,
we are really in a big problem since this problem
here is the code to reproduce (very simple)
regarding errors I dont get error , just the runner wait freeze a long time

cypress-io/cypress-test-tiny@master...ruchamafr:cypress-test-tiny:patch-1

@ryanthemanuel
Copy link
Collaborator

I did some digging on this and it appears that the issue comes from Unstable_TrapFocus. Are you aware of how you all are using that? It seems not to be playing nicely with some of the focus logic inside of Cypress and it's causing an infinite loop. It's unclear still where the problem lies (in Cypress or the third party component), or if there's a workaround, but I'm wondering if you can somehow disable that component during tests/upgrade it/etc. to try and get around the problem?

@ruchamafr
Copy link
Author

ruchamafr commented Nov 28, 2024

I did some digging on this and it appears that the issue comes from Unstable_TrapFocus. Are you aware of how you all are using that? It seems not to be playing nicely with some of the focus logic inside of Cypress and it's causing an infinite loop. It's unclear still where the problem lies (in Cypress or the third party component), or if there's a workaround, but I'm wondering if you can somehow disable that component during tests/upgrade it/etc. to try and get around the problem?

Hi ryanthemanuel, I really appriciate your digging because the developer put on metirials ui-package the properties
(Dialog Modal Popover) :
-disableEnforceFocus
-וdisableAutoFocus

and now it works!!
thanks u so much
I would very happy to understand how did you discover the problem beacause I didnt success to digg like you
if you can explain me how
thanks again

@ruchamafr
Copy link
Author

Hi @ryanthemanuel , I really appriciate your digging , the developer put on metirials ui-package the properties
(Dialog Modal Popover) :
-disableEnforceFocus
-וdisableAutoFocus

and now it works!!
thanks u so much
I would very happy to understand how did you discover the problem beacause I didnt success to digg like you
if you can explain me how
thanks again

@jennifer-shehane jennifer-shehane changed the title cypress stuck after specific click (think bacause console erors) Cypress hangs after specific click (involving Unstable_TrapFocus) Dec 4, 2024
@jennifer-shehane jennifer-shehane added type: performance 🏃‍♀️ Performance related type: bug Reproducible Can be reproduced stage: needs investigating Someone from Cypress needs to look at this labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reproducible Can be reproduced stage: needs investigating Someone from Cypress needs to look at this type: bug type: performance 🏃‍♀️ Performance related
Projects
None yet
Development

No branches or pull requests

4 participants