Skip to content

[solved] I get an error message if I don't prepend calls to findBy... with a get('body') call #142

Closed
@dutzi

Description

@dutzi
  • cypress-testing-library version: ^6.0.0
  • node version: v10.21.0
  • npm (or yarn) version: 1.22.4 (yarn)

Relevant code or config

    cy.visit('/email-verified')
      .findByText(/okay/i)

What you did:

I visit a page and call findByText

What happened:

I get the following error message:

Timed out retrying: Expected container to be an Element, a Document or a DocumentFragment but got Window.

image

If I call get('body') before calling findByText it works:

    cy.visit('/email-verified')
      .get('body')
      .findByText(/okay/i)

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