React Testing Library · Module
findByAltText
findByAltText finds an element by matching its alt text. It waits and retries until the element appears, then returns a promise for that element.
Last updated
Syntax
findByAltText(text: TextMatch, options?: { exact?: boolean; normalizer?: NormalizerFn }): Promise<HTMLElement>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
getByAltTextqueryByAltTextgetAllByAltTextqueryAllByAltTextfindAllByAltTextscreenwithinTextMatch