Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

findByRole: Unable to query heading by level #374

@weyert

Description

@weyert

I am trying to query a h1 element by using the following: findByRole('heading', { name: /Applications/i, level: 1 }) as suggesting on testing-library.com but this appears not to be working when using this library.

The following error is shown:

 elementHandle.evaluateHandle: Error: Found multiple elements with the role "heading" and name `/Applications/i` Here are the matching elements: <h1 class="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:leading-9 sm:truncate" > Available Applications </h1> <h4 class="mb-3 text-sm font-medium leading-tight text-gray-500 uppercase sr-only" id="group-title-1" > Available Applications </h4> 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions