-
Notifications
You must be signed in to change notification settings - Fork 168
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
Automated checks for accessibility rules and standards #12018
Comments
@LukasHirt Could you recommend/suggest at which level we should have the automated accessibility checks? |
How would it look like if it would be implemented as part of e2e tests? Would it go through every page one-by-one? Would that mean we need to handle setup of different scenarios to cover all the screens? Generally speaking I am a bit hesitant to have this as part of e2e tests. Having to spin up the whole setup to check a11y roles, etc. feels like an overkill. Since this feels more like a "linter" (please correct me if I am wrong here) it looks more to me like a test that should be run outside of playwright. Could you give me please some better understanding what's the difference in effort between these two approaches? I guess if you say that having this as part of e2e tests would be 10x faster to develop as POC than having it at the component level, I would say go for it. If the difference wouldn't be that drastic I would personally prefer trying the component level first. But that's my 2 cents. If you still believe that playwright for this is the way to go, I'm not going to block you. |
yeah exactly. e2e means accessing web via url, navigating to the page and do the accessibility checks. that means it tests the accessibility of integrated components. As far as I can tell, with the component level, effort wise, we probably need to add a lot tests as there are large number of components and there will involve mocking and tests with state changes. This can do the element-level isolated checks. But with e2e and since we already have working setup for e2e, we just have to implement one or two test steps and write an accessibility feature then run the test using the existing e2e test run command. Also, checking the whole page or certain part of the page would be closer to how/what the end users will experience. I would say, it would be easier to get started with e2e test because of the existing setup. But with the component level, we might get lost in the large volume of available components in different packages. 😅 |
I see. I misunderstood than how this would work. I was imagining something alongside of a scan of codebase and just checking whether the roles are applied in the code. Then yes, POC with e2e tests seems more reasonable to me as well. |
This is also valid but would be good to start with rendered html. |
We have implemented an accessibility test for the basic functionalities for file view (personal space, without sidebar) as an example/proof of concept for what aspects of accessibility can be tested in an automatic fashion using the axe-core plugin. Motivation for this is making sure that oCIS web is compliant with the WCAG accessibility standards in light of European Accessibility Act (EAA) being implemented in June 2025 Next steps
preliminary findings of usability issues issues with table view``` { id: 'button-name', impact: 'critical', tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ], description: 'Ensure buttons have discernible text', help: 'Buttons must have discernible text', helpUrl: 'https://dequeuniversity.com/rules/axe/4.10/button-name?application=playwright', nodes: [ { any: [Array], all: [], none: [], impact: 'critical', html: '', target: [Array], failureSummary: 'Fix any of the following:\n' + ' Element does not have inner text that is visible to screen readers\n' + ' aria-label attribute does not exist or is empty\n' + ' aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n' + ' Element has no title attribute\n' + ' Element does not have an implicit (wrapped) \n' + ' Element does not have an explicit \n' + ` Element's default semantics were not overridden with role="none" or role="presentation"` }, { any: [Array], all: [], none: [], impact: 'critical', html: '', target: [Array], failureSummary: 'Fix any of the following:\n' + ' Element does not have inner text that is visible to screen readers\n' + ' aria-label attribute does not exist or is empty\n' + ' aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n' + ' Element has no title attribute\n' + ' Element does not have an implicit (wrapped) \n' + ' Element does not have an explicit \n' + ` Element's default semantics were not overridden with role="none" or role="presentation"` } ] } { id: 'link-name', impact: 'serious', tags: [ 'cat.name-role-value', 'wcag2a', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.2.4.4', 'EN-9.4.1.2', 'ACT' ], description: 'Ensure links have discernible text', ✓ 2 …ec.ts:19:5 › Accessibility › personal space page › files section should not have any automatically detectable accessibility issues (2.8s) helpUrl: 'https://dequeuniversity.com/rules/axe/4.10/link-name?application=playwright', nodes: [ { any: [Array], all: [], none: [Array], impact: 'serious', html: '', target: [Array], failureSummary: 'Fix all of the following:\n' + ' Element is in tab order and does not have accessible text\n' + '\n' + 'Fix any of the following:\n' + ' Element does not have text that is visible to screen readers\n' + ' aria-label attribute does not exist or is empty\n' + ' aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n' + ' Element has no title attribute' } ] } ```issues with login``` { id: 'autocomplete-valid', impact: 'serious', tags: [ 'cat.forms', 'wcag21aa', 'wcag135', 'EN-301-549', 'EN-9.1.3.5', 'ACT' ], description: 'Ensure the autocomplete attribute is correct and suitable for the form field', help: 'autocomplete attribute must be used correctly', helpUrl: 'https://dequeuniversity.com/rules/axe/4.10/autocomplete-valid?application=playwright', nodes: [ { any: [], all: [Array], none: [], impact: 'serious', html: '', target: [Array], failureSummary: 'Fix all of the following:\n' + ' the autocomplete attribute is incorrectly formatted' }, { any: [], all: [Array], none: [], impact: 'serious', html: '', target: [Array], failureSummary: 'Fix all of the following:\n' + ' the autocomplete attribute is incorrectly formatted' } ] } ```issue with share side panel``` { id: 'color-contrast', impact: 'serious', tags: [ 'cat.color', 'wcag2aa', 'wcag143', 'TTv5', 'TT13.c', 'EN-301-549', 'EN-9.1.4.3', 'ACT' ], description: 'Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds', help: 'Elements must meet minimum color contrast ratio thresholds', helpUrl: 'https://dequeuniversity.com/rules/axe/4.10/color-contrast?application=playwright', nodes: [ { any: [Array], all: [], none: [], impact: 'serious', html: 'Add link', target: [Array], failureSummary: 'Fix any of the following:\n' + ' Element has insufficient color contrast of 4.19 (foreground color: #4a76ac, background color: #edf3fa, font size: 10.5pt (14px), font weight: normal). Expected contrast ratio of 4.5:1' } ] } ```issue with breadcrumbs``` { id: 'aria-hidden-focus', impact: 'serious', tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2' ], description: 'Ensure aria-hidden elements are not focusable nor contain focusable elements', help: 'ARIA hidden element must not be focusable or contain focusable elements', helpUrl: 'https://dequeuniversity.com/rules/axe/4.10/aria-hidden-focus?application=playwright', nodes: [ { any: [], all: [Array], none: [], impact: 'serious', html: ' |
Automated Checks for Accessibility Rules
Accessibility issues like these (but not all) could have an automated checks:
+
accessibility standard rules violationsWhy automate?
Why not depend on automated tests ONLY?
Available Tools
Manual
Automation
POC
@axe-core/playwright
axe-core
Reports
Automated (axe-core):
Proposal
Add automated accessibility checks:
The text was updated successfully, but these errors were encountered: