-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Extend testdriver.js and wptrunner to test AAMs (platform accessibility APIs) #53733
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
I wonder if we can make the name |
Amazing, thanks @jcsteh! I didn't know about that Firefox option, I always used the gnome accessibility trick. I changed the CLI arg to |
762b8de
to
356e3c4
Compare
62fc8e5
to
b937113
Compare
5b98700
to
fbf3fdf
Compare
7c3363d
to
0f4b380
Compare
4c7afa8
to
d508e40
Compare
This reverts commit d508e40.
The failures are unrelated, see: #54302 |
Ready for review :) @gsnedders, @jgraham, @cookiecrook or @zcorpan, perhaps a couple of you could take a look? |
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.
Thanks!
|
||
:param dom_id: The dom id of the node to test. | ||
:param test: The test statement. | ||
:param api: The API to test. |
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.
api
is unused here; does it make sense to pass it? Or should we verify it's atspi here?
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.
So API is unused here, but it won't be unused in the "executorwindows.py" because there are two APIs on windows that need to be tested (although that is not yet implemented in windows, because the windows implementation is just stub). We need the function signatures of "test_accessibility_api" in all this executors in this folder to be the same: https://github.com/web-platform-tests/wpt/pull/53733/files#diff-4136e59af143c98357cb7a6153da10afc1fde0c16a657194efd31b1b4edd4f50
And you can see a few lines above the call to this function, we check "valid_api_for_platform"
tools/wptrunner/wptrunner/executors/executorplatformaccessibility.py
Outdated
Show resolved
Hide resolved
tools/wptrunner/wptrunner/executors/platformaccessibility/executoratspi.py
Outdated
Show resolved
Hide resolved
tab = find_tab(root, product, url) | ||
while not tab: | ||
time.sleep(0.01) | ||
tab = find_tab(root, product, url) | ||
|
||
return tab |
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.
We might want a timeout on this, no?
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.
Hmm... so far, I've been rely on the timeout within the wptrunner test infrastructure. Do you think we should have a separate (shorted I assume) timeout here?
tools/wptrunner/wptrunner/executors/platformaccessibility/executoratspi.py
Outdated
Show resolved
Hide resolved
tools/wptrunner/wptrunner/executors/platformaccessibility/executoratspi.py
Outdated
Show resolved
Hide resolved
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.
thanks @Ms2ger ! Fixed as you suggested, but I have two questions.
tools/wptrunner/wptrunner/executors/executorplatformaccessibility.py
Outdated
Show resolved
Hide resolved
tools/wptrunner/wptrunner/executors/platformaccessibility/executoratspi.py
Outdated
Show resolved
Hide resolved
|
||
:param dom_id: The dom id of the node to test. | ||
:param test: The test statement. | ||
:param api: The API to test. |
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.
So API is unused here, but it won't be unused in the "executorwindows.py" because there are two APIs on windows that need to be tested (although that is not yet implemented in windows, because the windows implementation is just stub). We need the function signatures of "test_accessibility_api" in all this executors in this folder to be the same: https://github.com/web-platform-tests/wpt/pull/53733/files#diff-4136e59af143c98357cb7a6153da10afc1fde0c16a657194efd31b1b4edd4f50
And you can see a few lines above the call to this function, we check "valid_api_for_platform"
tools/wptrunner/wptrunner/executors/platformaccessibility/executoratspi.py
Outdated
Show resolved
Hide resolved
tab = find_tab(root, product, url) | ||
while not tab: | ||
time.sleep(0.01) | ||
tab = find_tab(root, product, url) | ||
|
||
return tab |
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.
Hmm... so far, I've been rely on the timeout within the wptrunner test infrastructure. Do you think we should have a separate (shorted I assume) timeout here?
This PR adds an extension to
testdriver.js
in order to test accessibility API, as defined by the ARIA, Core-AAM and HTML-AAM specifications. The RFC to extendtestdriver.js
in this way can be found here. The decision to open a PR with these changes was made at TPAC 2024.The change in this CL:
--enable-accessibility-api
. So on regular runs of wpt.fyi, they will fail, for now, as you can see with:a. The option
--enable-accessibility-api
has been added. This option will install the appropriate python requirements for accessibility API tests and turn on accessibility for Firefox and Chromium browsers. If this option is not supplied, tests may fail withAccessibility API testing not enabled
. The primary reason for the flag is that on linux, there are system requirements for the python requirements, so./wpt run
will fail in environments where the system requirements are not installed. For now I think it's better to only run the tests intentionally/behind a flag.a. The product name ("chrome", "firefox", etc) is passed back to the executor level. This is necessary because accessibility APIs are exposed externally to the browser, and we need to find the browser in the accessibility API by name. Ideally, this will be done by PID (to allow for parallelization), but that requires some changes to chromedriver and safaridriver.
executorplatformaccessibility.py
andtools/wptrunner/wptrunner/executors/platformaccessibility
: these executors run tests against platform specific accessibility APIs, so there is an executor for Linux, Windows, and macOS. The Windows and macOS ones are proof of concepts and will need more work. The Linux one is fully featured and can run all of the tests added in this PR.To run tests on Linux:
On Debian distros:
apt install libatspi2.0-dev libcairo2-dev libgirepository1.0-dev
Notes about macOS and Windows
On Windows and macOS, even with the following dependencies, these tests will fail with the message "Fail: Test not implemented".
Thanks to @alice for the macOS code and thanks @jcsteh, the code to get IA2 interface was very inspired by the firefox test infrastructure: https://searchfox.org/mozilla-central/source/accessible/tests/browser/windows/a11y_setup.py
Running the tests on macOS
To run against Firefox, you need to turn on VoiceOver the screen reader.
To run against Chrome, you need to include --no-headless.