Skip to content
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

Testing: Enable all accessibility rules validation in e2e tests #15452

Closed
12 tasks
gziolo opened this issue May 6, 2019 · 1 comment
Closed
12 tasks

Testing: Enable all accessibility rules validation in e2e tests #15452

gziolo opened this issue May 6, 2019 · 1 comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Enhancement A suggestion for improvement.

Comments

@gziolo
Copy link
Member

gziolo commented May 6, 2019

All e2e tests have accessibility rules validation enabled by default as of #15018.

This PR enables Axe tests for every individual e2e test containing the block editor. They will run at the end of each test and perform static accessibility related analysis based on the DOM present in the test. It isn't perfect, but it should help to catch basic regressions moving forward.

We still need to enable the following rules:

  • aria-allowed-role
  • aria-hidden-focus
  • aria-input-field-name
  • aria-valid-attr-value
  • button-name
  • color-contrast
  • dlitem
  • duplicate-id
  • label
  • link-name
  • listitem
  • region

All rules are listed and explained in depth here:
https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md

There are ongoing efforts to fix issues reported as part Accessibility Audit which might resolve the majority of violations. See the related project: https://github.com/WordPress/gutenberg/projects/25.

To enable one of the listed rules, the following file should be updated:

disabledRules: [
'aria-allowed-role',
'aria-valid-attr-value',
'button-name',
'color-contrast',
'dlitem',
'duplicate-id',
'label',
'link-name',
'listitem',
'region',
],

In many cases, it might require additional work to ensure that violations are resolved. That's why I recommend opening 1 PR per rule.

@gziolo gziolo added [Type] Enhancement A suggestion for improvement. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. labels May 6, 2019
@gziolo gziolo added Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts labels Aug 12, 2019
@gziolo
Copy link
Member Author

gziolo commented Dec 27, 2020

It's no longer relevant after #26626. We are switching to running axe verification on demand.

@gziolo gziolo closed this as completed Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

1 participant