Skip to content

Add options for testing aria-live announcements #431

@Paul-Hebert

Description

@Paul-Hebert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions