An automated testing and auditing engine combining Playwright, Axe-core, and AWS Bedrock AI to find accessibility violations and provide live GOV.UK Design System (GDS) compliant fixes.
- Intelligent Auto-Fill: Traverses complex GOV.UK forms using domain-aware logic to reach deep-link pages.
- Live GDS Scraper: Dynamically pulls the latest guidance from the GOV.UK Design System to ensure recommendations are always up-to-date.
- AI Resolution Engine: Uses AWS Bedrock (Nova lite) to analyze technical Axe violations and rewrite failing HTML into GDS-compliant code.
- Cumulative Auditing: Scans multiple pages across a session and merges them into a single, high-fidelity HTML report.
- Actionable Fixes: Provides "Download Fix Snippet" buttons for developers to immediately test corrected HTML.
The framework is divided into four logical layers:
-
Execution Layer (
AXEScanner)- Leverages Playwright to navigate the service and Axe-core to perform technical audits.
- State Management: Accumulates violations and screenshots in static concurrent maps.
- Screenshot Mapping: Captures one full-page screenshot per URL for visual evidence.
-
Context Layer (
GovUkScraper)- JSoup-based engine scrapes GDS Style and Component pages, providing "Ground Truth" context to prevent AI hallucinations.
-
Intelligence Layer (
BedrockAgentAnalyser)- Bridges technical errors and human-readable guidance.
- Processes violations in batches for AI accuracy and robust API communication.
-
Presentation Layer (
HtmlReportGenerator)- Generates standalone, interactive HTML reports.
- Fixes sourced via AI → Static Knowledge Base → Hardcoded GDS Fallbacks.
- Visual Audit: Impact-coded badges and modal screenshot viewers.
- Java 21+ (see
pom.xmlfor version) - Maven
- AWS credentials (configured for Bedrock access)
- Playwright browsers (run:
mvn playwright:install)
Ensure the following are in your pom.xml:
com.deque.html.axe-core:playwrightorg.jsoup:jsouporg.json:jsonorg.slf4j:slf4j-simple(logging)software.amazon.awssdk:bedrockagentruntime(Bedrock integration)com.microsoft.playwright:playwrightorg.apache.logging.log4j:log4j-coreandlog4j-apicom.fasterxml.jackson.core:jackson-databindandjackson-datatype-jsr310org.apache.commons:commons-lang3org.junit.jupiter:junit-jupiter-apiandjunit-jupiter-engine
Add the scanner to your Playwright test suite:
@Test
void accessibilityAudit() {
page.navigate("https://your-gov-service.gov.uk");
AXEScanner.scan(page); // Repeat across multiple pages
}
@AfterAll
static void tearDown() {
AXEScanner.generateFinalReport(); // Generates the cumulative AI report
}Pass standards via system properties:
-Dstandards.scan=wcag22aa,best-practice
Reports are generated in:
target/reports/accessibility-audit-[timestamp].htmlScreenshots are stored in:target/reports/screenshots/
- Ensure AWS credentials are set up for Bedrock access.
- Run
mvn playwright:installif browsers are missing. - Check
target/surefire-reports/for test logs.
See LICENSE file for details.