You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup new Playwright a11y tests and add a11y reporter.
Accessibility checks are added into existing E2E tests.
Docs are added to explain the new accessibility tests.
Accessibility is a crucial aspect of web development. It ensures that web applications are usable by everyone, including people with disabilities.
15
+
16
+
## What Tools We Use
17
+
18
+
### eslint-plugin-vuejs-accessibility
19
+
20
+
We use [eslint-plugin-vuejs-accessibility](https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility) to quickly catch accessibility issues in the codebase. This plugin is used in the [@ownclouders/eslint-config](https://www.npmjs.com/package/@ownclouders/eslint-config).
21
+
22
+
### @axe-core/playwright
23
+
24
+
We use [@axe-core/playwright](https://github.com/dequelabs/axe-core-npm) to automatically test the accessibility of the ownCloud Web client. All tests are run automatically on every PR and on commits to the `master` branch. We are not running dedicated accessibility tests and instead make them part of the E2E tests. This way we do not have to maintain duplicate tests and we can granularly add accessibility tests to the specific steps of the tests. The tests are considered failed if any `serious` or `critical` accessibility violations are found.
25
+
26
+
#### Running Accessibility Tests
27
+
28
+
To run the accessibility tests, you can simply run our existing E2E tests using the following command:
29
+
30
+
```bash
31
+
pnpm test:e2e:cucumber
32
+
```
33
+
34
+
#### Skipping Accessibility Tests Locally
35
+
36
+
If you want to skip the accessibility tests, you can add the `SKIP_A11Y_TESTS` environment variable to your command.
37
+
38
+
```bash
39
+
SKIP_A11Y_TESTS=true pnpm test:e2e:cucumber
40
+
```
41
+
42
+
#### Skipping Accessibility Tests in CI
43
+
44
+
If you want to skip the accessibility tests in CI, you can add the `[skip-a11y]` flag into the title of the PR.
45
+
46
+
#### Accessibility Report
47
+
48
+
After the tests are run, a JSON accessibility report is generated in the `reports/e2e/a11y-report.json` file. This report contains detailed information about the accessibility violations found in the tests.
0 commit comments