Create new test type aamtest for accessibility API testing#57696
Create new test type aamtest for accessibility API testing#57696spectranaut wants to merge 38 commits intomasterfrom
aamtest for accessibility API testing#57696Conversation
5aacc60 to
2016a87
Compare
Uh oh! Looks like an error!Client ID static/taskcluster/github does not have sufficient scopes and is missing the following scopes: This request requires the client to satisfy the following scope expression:
|
3101e53 to
7bda3f7
Compare
|
@jcsteh -- I'd love your early feedback on this completely new direction to add AAM tests, the tests are like the wpt's webdriver spec tests, all in python! Look at the blockquote test. The APIs are passed to the test as arguments ("fixtures" in pytest speak -- defined in wai-aria-aam/support/fixtures_a11y_api.py). The You can see these tests already in the wpt.fyi for this PR: https://wpt.fyi/results/?label=pr_head&max-count=1&pr=57696 |
|
@spectranaut Thanks for the early ping and for your work on this. This looks really neat! I haven't looked at this in-depth yet, but here are some early thoughts:
|
|
@jcsteh thanks as always for the thoughts! :) On 1, imperative vs declarative -- tbh I never had a strong preference either way, maybe slight :) I think the declarative approach aligns the way the mapping of the Core-AAM are presented.. they are somewhat simplified and kind of have their own language for describing the APIs. Plus we can reuse all the manual tests Joanie maintained. But I think I've been convinced by you that closer to the API/imperative tests will get us better results -- and make a better and more flexible test suite in the long run. On 2, on the python vs html+js flip -- yeah I see the tradeoffs! The tests in this PR all have inline html, but for more complicated tests, we can create an separate html file to open. I think if we are going to write imperative tests (which I've been convinced), I think we should write the tests in python, and choose those tradeoffs. On 3, on session objects/executing javascript -- the session object is an implementation of webdriver maintained in wpt here: https://github.com/web-platform-tests/wpt/tree/master/tools/webdriver These tests have all of webdriver available to them, including the ability to send in javascript to execute, or sending clicks, keys, etc. On 4, on DOM events -- in webdriver classic, you can't wait on DOM events, you can only poll for changes, which is probably good enough? There is a way to wait for things with webdriver bidi, but Safari doesn't have support for bidi yet. On 5 accessibility events -- awesome, yes, that will be helpful, and I think accessibility event testing will be easier here too. On 6, the |
a09c749 to
8765a3a
Compare
|
Hi @jcsteh -- I'm noticing that these tests are flakey on Firefox on Linux.. and I wonder if you know why or can think of an easy fix. The flakes were caught by the Community-TC Integration / wpt-firefox-nightly-stability and are easy to reproduce locally. Basically, the nodes all appear in the tree, but not all the correct attributes are set by the time we query for them. In the code, before we run the test, we (1) load the webpage, then (2) find for the correct tab (role: document web), then (3) wait until "busy" is not set. But when you run the test immediately after that, finding the node by DOM ID fails sometimes -- the blockquote node does not always have a DOM ID attribute. I added a poll to try to solve for this but it doesn't seem like a great solution, and then, I'm getting flakey failures while looking for another attribute in another test, as you can see in this CI report. Am I waiting for busy on the wrong thing? Or is this bug in firefox? |
|
Ah, this is due to caching granularity. By default, we only enable a small set of cached attributes to improve memory usage and performance, since a lot of clients don't need everything. When a client first requests something that isn't in the cache, we asynchronously enable it from that point forward. You can work around this by setting the pref |
|
Bad news, @jcsteh 😢 |
|
Very odd. I'll need to get this running locally so I can shove some logging into Gecko and see what's going on. What's really strange is that we have a whole bunch of Gecko tests which cover exactly this behaviour. |
|
@spectranaut, are you far enough along with Windows or Mac testing to know whether this flake shows up for Firefox on either of those platforms? That is, is this just a Linux flake at this stage or is that not conclusive yet? |
|
@jcsteh Yes actually it is far enough along to test on mac -- I just tried: I ran the blockquote test on mac with the polling for dom id removed (the mac code also polls for dom id) and with the firefox setting accessibility.enable_all_cache_domains on and off. With the setting off, it failed to find the dom id on the node 6 out of 200 runs. With the setting on, it failed to find the dom id on the node 1 out of 200 runs. So less flakey but still flakey in both cases! As for windows, I can also run the blockquote test there -- or thought I could. I can run it on windows against Chrome but it seems like wpt is failing (even other tests) when I tried to run against Firefox... It hangs when trying to start firefox using marionettedriver, I'm not sure why, didn't have that much time to figure it out. |
|
hi @jonathan-j-lee ! Could you take a look at this alternative test format for the same AAM tests? Some of the code is the same and that code includes your review feedback on the other PR (#53733) |
aamtest for accessibility API testing
Co-authored-by: Jonathan Lee <jonathan-j-lee@users.noreply.github.com>
3678cc1 to
f89b949
Compare
afac712 to
f89b949
Compare
This reverts commit f89b949.
|
I made issues for the unrelated CI failures:
And after talking to @jcsteh I opened issues for Firefox related to the flakes:
I sounds like it would be easier to debug these issues with Firefox after these tests land. |
This seems reasonable to me. It does seem like these issues might be more in Gecko code than the tests or harness. Either way, we can follow up with fixes, working together if necessary. |
This PR adds a new test type to test accessibility APIs exposed by browsers, as defined by the ARIA, Core-AAM and HTML-AAM specifications. The now merged RFC can be found here.
This is a replacement for: #53733
Instead of extending testharness, I added a new test type (
aamtest) that is similar towdspectests and uses a lot of the same infrastructure. This idea came from @foolip in this comment on the RFC, and I think it looks good!Here is a PR that adds documentation for this test type: #58632
To run tests on Linux:
On Debian distros:
apt install libatspi2.0-dev libcairo2-dev libgirepository1.0-devOn Mac:
Run chrome tests with
--no-headless. Safari does not yet support this test type.