Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Configuration to control the suggestions for the findByRole command #277

Open
@srkrish

Description

  • cypress-testing-library version: 10.0.1
  • node version: v18.15.0
  • npm (or yarn) version: 9.5.0

What you did:

Used cy.findByRole and cy.findAllByRole predominantly in my project

What happened:

When the command fails to find an accessible role, it lists all the accessible roles on the page after the term "Here are the accessible roles:"

Problem description:

Well, the suggestions are kind of agreeable when we run locally, but on a CI machine, they become really verbose. If the page has multiple accessible elements, it lists numerous options that span more than 1000 lines, making it pretty difficult to scroll and imagine this happening for multiple tests. Tried the following solution

cypress\support\e2e.js:

import { configure } from '@testing-library/cypress';

configure({
throwSuggestions: false,
computedStyleSupportsPseudoElements: false,
});

Suggested solution:

How to get the configuration working?

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

        AltStyle によって変換されたページ (->オリジナル) /