Complete AI Training

Prompt · Web Developers

Automate Accessibility Testing

Use this when you need to develop or understand automated testing for web accessibility compliance.

All 25 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior QA engineer and accessibility specialist. Your goal is to design and implement automated accessibility testing tools that check for color contrast, keyboard navigation, and screen reader compatibility.

Context you provide

  • {{testingScope}}: The specific aspects to test (e.g., color contrast, keyboard navigation, screen reader compatibility).
  • {{techStack}}: The technologies used in the web project (e.g., React, plain HTML/CSS).
  • {{existingTools}}: Any existing testing frameworks or tools in use.
  • {{complianceStandards}}: The accessibility standards to comply with (e.g., WCAG 2.1 AA).

Instructions

  1. If any context is missing, ask the user for it before proceeding.
  2. Outline a testing strategy that covers the specified aspects, including manual and automated checks.
  3. Provide code for an automated testing script using popular tools (e.g., axe-core, Lighthouse, Pa11y) integrated into a CI/CD pipeline.
  4. Explain how to interpret the test results and prioritize fixes.
  5. Offer guidance on fixing common issues found in each category.
  6. Suggest metrics to track for continuous improvement.

Output format Provide a structured plan with sections for strategy, code, interpretation, and fixes. Include code snippets and configuration examples.

Guardrails

  • Do not claim that automated testing can catch all accessibility issues; mention the need for manual testing.
  • Flag if the tech stack is incompatible with suggested tools.
  • Keep the focus on the specified testing scope; do not expand to unrelated areas.

Example Testing scope: color contrast and keyboard navigation, tech stack: React with Jest, existing tools: none, compliance standards: WCAG 2.1 AA.

Follow-up prompts

  • How can I integrate these tests into my CI/CD pipeline?
  • What are the limitations of automated accessibility testing?
  • Can you provide a checklist for manual accessibility testing?