Testing
AuraScore 77/100

Civic Portal Automated Accessibility Test Suite Generator

Generate a Playwright and Axe automated accessibility test suite tailored to public sector digital citizen services.

Use this template when preparing automated compliance gates for public agency portals undergoing Section 508 or WCAG audits. It produces a production-ready, CI/CD-compatible browser automation test script that scans critical citizen user flows.

Template

Role: Principal Accessibility Automation Engineer with 12+ years of experience auditing public sector web services.

Context

  • Public Agency: {{civic_agency_name}}
  • Portal Target: {{portal_url}}
  • Compliance Baseline: {{wcag_conformance_level}}
  • Critical Citizen Journeys: {{target_user_journeys}}
  • Viewport Matrix: {{scan_viewport_presets}}
  • Alert Endpoint: {{reporting_webhook_url}}

Task

Author a production-ready Playwright and Axe-core automated test script that scans public digital services for WCAG regressions, logs violations with exact DOM selectors, and broadcasts compliance payloads to team channels.

Method

  1. Parse the {{scan_viewport_presets}} to configure responsive execution contexts for desktop, tablet, and mobile assistive interfaces.
  2. Establish automated browser sessions targeting {{portal_url}} with custom headers representing diverse civic user devices.
  3. Script step-by-step navigation across all {{target_user_journeys}}, ensuring focus state persistence through form inputs and dynamic modals.
  4. Inject the Axe accessibility engine at each navigation milestone configured strictly against {{wcag_conformance_level}} rulesets.
  5. Filter out third-party analytics noise while capturing critical impact violations with precise CSS selectors and remediation guidance.
  6. Aggregate accessibility violations into a structured JSON payload detailing element path, failure summary, and impact severity.
  7. Implement error handling and webhook dispatch to {{reporting_webhook_url}} for automated pipeline failure alerts under {{civic_agency_name}} monitoring.

Constraints

  • The script MUST execute headless in CI/CD without manual user interaction.
  • The test suite MUST fail the build pipeline if any critical or serious {{wcag_conformance_level}} violation is detected.
  • Do not hardcode authentication credentials directly in the script body.
  • Provide inline comments explaining assistive technology implications for every assertion.

Output format

A standalone executable TypeScript/Playwright test script containing:

  1. Configuration block and imports.
  2. Main end-to-end test runner iterating over journeys and viewports.
  3. Custom Axe scan helper function.
  4. Webhook notification dispatcher.

Self-review

  • Confirm Axe tags strictly match the requested {{wcag_conformance_level}}.
  • Verify all DOM navigation steps in {{target_user_journeys}} handle async state changes cleanly.
  • Ensure script contains zero mock external dependencies outside Playwright and Axe-core.
AuraScore breakdown
77/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering8/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-testing
public-sector-nonprofit
accessibility
playwright
wcag