Skip to content

API Reference / @gtkx/testing / getSuggestedQuery

Function: getSuggestedQuery() ​

getSuggestedQuery(target, variant?, method?): Suggestion | undefined

Defined in: packages/testing/src/suggestions.ts:78

Computes the recommended query for reaching the given widget, preferring role, then label text, placeholder text, text, display value, and name.

Parameters ​

target ​

Accessible

Widget to build a suggestion for.

variant? ​

Variant = "get"

Query variant the suggestion should use.

method? ​

Method

Restrict the suggestion to a specific query family instead of choosing by priority.

Returns ​

Suggestion | undefined

The best available suggestion, or undefined when no query applies.