An automated testing and auditing engine combining Selenium or 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)- Uses either Playwright (
Page) or Selenium (WebDriver) to run Axe-core audits. - State Management: Accumulates violations and screenshots in static concurrent maps.
- Screenshot Mapping: Captures one full-page screenshot per URL for visual evidence.
- Uses either Playwright (
-
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 if using Playwright (run:
mvn playwright:install) - Browser drivers if using Selenium (managed automatically via WebDriverManager)
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
You can scan with either Playwright or Selenium. AXEScanner.scan(...) accepts both Page and WebDriver.
// Playwright example
@Test
void accessibilityAuditPlaywright() {
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
}// Selenium example
@Test
void accessibilityAuditSelenium() {
WebDriver driver = new ChromeDriver();
try {
driver.get("https://your-gov-service.gov.uk");
AXEScanner.scan(driver); // Repeat across multiple pages
} finally {
driver.quit();
}
}// Unified driver setup from this project
Object driver = DriverManager.init("playwright", "chrome"); // or ("selenium", "chrome")
AXEScanner.scan(driver);
DriverManager.quit();Pass standards via system properties:
-Dstandards.scan=wcag22aa,best-practice
Create src/test/resources/application.properties (or copy from src/main/resources/application.properties.dist) and set required values.
bedrock.region=your_region
bedrock.agent.id=YOUR_BEDROCK_AGENT_ID
bedrock.agent.alias.id=YOUR_BEDROCK_AGENT_ALIAS_ID
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.