Support querying by ARIA role instead of relying only on HTML semantics? #316
stanlee974
started this conversation in
Ideas
Replies: 2 comments 14 replies
-
|
@stanlee974 I think this is a great idea. you could testit out by extending the button selector: import (Button as $Button } from "@interactors/html";
export const Button = $Button.extend('AriaButton')
.selector('button,input[type=button],input[type=submit],input[type=reset],input[type=image],[role=button]') |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Hi @stanlee974, Welcome and it makes us happy that you like interactors. Like Charles said, it makes a lot of sense to use ARIA roles this way. How much do you think we should bring accessibility elements into interactors in your opinion? |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !
First off, big fan of Interactors – I really like how it brings test interactions closer to the actual user experience. It’s a clean and thoughtful approach. I had a quick idea I wanted to run by you:
Would it make sense to support selecting elements by their ARIA roles (native role or explicit role e.g.
role="button") in addition to using native HTML semantics like<button>or<nav>?Many modern apps, often run into custom components or elements that rely on ARIA roles for accessibility rather than native HTML tags. And since ARIA roles are central in both WCAG and W3C guidelines, supporting them would make Interactors even more aligned with accessibility best practices.
For example:
<div role="button">that behaves like a buttonrole="textbox"I'm also seeing a strong alignment here with the testing philosophy behind UUV (User-centric Usecases Validator), which is built around role-based querying and human-readable tests that reflect what real users experience. Two tools, one vision, just not the same battlefield.
What do you think?
Would this be something worth exploring or supporting natively?
Thanks again for the great work you're doing here – this project really pushes testing in a meaningful direction.
Beta Was this translation helpful? Give feedback.
All reactions