-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Assistive technologies use aria-live regions to announce important content changes to their users.
It would be great if Pleasantest exposed tools to help test aria live announcements. There are two approaches that could work:
Adding a new assertion
Something along these lines:
await expect('Preparing Learning Path').toBeAnnounced();Adding more info to getAccessibilityTree
Another option would be to expose aria live regions in the accessibility tree. Perhaps by adding (aria-live) after the role or something?
Then in your tests you could check the aria-live region before and after an action and see that the text had changed (And presume it had been announced)
If we went this way should we probably provide info about whether the mode is polite or assertive. In follow-up cards we could also look into supporting aria-atomic, aria-relevant, aria-busy, etc.
I'm not sure which of these I'd prefer from a test writing perspective. It would be awesome to have both options, but that obviously adds complexity. Either one could solve for this use case.