Skip to main content

Function: findByText()

findByText(container, text, options?): Promise<Widget>

Defined in: queries.ts:433

Finds a single element by visible text content.

Similar to findByLabelText but focuses on directly visible text.

Parameters

ParameterTypeDescription
containerContainerThe container to search within
textTextMatchText to match (string, RegExp, or custom matcher)
options?TextMatchOptionsQuery options including normalization and timeout

Returns

Promise<Widget>

Promise resolving to the matching widget