Accessibility Testing
Introduced in GitLab 12.8.
If your application offers a web interface and you are using GitLab CI/CD, you can quickly determine the accessibility impact of pending code changes.
Overview
GitLab uses pa11y, a free and open source tool for
measuring the accessibility of web sites, and has built a simple
CI job template.
This job outputs accessibility violations, warnings, and notices for each page
analyzed to a file called accessibility
.
Configure Accessibility Testing
This example shows how to run pa11y on your code with GitLab CI/CD using the GitLab Accessibility Docker image.
For GitLab 12.9 and later, to define the a11y
job, you must
include the
Accessibility.gitlab-ci.yml
template
included with your GitLab installation, as shown below.
Add the following to your .gitlab-ci.yml
file:
stages:
- accessibility
variables:
a11y_urls: "https://about.gitlab.com https://gitlab.com/users/sign_in"
include:
- template: "Verify/Accessibility.gitlab-ci.yml"
creates an a11y
job in your CI/CD pipeline, runs
Pa11y against the webpages defined in a11y_urls
, and builds an HTML report for each.
The report for each URL is saved as an artifact that can be viewed directly in your browser.
A single accessibility.json
artifact is created and saved along with the individual HTML reports.
It includes report data for all URLs scanned.
include:remote
and use a
link to the current template in master
It is not yet possible to pass configurations into Pa11y via CI configuration. To change anything, copy the template to your CI file and make the desired edits.
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc