Cypress · Function
cy.findByRole
cy.findByRole is a Cypress Testing Library query that finds an element by its accessible role and name. Cypress also provides cy.getByRole() as a built-in alternative.
Last updated
Syntax
cy.findByRole(role, options?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
cy.getByRole()@testing-library/cypressfindByLabelTextfindByTextfindByTestIdCypress Accessibility