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

Selecting an option from an auto-submitting select box causes "element is detached from the DOM" #9032

Closed
marc-guenther opened this issue Oct 29, 2020 · 1 comment

Comments

@marc-guenther
Copy link

marc-guenther commented Oct 29, 2020

I have a very simple page with a select box and a text field. The select box submits the page on every change.

I have this very simple test spec:

  • select something from the box
  • type something in the field
cy.get("select").select("Second")
cy.get("input").type("Hallo")

This used to work perfectly fine with Chrome 80. Since Chrome 83, the second cy.get() throws an error:

Timed out retrying: cy.type() failed because this element is detached from the DOM.

<input>

As a workaround, we had to put an explicit cy.wait(100) between the two commands.

cy.get("select").select("Second")
cy.wait(100)
cy.get("input").type("Hallo")

As we had quite a lot of those, this slowed down our tests. Also I don't think these should be required here. (I only just now noticed something curious, even a cy.wait(0) will work, at least in the testcase linked below)

This works in Firefox, and in Chrome version 80 (which I luckily still had on an old machine). As Google makes it almost impossible to download an older Chrome version, I couldn't really try different versions.

Cypress version otoh doesn't really seem to matter, it happens in old versions as well as in current version.

Here is a small repo which reproduces the problem. Simply runnpm start.

@jennifer-shehane
Copy link
Member

This is a duplicate of #7306, but the best example of this issue that we've been given. I'll post this example in the other thread. Thanks for sending the reproducible!

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