-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Support for testing additional accessibility properties beyond name and role. #55784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…nd role.
1. Implement get_element_accessible_node and get_accessible_node in wptrunner and TestDriver.
For wptrunner, this is currently only supported in executormarionette (Gecko), as there is no implementation yet in any other browser to support.
2. Add AriaUtils.verifyAccessibilityTree for simpler tree verification using a simple JS object.
3. Add simple WPT tests exercising and demonstrating these new methods.
|
There are a number of blocking details to sort out here, but I figured it was worth posting this to get things moving and get some initial feedback.
|
|
From our last meeting I think we can omit "tentative" prefixes in the API names and instead assert that the methods are only used in tentative tests. I've implemented that in this PR. |
…ode to element_accessible_properties.
…ccessibilityTree to verifyAccessibilitySubtree, wai-aria/tree to wai-aria/subtree.
alice
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so good to see this progressing!
substantive feedback in first review has been or is being addressed.
…rifyAccessibilitySubtree take either an Element or a selector.
…basic" tests intended purely to test that the accessible_properties methods are working vs actual tests for specific properties.
| ], | ||
| }); | ||
| */ | ||
| verifyAccessibilitySubtree: function(subtreeRoot, expectedTree) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment asking if I like this is buried somewhere in an old revision, but yes, I like this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twilco and I were discussing, and have some reservations that AI-slop tests might get auto-submitted with an expectation of structure reliant on implementation details in one vendor's tree. Given that some of these pre-autosubmission reviews happen outside the public GitHub repo, this could result in much more effort to remove the invalid assumptions than to generate them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this is using assertTestIsTentative() which is a good start, but this one may need more consideration... I'm thinking maybe this one should not go in aria-utils.js yet... What about a separate JS file (filename also using the substring tentative) where we include some more comments about the pitfalls of assuming a standardized tree where no standard exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately, I'll do whatever needs to be done to get this over the line. However, I'd counter-argue that AI-slop tests aren't just a risk for subtree tests. Tree structure isn't the only place where we don't have 100% specified interop. If AI-slop tests are a massive risk, it feels like this needs a broader solution. Moving a utility (granted one with a somewhat higher risk of interop mismatch) into a different file isn't going to solve it.
I think it's reasonable to add a note to the functions' header comment, but personally, I'd rather not move this into a different file unless that's a blocking concern.
|
(All my comments should be considered optional suggestions! I think this is fine already.) |
… a subtree being explicitly standardized.
| For example: | ||
| <div data-testname="div[role=button][aria-pressed=mixed]" | ||
| role="button" aria-pressed="mixed" | ||
| data-expected='{ "role": "button", "label": "foo", "pressed": "mixed" }' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON requires property names to be quoted, as well as double quotes rather than single quotes. It'd be nice to use the more permissive JS syntax - e.g. data-expected="{ role: 'button' }" - but doing that would require us to use eval instead of JSON.parse. eval is usually frowned upon, though I can make that change if folks are happy with it and it's not blocked by the CSP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine either way - whatever gets it done and others are happy with.
Closes web-platform-tests/interop-accessibility#211