diff --git a/package-lock.json b/package-lock.json index 50866b1..7769c0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,12 +8,27 @@ "name": "race-official-playwright", "version": "1.0.0", "license": "ISC", + "dependencies": { + "@axe-core/playwright": "^4.9.1" + }, "devDependencies": { "@playwright/test": "^1.45.1", "@types/node": "^20.14.10", "globals": "^15.8.0" } }, + "node_modules/@axe-core/playwright": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@axe-core/playwright/-/playwright-4.9.1.tgz", + "integrity": "sha512-8m4WZbZq7/aq7ZY5IG8GqV+ZdvtGn/iJdom+wBg+iv/3BAOBIfNQtIu697a41438DzEEyptXWmC3Xl5Kx/o9/g==", + "license": "MPL-2.0", + "dependencies": { + "axe-core": "~4.9.1" + }, + "peerDependencies": { + "playwright-core": ">= 1.0.0" + } + }, "node_modules/@playwright/test": { "version": "1.45.1", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.1.tgz", @@ -40,6 +55,15 @@ "undici-types": "~5.26.4" } }, + "node_modules/axe-core": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.9.1.tgz", + "integrity": "sha512-QbUdXJVTpvUTHU7871ppZkdOLBeGUKBQWHkHrvN2V9IQWGMt61zf3B45BtzjxEJzYuj0JBjBZP/hmYS/R9pmAw==", + "license": "MPL-2.0", + "engines": { + "node": ">=4" + } + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -91,7 +115,6 @@ "version": "1.45.1", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", - "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index 0f4e1c5..8ddce5c 100644 --- a/package.json +++ b/package.json @@ -11,5 +11,8 @@ "@playwright/test": "^1.45.1", "@types/node": "^20.14.10", "globals": "^15.8.0" + }, + "dependencies": { + "@axe-core/playwright": "^4.9.1" } } diff --git a/specs/accessibility.spec.ts b/specs/accessibility.spec.ts new file mode 100644 index 0000000..1aaed42 --- /dev/null +++ b/specs/accessibility.spec.ts @@ -0,0 +1,12 @@ +import { test, expect } from '../fixtures/base'; +import AxeBuilder from '@axe-core/playwright'; + +test.describe('Accessibility Testing', () => { + test.fail('Accessibility issues - needs development work', async ({ homePage, page }) => { + const accessibilityScanResults = await new AxeBuilder({ page }) + .disableRules(['color-contrast']) + .analyze(); + + expect(accessibilityScanResults.violations).toEqual([]); // 5 + }); +});