Skip to content

get/query variants don't exist #250

Closed as not planned
Closed as not planned
@jamesarosen

Description

@jamesarosen

The issue template says that questions about query APIs should go to https://github.com/kentcdodds/dom-testing-library, but these methods do exist there: https://github.com/testing-library/dom-testing-library/blob/0ce0c7054dfa64d1cd65053790246aed151bda9d/types/queries.d.ts#L297-L302

The Cypress Testing Library docs say

You can now use all of DOM Testing Library's findBy, findAllBy, queryBy and queryAllBy commands off the global cy object.

Those same docs reference "all library definitions". That file includes only findBy… and findAllBy… methods. cy.queryAllByTestId, for example, doesn't exist.

  • cypress-testing-library version: 8.0.3
  • node version: v16.17.1
  • npm (or yarn) version: 8.15.0

Why I care

I want to look for [data-testid="foo"] -- which may or may not exist -- then make a decision based on what I get back. I want to wait for the standard timeout to make sure the element doesn't exist, so I don't want to just use document.querySelector.

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