Function: findByLabelText()
findByLabelText(
container,text,options?):Promise<Widget>
Defined in: queries.ts:397
Finds a single element by its label or text content.
Matches button labels, input placeholders, window titles, and other accessible text content.
Parameters
| Parameter | Type | Description |
|---|---|---|
container | Container | The container to search within |
text | TextMatch | Text to match (string, RegExp, or custom matcher) |
options? | TextMatchOptions | Query options including normalization and timeout |
Returns
Promise<Widget>
Promise resolving to the matching widget
Example
const button = await findByLabelText(container, "Click me");
const input = await findByLabelText(container, /search/i);