Skip to content

chore: integrate cypress-axe for accessibility testing #11128

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 7 commits into from
Mar 26, 2025
Merged

Conversation

nnaydenow
Copy link
Contributor

@nnaydenow nnaydenow commented Mar 18, 2025

Note: These changes are intended for use within the monorepo only

These changes are integrating the cypress-axe plugin to enable accessibility testing within the UI5 webcomponents project. As part of the integration, a new CYPRESS_UI5_ACC environment has been added to control the execution of accessibility tests. When set to true, it allows generating an accessibility report otherwise, the tests are skipped.

Additionally, a new global function, ui5AccDescribe, has been introduced for test files. This function acts as a wrapper around the standard describe function, accepting the same parameters. Internally, it determines whether to run or skip tests based on the CYPRESS_UI5_ACC value. The wrapper also injects the necessary axe-core tool and includes the ui5CheckA11y command, which is used for accessibility validation.

Note: If CYPRESS_UI5_ACC is set, only accessibility tests will run

Furthermore, the ui5CheckA11y command has been added to execute axe on mounted content.

Related to: #11128

@nnaydenow nnaydenow changed the title chore: integrate cypress-axe plugin chore: integrate cypress-axe for accessibility testing Mar 19, 2025
@nnaydenow nnaydenow merged commit 2978ad1 into main Mar 26, 2025
12 checks passed
@nnaydenow nnaydenow deleted the cypress-axe branch March 26, 2025 08:50
nnaydenow added a commit that referenced this pull request Apr 1, 2025
…of tools (#11195)

Previously, the Cypress code coverage plugin was used even when a coverage report was not required. Additionally, Cypress accessibility testing (introduced in #11128) is intended to run only when a report is needed and requires an environment variable. This PR introduces new internal flags in the `package-script.cjs` file of each component package, simplifying the process of setting the required environment variables when these features need to be enabled.
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants