Interop Accessibility: add test_driver.get_accessibility_tree
Add get_accessibility_tree endpoint to testdriver. In this change the endpoint presents the interface in Chrome Devtools Protocol's Accessibility.getFullAXTree.
This API can be used to test aria attributes like aria-orientation and aria-invalid and that the browser uses the correct default values when they are not set in the html element.
Related: https://github.com/web-platform-tests/interop-accessibility/issues/51
This change is a part of the work to find and implement additional ways we can test conformance of browsers with accessibility specs. I think this is a good step in following that goal but I am not sure of all the steps that will need to be done to realize it.
Demonstration tests of this can be seen in this downstream change in Chromium: https://chromium-review.googlesource.com/c/chromium/src/+/5100655
And I'm posting this work here in part to fulfill a comment in that change. https://chromium-review.googlesource.com/c/chromium/src/+/5100655/comments/2f3aa4b4_da35e7ed
To land this in testdriver.js and use it from tests in WPT, you'll need to go through https://github.com/web-platform-tests/rfcs. Note that there is an exception for "extending testdriver.js with a method that closely matches a WebDriver endpoint" but this is wrapping a CDP command, not a standardized WebDriver endpoint.
I understand that this is a proof of concept and that you hope to prove this approach viable before doing all of the spec work. Another path could be to add this in a new testdriver.tentative.js and also add a lint that prevents the use of that except in tentative tests. This is a new approach and would also require an RFC, but it would not be blocked on standardizing a WebDriver endpoint this as the first step.
Another path could be to add this in a new
testdriver.tentative.jsand also add a lint that prevents the use of that except in tentative tests. This is a new approach and would also require an RFC, but it would not be blocked on standardizing a WebDriver endpoint this as the first step.
@foolip filed an RFC for this at https://github.com/web-platform-tests/rfcs/pull/180
My thoughts align with others above re: RFC in WebDriver and/or AOM.
IIRC, the initial justification for this feature was proposed in:
- https://github.com/web-platform-tests/interop/issues/211
Interop testing of some TBD accessibility tree was one of the long-term original goals of AOM. One major complication is that WebKit based its internal tree off the RenderTree, compared to Gecko, which starts off the DOM tree. Chromium made a major implementation change a few years ago to more closely align with Gecko, but all 3 are still fairly different.
It would be nice to see some output comparisons between Chromium's getFullAXTree, WebKit's dumpAccessibilityTree, and the Gecko equivalent. Even though these are going to remain different for the near future, it could inform ongoing WPT testing, and it's possible it could be useful for some WPT tests if they were limited to substring comparison of the output.