From de9c4a100e83bd0cfc83a40ed30467320e5afc23 Mon Sep 17 00:00:00 2001 From: Cypress <9101728+cy-by@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:23:53 -0600 Subject: [PATCH] Add best-practice axe rule set (#12017) --- tests/cypress/support/accessibility.js | 2 +- tests/playwright/utils/a11y.ts | 2 +- tests/playwright/utils/pageObjects/base.page.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cypress/support/accessibility.js b/tests/cypress/support/accessibility.js index 9feffd664..d86259051 100644 --- a/tests/cypress/support/accessibility.js +++ b/tests/cypress/support/accessibility.js @@ -23,7 +23,7 @@ Cypress.Commands.add("runAccessibilityTests", () => { cy.checkA11y( null, { - values: ["wcag2a", "wcag2aa"], + values: ["wcag2a", "wcag2aa", "best-practice"], includedImpacts: ["minor", "moderate", "serious", "critical"], rules: { "duplicate-id": { enabled: false }, diff --git a/tests/playwright/utils/a11y.ts b/tests/playwright/utils/a11y.ts index 73201ca57..97f55b24b 100644 --- a/tests/playwright/utils/a11y.ts +++ b/tests/playwright/utils/a11y.ts @@ -14,7 +14,7 @@ export async function e2eA11y(page: Page, url: string) { for (const size of Object.values(breakpoints)) { page.setViewportSize({ width: size[0], height: size[1] }); const results = await new AxeBuilder({ page }) - .withTags(["wcag2a", "wcag2aa"]) + .withTags(["wcag2a", "wcag2aa", "best-practice"]) .disableRules(["duplicate-id"]) .analyze(); expect(results.violations).toEqual([]); diff --git a/tests/playwright/utils/pageObjects/base.page.ts b/tests/playwright/utils/pageObjects/base.page.ts index 3eb6c0aa5..d9e58641e 100644 --- a/tests/playwright/utils/pageObjects/base.page.ts +++ b/tests/playwright/utils/pageObjects/base.page.ts @@ -88,7 +88,7 @@ export default class BasePage { for (const size of Object.values(breakpoints)) { this.page.setViewportSize({ width: size[0], height: size[1] }); const results = await new AxeBuilder({ page: this.page }) - .withTags(["wcag2a", "wcag2aa"]) + .withTags(["wcag2a", "wcag2aa", "best-practice"]) .disableRules(["duplicate-id"]) .analyze(); expect(results.violations).toEqual([]);