Skip to content

Commit

Permalink
Exclude phase banner from axe tests
Browse files Browse the repository at this point in the history
Per UKGovernmentBEIS/regulated-professions-register@33be548
this fails axe tests because of the rule "All page content must be
contained by landmarks"

It's unclear how the rules that were violated were identified in that PR,
since it doesn't appear to add any logging of these. Here we've added
the logging, and when running the tests in the Cypress UI, we can see
that clicking on the error highlights the phase banner

Again according to that PR, the violation is due to the banner being
outside `<header>` and `<main>` elements. Apparently this is a [known
issue][1] with the component, but as the region rule is not a
requirement for WCAG, it should be okay to ignore for now

[1]: alphagov/govuk-frontend#1604
  • Loading branch information
yndajas committed Jul 19, 2023
1 parent a97b859 commit 39ca7f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integration_tests/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ const logAccessibilityViolations = (violations: Result[]) => {
Cypress.Commands.add('visitAndCheckAccessibility', (url: string) => {
cy.visit(url)
cy.injectAxe()
cy.checkA11y(undefined, undefined, logAccessibilityViolations)
cy.checkA11y({ exclude: [['.govuk-phase-banner']] }, undefined, logAccessibilityViolations)
})

0 comments on commit 39ca7f0

Please sign in to comment.