Integrate Accessibility Results API
Integrate Accessibility Results API
Improvement We aim to use the Accessibility Results API script as described. Still, we are concerned that setting up bespoke scripts for each team will create unnecessary maintenance overhead for the enablement teams.
Proposal Could this script be wrapped in a GitHub Action that accepts configuration inputs such as project key and rules that are allowed to fail? This would minimise maintenance effort, enable swift upgrade PRs for the action version, and allow teams to quickly manage which rules can fail in their repositories.
Bonus Points It would be ideal if the script’s output could be posted as a comment on the PR, highlighting failing rules or identifying rules that pass and could be removed from the configuration.
Thank you! 🙇
@gert-janvercauteren
The example workflow in the documentation section https://docs.cypress.io/accessibility/results-api#Example-Job-Workflow-Update on the page Accessibility > Results API that you reference does not use the action cypress-io/github-action (see below for a copy), so this would be a question / suggestion for the Cypress Cloud team.
I haven't seen any discussions on this in the Cypress technical community on Discord, which is where "how-to" implementation issues are often discussed. You can connect to the community on
https://docs.cypress.io/accessibility/results-api#Example-Job-Workflow-Update
name: My Workflow
on: push
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
jobs:
run-cypress:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: install
run: npm install
- name: Run
run: npx cypress run --record
+ - name: Verify Accessibility Results
+ run: |
+ npm install --force https://cdn.cypress.io/extract-cloud-results/v1/extract-cloud-results.tgz
+ node ./scripts/verifyAccessibilityResults.js
We'd be interested in exploring this, although it's unlikely out team can spend time implementing itself. I think the main thing would be settling on an API ahead of time. This 'allowed-failing-rules' feels a bit backwards in its wording, but just throwing out some idea to brainstorm. cc @marktnoonan
We have a
- name: Validate Accessibility Results
uses: cypress-io/github-action@v4
with:
project-key: ${{ secrets.CYPRESS_PROJECT_KEY }}
record-key: ${{ secrets.CYPRESS_RECORD_KEY }}
a11y-allowed-failing-rules: "rule1,rule2"
a11y-score-threshold: 85