Skip to content

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

Closed
@DanielPe05

Description

@DanielPe05
  • cypress-testing-library version: ^6.0.1
  • node version: v12.13.1
  • npm (or yarn) version: npm v6.12.1

Relevant code or config

cy.findByText('Submit CTA')
      .should('exist')
      .click()

What happened:

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

Problem description:
This problem is outlined in this thread cypress-io/cypress#7306 where DOM nodes are detached prior to attempting the clicks. I thought that #78 would take care of that problem but it looks like the problem exists when running the code above. As you can imagine this makes tests flaky and it doesn't look like cypress has native support for this yet.

In this post they provide a workaround to this problem by using the pipe plugin however when used in combination with cypress-testing-library it looks like the problem still exists.

I'm posting here simply because we are using the library and I was wondering if #78 was intended to fix this issue and I'm not sure if maybe I'm misusing findByText. Any help or direction is appreciated.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions