Automating EAA Compliance in CI/CD: Running Axe-Core & Keyboard Tests on Every PR
How to automate European Accessibility Act (EAA) compliance in CI/CD: running axe-core, keyboard navigation assertions, and WCAG 2.2 AA checks on every PR.
In European digital technology, June 28, 2025 marked a historic regulatory watershed: the full enforcement of the European Accessibility Act (EAA / Directive 2019/882) and its national member-state transpositions (such as Slovenia’s ZDPSI-A).
For e-commerce stores, consumer banking applications, travel platforms, and digital agencies building public-facing web solutions, web accessibility (WCAG 2.2 AA) is no longer a “nice-to-have” design consideration; it is a statutory legal requirement backed by regulatory inspection authorities.
Yet in traditional agency workflows, accessibility is typically treated as a panicked manual audit conducted three days before project launch:
- An external auditor runs a screen reader and flags 85 color contrast errors, 30 missing form labels, and severe keyboard focus traps in the navigation menu.
- Frontend developers spend two unbilled, chaotic weeks retrofitting ARIA attributes onto legacy components.
- Three months post-launch, a content editor adds a new promo banner without an
alttag, or a junior developer merges a broken modal component, instantly re-introducing legal liability.
True European digital compliance cannot rely on periodic manual audits. It demands Continuous Automated Accessibility Testing in CI/CD.
Below is our senior engineering guide: detailing how to wire @axe-core/playwright into GitHub Actions, author automated keyboard navigation assertions, and enforce a zero-regression accessibility gate on every Git pull request.
1. The Automation Reality: What Axe Catches vs. What Playwright Must Script
A common misconception among agency leaders is that running an automated axe-core scan guarantees 100% WCAG 2.2 AA compliance.
In reality, automated linters and static DOM scanners catch between 40% and 57% of total accessibility violations:
┌────────────────────────────────────────────────────────────────────────┐
│ WCAG 2.2 AA Automated Coverage Matrix │
├───────────────────────────────────┬────────────────────────────────────┤
│ Automated Axe-Core Scans (~50%) │ Scripted Playwright Tests (~50%) │
├───────────────────────────────────┼────────────────────────────────────┤
│ • Color contrast ratios (<4.5:1) │ • Keyboard tab order logical flow │
│ • Missing image alt attributes │ • Focus trap escape behavior │
│ • Form inputs without <label> │ • Visible focus indicators (:focus)│
│ • Duplicate HTML id attributes │ • Custom modal Escape key handling │
│ • Missing ARIA required children │ • Accordion keyboard expand/collaps│
│ • Empty buttons without labels │ • Screen reader announcement sync │
└───────────────────────────────────┴────────────────────────────────────┘
To achieve airtight EAA compliance, your CI/CD pipeline must combine axe-core static rule audits with Playwright interactive keyboard traversal tests.
2. Setting Up @axe-core/playwright in Astro and Next.js
Install the official Playwright accessibility integration:
npm install @axe-core/playwright @playwright/test --save-dev
Below is a production-tested Playwright test suite (tests/a11y.spec.ts) that crawls all critical page templates and enforces zero WCAG 2.2 AA violations:
// tests/a11y.spec.ts
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
const TEST_PAGES = [
'/',
'/white-label/',
'/automation/',
'/blog/',
'/blog/tailwind-v4-in-production/',
];
for (const path of TEST_PAGES) {
test(`a11y audit: page ${path} passes WCAG 2.2 AA rules`, async ({ page }) => {
await page.goto(path);
await page.waitForLoadState('networkidle');
// Run Axe scanning restricted strictly to WCAG 2.0, 2.1, and 2.2 AA standards
const accessibilityScanResults = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa'])
// Exclude third-party un-controlled iframes if necessary
.exclude('iframe[src*="youtube"]')
.analyze();
// Assert zero critical or serious violations
expect(accessibilityScanResults.violations).toEqual([]);
});
}
If a developer introduces a low-contrast button (text-gray-400 bg-gray-500) or removes a form label, the pull request immediately fails CI with exact file, line, and DOM selector coordinates.
3. Scripting Keyboard Navigation & Focus Trap Assertions
The European Accessibility Act places special emphasis on keyboard accessibility (Guideline 2.1). Every interactive element must be operable via Tab, Enter, Space, and Arrow keys, without getting trapped inside modals or dropdowns.
Below is a Playwright test script verifying keyboard drawer navigation and focus trapping on a mobile hamburger menu:
// tests/keyboard-nav.spec.ts
import { test, expect } from '@playwright/test';
test.describe('Keyboard Navigation & Focus Management', () => {
test('navigation modal traps focus and closes cleanly with Escape key', async ({ page }) => {
await page.goto('/');
const openButton = page.locator('#mobile-menu-open-button');
await openButton.focus();
await page.keyboard.press('Enter');
const drawer = page.locator('#mobile-nav-drawer');
await expect(drawer).toBeVisible();
// 1. Verify focus moved inside the drawer to the first interactive element
const firstLink = drawer.locator('a, button').first();
await expect(firstLink).toBeFocused();
// 2. Tab through all elements to ensure focus does not leak to background
const interactiveElements = await drawer.locator('a, button').all();
for (let i = 0; i < interactiveElements.length - 1; i++) {
await page.keyboard.press('Tab');
}
// Tabbing past the last element must loop back to the first element
await page.keyboard.press('Tab');
await expect(firstLink).toBeFocused();
// 3. Press Escape key to close modal
await page.keyboard.press('Escape');
await expect(drawer).toBeHidden();
// 4. Verify focus is restored to the original open button
await expect(openButton).toBeFocused();
});
});
4. Testing WCAG 2.2 New Success Criteria: Target Size and Focus Appearance
WCAG 2.2 introduced stricter standards that trip up legacy component libraries:
- Success Criterion 2.5.8 (Target Size - Minimum): All pointer interactive targets (buttons, links, icon toggles) must have a touch bounding box of at least 24x24 CSS pixels, or sufficient spacing around them.
- Success Criterion 2.4.11 (Focus Not Obscured - Minimum): When an element receives keyboard focus, it must not be completely hidden beneath sticky headers, floating cookie banners, or fixed footers.
- Success Criterion 2.4.13 (Focus Appearance): Focus indicators must have at least a 2px outline thickness and a 3:1 contrast ratio against both the element and the background.
Below is an automated Playwright assertion checking touch target dimensions across all interactive buttons on the page:
// tests/wcag-22-targets.spec.ts
import { test, expect } from '@playwright/test';
test('all clickable buttons and links meet WCAG 2.2 minimum 24x24px target size', async ({ page }) => {
await page.goto('/');
const clickables = await page.locator('button, a[href]').all();
for (const element of clickables) {
if (await element.isVisible()) {
const box = await element.boundingBox();
if (box) {
// Exclude inline text links that wrap inside paragraph text
const isInlineTextLink = await element.evaluate((el) => {
return window.getComputedStyle(el).display === 'inline';
});
if (!isInlineTextLink) {
expect(
box.width >= 24 && box.height >= 24,
`Element <${await element.evaluate(el => el.tagName.toLowerCase())}> ` +
`"${await element.innerText()}" has insufficient dimensions: ${box.width}x${box.height}px (Min: 24x24px)`
).toBe(true);
}
}
}
}
});
5. Accessibility Defect Severity Rubric for Agency Sprints
When CI flags an accessibility defect, engineering squads categorize the issue using this operational SLA rubric:
| Severity Level | WCAG Violation Example | EAA Legal Exposure | Sprint Resolution SLA |
|---|---|---|---|
| Blocker (P0) | Keyboard focus trapped inside checkout modal; unable to complete purchase | Immediate statutory complaint; site order takedown | Hotfix within 4 hours; blocks production deploy |
| Critical (P1) | Form submit button lacks accessible name (aria-label); invisible to screen readers |
High compliance risk; fails basic EAA inspection | Fix within current active sprint (24–48 hours) |
| Major (P2) | Interactive touch target smaller than 24x24px; mobile tap errors | Moderate compliance risk; flagged during audits | Scheduled in next sprint release |
| Minor (P3) | Low-priority decorative image missing empty alt="" tag |
Low legal risk; technical debt | Backlog cleanup |
6. GitHub Actions CI/CD Workflow: The Zero-Regression Gate
Wire the accessibility test suite into your GitHub pull request validation workflow:
# .github/workflows/accessibility-gate.yml
name: EAA & WCAG Accessibility Gate
on:
pull_request:
branches: [main]
jobs:
accessibility-audit:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Install Playwright Chromium Browser
run: npx playwright install --with-deps chromium
- name: Build Production Web App
run: npm run build
- name: Serve Web Application Locally
run: npx astro preview --port 4321 &
env:
PORT: 4321
- name: Wait for Local Server Ready
run: npx wait-on http://localhost:4321
- name: Run Axe & Keyboard Playwright Tests
run: npx playwright test tests/a11y.spec.ts tests/keyboard-nav.spec.ts
If an axe violation or focus management bug occurs, the PR is blocked from merging, completely shielding your agency and client from EAA regulatory exposure.
7. Summary: Accessibility by Design, Protected by Automation
Under the European Accessibility Act, digital accessibility is no longer a superficial marketing claim; it is a legally enforceable engineering standard.
By embedding:
- Automated
@axe-core/playwrightstatic scans on every pull request. - Scripted Playwright keyboard navigation and focus trap assertions.
- A zero-regression CI/CD merge gate.
Your engineering agency eliminates costly pre-launch remediation fire-drills, guarantees 100% compliance with EU Directive 2019/882, and delivers digital platforms that are genuinely welcoming, accessible, and legally protected for every user.
To explore related European compliance architectures and automated testing guides:
- Read our foundational guide The 2027 EU Digital Engineering Standard: EAA, GDPR & GEO.
- Master Slovenian regulatory enforcement in Slovenia ZDPSI-A & TIRS Compliance Guide.
- Review checkout accessibility fixes in EAA WCAG 2.2 E-Commerce Checkout Remediation.
Need to implement an automated EAA accessibility testing pipeline across your client projects? Contact our compliance engineering team to audit your frontend test workflows.
Frequently Asked Questions
How can digital agencies prevent accessibility regressions under the European Accessibility Act (EAA)?→
What percentage of WCAG 2.2 AA issues can be caught by automated axe-core scanning?→
What legal penalties do companies face for EAA non-compliance in the European Union?→
Scaling an agency? Offload your engineering bottlenecks.
Fonda Digital provides senior white-label full-stack development, headless migrations, and hardened WordPress builds under bilateral NDA. Predictable wholesale margins.