Skip to content

Commit

Permalink
Update guidance & include target-size check
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-horton-ho-sas committed Dec 27, 2023
1 parent 020a31f commit 013b303
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
18 changes: 14 additions & 4 deletions cypress/e2e/a11y.spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ import {testing_params} from "../support/testing_params";

import pages from "../../_site/search.json"

const axeConfig = {
// There are occasional contrast false-positives if the page isn't fully loaded
retries: 1,
interval: 100,
// WCAG 2.2 isn't included by default - only the target size check is automated by axe
rules: {
'target-size': { enabled: true },
},
}

function terminalLog(violations) {
const totalNodes = violations.reduce((acc, v) => acc + v.nodes.length, 0);

Expand Down Expand Up @@ -31,7 +41,7 @@ describe('All pages pass axe-core accessibility checks', () => {
it(`${page.title} (${page.url}) is accessible`, () => {
cy.visit(testing_params.TEST_ROOT_URL + page.url)
cy.injectAxe()
cy.checkA11y({exclude: '[data-axe-exclude]'}, null, terminalLog);
cy.checkA11y({exclude: '[data-axe-exclude]'}, axeConfig, terminalLog);
})

titles[page.title] = [
Expand Down Expand Up @@ -69,16 +79,16 @@ describe('Tag pages pass axe-core accessibility checks', () => {
cy.contains('Minimal documentation set for a product').click()
cy.get('.tags').contains('Documentation').click()
cy.injectAxe()
cy.checkA11y({exclude: '[data-axe-exclude]'}, null, terminalLog);
cy.checkA11y({exclude: '[data-axe-exclude]'}, axeConfig, terminalLog);
})

it('All tags is accessible', () => {
it('All tags page is accessible', () => {
cy.visit(testing_params.TEST_ROOT_URL)
cy.contains('Read our standards').click()
cy.contains('Minimal documentation set for a product').click()
cy.get('.tags').contains('Documentation').click()
cy.contains('all tags').click()
cy.injectAxe()
cy.checkA11y({exclude: '[data-axe-exclude]'}, null, terminalLog);
cy.checkA11y({exclude: '[data-axe-exclude]'}, axeConfig, terminalLog);
})
})
6 changes: 3 additions & 3 deletions docs/accessibility-statement.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The Home Office is committed to making its website accessible, in accordance wit

### Compliance status

This website is compliant with the [Web Content Accessibility Guidelines version 2.1](https://www.w3.org/TR/WCAG21/) AA standard.
This website is compliant with the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.

Contributions to the site are managed using the [engineering guidance and standards repository on GitHub](https://github.com/UKHomeOffice/engineering-guidance-and-standards). This is partially compliant as described in [GitHub's accessibility conformance report](https://accessibility.github.com/conformance/github-com/).

Expand All @@ -67,8 +67,8 @@ Contributing to the site using the [engineering guidance and standards repositor

## Preparation of this accessibility statement

- This statement was prepared and reviewed on 27th October 2023.
- This website was last tested on 28th September 2023. Testing was carried out internally by the Home Office.
- This statement was prepared and reviewed on 27th December 2023.
- This website was last tested on 27th December 2023. Testing was carried out internally by the Home Office.

We test this site as it develops by running automated accessibility tests provided by [`axe-core`](https://github.com/dequelabs/axe-core) on all changes, and by following a script of manual checks to perform when reviewing changes to the site. These are stored in GitHub:

Expand Down
7 changes: 4 additions & 3 deletions technical-docs/accessibility/layout-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ checked as part of the review process.

Then open up example pages that will be affected by your layout changes. For each:

- [ ] Tab through the focusable elements of the page. Is it clear what has focus, and does focus progress in a logical
order?
- [ ] Tab through the focusable elements of the page. Is it clear what has focus, is anything obscuring the focussed element, and does focus progress in a logical order?
- By default, on macOS tab navigation doesn't reach all links. You will need to turn on the keyboard navigation in Settings -> Keyboard to perform this step on a MacBook.
- [ ] The first item before the menu should be a link to skip to the main content, which is only visible when focussed. Check this navigates to the start of the page's main content.
- [ ] Are blocks of text left-aligned?
Expand All @@ -33,10 +32,12 @@ Then open up example pages that will be affected by your layout changes. For eac

## Assumptions

This checklist is a reduced list compared to the full WCAG v2.1 criteria. They have been chosen based on the assumptions:
This checklist is a reduced list compared to the full WCAG v2.2 criteria. They have been chosen based on the assumptions:

- That the engineering guidance and standards site will remain a static documentation site.
- That principles, standards, and patterns will be structured text, with some images and diagrams.
- That there are no interactive components on the site except the site search and hyperlinks.
- That there are no banners or modals that will cover other elements.
- The site does not require authentication, and there are no other forms that accept user input.

If these assumptions no longer hold, you should check the changes against the full criteria set. A copy of the current WCAG AA criteria can be found in the [Accessibility guidelines of the Home Office design system](https://design.homeoffice.gov.uk/accessibility/standard).

0 comments on commit 013b303

Please sign in to comment.