Skip to content
masterclass Buddy

React Testing Library · Function

logRoles

logRoles prints implicit ARIA roles and the matching elements in a DOM tree. Use it to find suitable getByRole queries.

Last updated

Syntax

logRoles(container)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • getRoles
  • isInaccessible
  • getByRole
  • screen.debug

Source: Accessibility | Testing Library. Checked 2026-11-03.