Playwright · Matcher
toHaveAccessibleName
toHaveAccessibleName checks that a locator points to an element with the expected accessible name. It supports strings, regular expressions, case-insensitive matching, cancellation, and a retry timeout.
Last updated
- Since
- v1.44
Syntax
await expect(locator).toHaveAccessibleName(name, options);In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
LocatorAssertionsexpecttoHaveAccessibleDescriptiontoHaveRolegetByTestId