agentic-qe 1.4.4 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/.claude/agents/qe-api-contract-validator.md +133 -27
  2. package/.claude/agents/qe-api-contract-validator.md.backup +1148 -0
  3. package/.claude/agents/qe-api-contract-validator.md.backup-20251107-134747 +1148 -0
  4. package/.claude/agents/qe-api-contract-validator.md.backup-phase2-20251107-140039 +1123 -0
  5. package/.claude/agents/qe-chaos-engineer.md +142 -23
  6. package/.claude/agents/qe-chaos-engineer.md.backup +808 -0
  7. package/.claude/agents/qe-chaos-engineer.md.backup-20251107-134747 +808 -0
  8. package/.claude/agents/qe-chaos-engineer.md.backup-phase2-20251107-140039 +787 -0
  9. package/.claude/agents/qe-code-complexity.md +111 -23
  10. package/.claude/agents/qe-code-complexity.md.backup +291 -0
  11. package/.claude/agents/qe-code-complexity.md.backup-20251107-134747 +291 -0
  12. package/.claude/agents/qe-code-complexity.md.backup-phase2-20251107-140039 +286 -0
  13. package/.claude/agents/qe-coverage-analyzer.md +306 -30
  14. package/.claude/agents/qe-coverage-analyzer.md.backup +467 -0
  15. package/.claude/agents/qe-coverage-analyzer.md.backup-20251107-134747 +467 -0
  16. package/.claude/agents/qe-coverage-analyzer.md.backup-phase2-20251107-140039 +438 -0
  17. package/.claude/agents/qe-deployment-readiness.md +84 -28
  18. package/.claude/agents/qe-deployment-readiness.md.backup +1166 -0
  19. package/.claude/agents/qe-deployment-readiness.md.backup-20251107-134747 +1166 -0
  20. package/.claude/agents/qe-deployment-readiness.md.backup-phase2-20251107-140039 +1140 -0
  21. package/.claude/agents/qe-flaky-test-hunter.md +277 -35
  22. package/.claude/agents/qe-flaky-test-hunter.md.backup +1195 -0
  23. package/.claude/agents/qe-flaky-test-hunter.md.backup-20251107-134747 +1195 -0
  24. package/.claude/agents/qe-flaky-test-hunter.md.backup-phase2-20251107-140039 +1162 -0
  25. package/.claude/agents/qe-fleet-commander.md +126 -23
  26. package/.claude/agents/qe-fleet-commander.md.backup +718 -0
  27. package/.claude/agents/qe-fleet-commander.md.backup-20251107-134747 +718 -0
  28. package/.claude/agents/qe-fleet-commander.md.backup-phase2-20251107-140039 +697 -0
  29. package/.claude/agents/qe-performance-tester.md +314 -57
  30. package/.claude/agents/qe-performance-tester.md.backup +428 -0
  31. package/.claude/agents/qe-performance-tester.md.backup-20251107-134747 +428 -0
  32. package/.claude/agents/qe-performance-tester.md.backup-phase2-20251107-140039 +372 -0
  33. package/.claude/agents/qe-production-intelligence.md +126 -27
  34. package/.claude/agents/qe-production-intelligence.md.backup +1219 -0
  35. package/.claude/agents/qe-production-intelligence.md.backup-20251107-134747 +1219 -0
  36. package/.claude/agents/qe-production-intelligence.md.backup-phase2-20251107-140039 +1194 -0
  37. package/.claude/agents/qe-quality-analyzer.md +127 -32
  38. package/.claude/agents/qe-quality-analyzer.md.backup +425 -0
  39. package/.claude/agents/qe-quality-analyzer.md.backup-20251107-134747 +425 -0
  40. package/.claude/agents/qe-quality-analyzer.md.backup-phase2-20251107-140039 +394 -0
  41. package/.claude/agents/qe-quality-gate.md +148 -33
  42. package/.claude/agents/qe-quality-gate.md.backup +446 -0
  43. package/.claude/agents/qe-quality-gate.md.backup-20251107-134747 +446 -0
  44. package/.claude/agents/qe-quality-gate.md.backup-phase2-20251107-140039 +415 -0
  45. package/.claude/agents/qe-regression-risk-analyzer.md +78 -27
  46. package/.claude/agents/qe-regression-risk-analyzer.md.backup +1009 -0
  47. package/.claude/agents/qe-regression-risk-analyzer.md.backup-20251107-134747 +1009 -0
  48. package/.claude/agents/qe-regression-risk-analyzer.md.backup-phase2-20251107-140039 +984 -0
  49. package/.claude/agents/qe-requirements-validator.md +131 -27
  50. package/.claude/agents/qe-requirements-validator.md.backup +748 -0
  51. package/.claude/agents/qe-requirements-validator.md.backup-20251107-134747 +748 -0
  52. package/.claude/agents/qe-requirements-validator.md.backup-phase2-20251107-140039 +723 -0
  53. package/.claude/agents/qe-security-scanner.md +137 -62
  54. package/.claude/agents/qe-security-scanner.md.backup +634 -0
  55. package/.claude/agents/qe-security-scanner.md.backup-20251107-134747 +634 -0
  56. package/.claude/agents/qe-security-scanner.md.backup-phase2-20251107-140039 +573 -0
  57. package/.claude/agents/qe-test-data-architect.md +129 -26
  58. package/.claude/agents/qe-test-data-architect.md.backup +1064 -0
  59. package/.claude/agents/qe-test-data-architect.md.backup-20251107-134747 +1064 -0
  60. package/.claude/agents/qe-test-data-architect.md.backup-phase2-20251107-140039 +1040 -0
  61. package/.claude/agents/qe-test-executor.md +165 -21
  62. package/.claude/agents/qe-test-executor.md.backup +389 -0
  63. package/.claude/agents/qe-test-executor.md.backup-20251107-134747 +389 -0
  64. package/.claude/agents/qe-test-executor.md.backup-phase2-20251107-140039 +369 -0
  65. package/.claude/agents/qe-test-generator.md +379 -34
  66. package/.claude/agents/qe-test-generator.md.backup +997 -0
  67. package/.claude/agents/qe-test-generator.md.backup-20251107-134747 +997 -0
  68. package/.claude/agents/qe-visual-tester.md +236 -23
  69. package/.claude/agents/qe-visual-tester.md.backup +777 -0
  70. package/.claude/agents/qe-visual-tester.md.backup-20251107-134747 +777 -0
  71. package/.claude/agents/qe-visual-tester.md.backup-phase2-20251107-140039 +756 -0
  72. package/.claude/agents/subagents/qe-code-reviewer.md +59 -0
  73. package/.claude/agents/subagents/qe-data-generator.md +60 -0
  74. package/.claude/agents/subagents/qe-integration-tester.md +77 -0
  75. package/.claude/agents/subagents/qe-performance-validator.md +55 -0
  76. package/.claude/agents/subagents/qe-security-auditor.md +51 -0
  77. package/.claude/agents/subagents/qe-test-implementer.md +371 -0
  78. package/.claude/agents/subagents/qe-test-refactorer.md +510 -0
  79. package/.claude/agents/subagents/qe-test-writer.md +603 -0
  80. package/.claude/skills/accessibility-testing/SKILL.md +764 -777
  81. package/.claude/skills/agentic-quality-engineering/SKILL.md +0 -6
  82. package/.claude/skills/api-testing-patterns/SKILL.md +0 -12
  83. package/.claude/skills/bug-reporting-excellence/SKILL.md +0 -6
  84. package/.claude/skills/chaos-engineering-resilience/SKILL.md +0 -6
  85. package/.claude/skills/code-review-quality/SKILL.md +0 -6
  86. package/.claude/skills/compatibility-testing/SKILL.md +0 -6
  87. package/.claude/skills/compliance-testing/SKILL.md +0 -6
  88. package/.claude/skills/consultancy-practices/SKILL.md +0 -6
  89. package/.claude/skills/context-driven-testing/SKILL.md +0 -6
  90. package/.claude/skills/contract-testing/SKILL.md +0 -6
  91. package/.claude/skills/database-testing/SKILL.md +0 -6
  92. package/.claude/skills/exploratory-testing-advanced/SKILL.md +0 -6
  93. package/.claude/skills/holistic-testing-pact/SKILL.md +0 -6
  94. package/.claude/skills/localization-testing/SKILL.md +0 -6
  95. package/.claude/skills/mobile-testing/SKILL.md +535 -548
  96. package/.claude/skills/mutation-testing/SKILL.md +0 -6
  97. package/.claude/skills/performance-testing/SKILL.md +0 -6
  98. package/.claude/skills/quality-metrics/SKILL.md +0 -12
  99. package/.claude/skills/refactoring-patterns/SKILL.md +0 -6
  100. package/.claude/skills/regression-testing/SKILL.md +1033 -1045
  101. package/.claude/skills/risk-based-testing/SKILL.md +0 -12
  102. package/.claude/skills/security-testing/SKILL.md +0 -6
  103. package/.claude/skills/shift-left-testing/SKILL.md +529 -535
  104. package/.claude/skills/shift-right-testing/SKILL.md +585 -591
  105. package/.claude/skills/tdd-london-chicago/SKILL.md +0 -6
  106. package/.claude/skills/technical-writing/SKILL.md +0 -6
  107. package/.claude/skills/test-automation-strategy/SKILL.md +0 -6
  108. package/.claude/skills/test-data-management/SKILL.md +1054 -1067
  109. package/.claude/skills/test-design-techniques/SKILL.md +0 -6
  110. package/.claude/skills/test-environment-management/SKILL.md +0 -6
  111. package/.claude/skills/test-reporting-analytics/SKILL.md +0 -6
  112. package/.claude/skills/visual-testing-advanced/SKILL.md +0 -6
  113. package/.claude/skills/xp-practices/SKILL.md +0 -6
  114. package/CHANGELOG.md +397 -5
  115. package/README.md +24 -19
  116. package/dist/cli/commands/init.d.ts +4 -0
  117. package/dist/cli/commands/init.d.ts.map +1 -1
  118. package/dist/cli/commands/init.js +97 -44
  119. package/dist/cli/commands/init.js.map +1 -1
  120. package/dist/mcp/handlers/coordination/index.d.ts +14 -14
  121. package/dist/mcp/handlers/coordination/index.d.ts.map +1 -1
  122. package/dist/mcp/handlers/coordination/index.js +14 -14
  123. package/dist/mcp/handlers/coordination/index.js.map +1 -1
  124. package/dist/mcp/handlers/phase2/Phase2Tools.d.ts.map +1 -1
  125. package/dist/mcp/handlers/phase2/Phase2Tools.js +39 -10
  126. package/dist/mcp/handlers/phase2/Phase2Tools.js.map +1 -1
  127. package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts +63 -0
  128. package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts.map +1 -0
  129. package/dist/mcp/handlers/phase3/Phase3DomainTools.js +885 -0
  130. package/dist/mcp/handlers/phase3/Phase3DomainTools.js.map +1 -0
  131. package/dist/mcp/handlers/phase3/index.d.ts +6 -0
  132. package/dist/mcp/handlers/phase3/index.d.ts.map +1 -0
  133. package/dist/mcp/handlers/phase3/index.js +10 -0
  134. package/dist/mcp/handlers/phase3/index.js.map +1 -0
  135. package/dist/mcp/handlers/prediction/index.d.ts +10 -10
  136. package/dist/mcp/handlers/prediction/index.d.ts.map +1 -1
  137. package/dist/mcp/handlers/prediction/index.js +10 -10
  138. package/dist/mcp/handlers/prediction/index.js.map +1 -1
  139. package/dist/mcp/handlers/security/check-authz.d.ts +152 -0
  140. package/dist/mcp/handlers/security/check-authz.d.ts.map +1 -0
  141. package/dist/mcp/handlers/security/check-authz.js +434 -0
  142. package/dist/mcp/handlers/security/check-authz.js.map +1 -0
  143. package/dist/mcp/handlers/security/generate-report.d.ts +156 -0
  144. package/dist/mcp/handlers/security/generate-report.d.ts.map +1 -0
  145. package/dist/mcp/handlers/security/generate-report.js +469 -0
  146. package/dist/mcp/handlers/security/generate-report.js.map +1 -0
  147. package/dist/mcp/handlers/security/index.d.ts +80 -0
  148. package/dist/mcp/handlers/security/index.d.ts.map +1 -0
  149. package/dist/mcp/handlers/security/index.js +91 -0
  150. package/dist/mcp/handlers/security/index.js.map +1 -0
  151. package/dist/mcp/handlers/security/scan-comprehensive.d.ts +66 -0
  152. package/dist/mcp/handlers/security/scan-comprehensive.d.ts.map +1 -0
  153. package/dist/mcp/handlers/security/scan-comprehensive.js +296 -0
  154. package/dist/mcp/handlers/security/scan-comprehensive.js.map +1 -0
  155. package/dist/mcp/handlers/security/scan-dependencies.d.ts +148 -0
  156. package/dist/mcp/handlers/security/scan-dependencies.d.ts.map +1 -0
  157. package/dist/mcp/handlers/security/scan-dependencies.js +354 -0
  158. package/dist/mcp/handlers/security/scan-dependencies.js.map +1 -0
  159. package/dist/mcp/handlers/security/validate-auth.d.ts +128 -0
  160. package/dist/mcp/handlers/security/validate-auth.d.ts.map +1 -0
  161. package/dist/mcp/handlers/security/validate-auth.js +294 -0
  162. package/dist/mcp/handlers/security/validate-auth.js.map +1 -0
  163. package/dist/mcp/handlers/test/generate-integration-tests.d.ts +95 -0
  164. package/dist/mcp/handlers/test/generate-integration-tests.d.ts.map +1 -0
  165. package/dist/mcp/handlers/test/generate-integration-tests.js +286 -0
  166. package/dist/mcp/handlers/test/generate-integration-tests.js.map +1 -0
  167. package/dist/mcp/handlers/test/generate-unit-tests.d.ts +89 -0
  168. package/dist/mcp/handlers/test/generate-unit-tests.d.ts.map +1 -0
  169. package/dist/mcp/handlers/test/generate-unit-tests.js +273 -0
  170. package/dist/mcp/handlers/test/generate-unit-tests.js.map +1 -0
  171. package/dist/mcp/handlers/test/optimize-test-suite.d.ts +97 -0
  172. package/dist/mcp/handlers/test/optimize-test-suite.d.ts.map +1 -0
  173. package/dist/mcp/handlers/test/optimize-test-suite.js +282 -0
  174. package/dist/mcp/handlers/test/optimize-test-suite.js.map +1 -0
  175. package/dist/mcp/server.d.ts.map +1 -1
  176. package/dist/mcp/server.js +211 -0
  177. package/dist/mcp/server.js.map +1 -1
  178. package/dist/mcp/tools/deprecated.d.ts +1390 -0
  179. package/dist/mcp/tools/deprecated.d.ts.map +1 -0
  180. package/dist/mcp/tools/deprecated.js +859 -0
  181. package/dist/mcp/tools/deprecated.js.map +1 -0
  182. package/dist/mcp/tools/qe/api-contract/index.d.ts +138 -0
  183. package/dist/mcp/tools/qe/api-contract/index.d.ts.map +1 -0
  184. package/dist/mcp/tools/qe/api-contract/index.js +572 -0
  185. package/dist/mcp/tools/qe/api-contract/index.js.map +1 -0
  186. package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts +110 -0
  187. package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts.map +1 -0
  188. package/dist/mcp/tools/qe/code-quality/analyze-complexity.js +381 -0
  189. package/dist/mcp/tools/qe/code-quality/analyze-complexity.js.map +1 -0
  190. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts +115 -0
  191. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts.map +1 -0
  192. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js +461 -0
  193. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js.map +1 -0
  194. package/dist/mcp/tools/qe/code-quality/index.d.ts +12 -0
  195. package/dist/mcp/tools/qe/code-quality/index.d.ts.map +1 -0
  196. package/dist/mcp/tools/qe/code-quality/index.js +30 -0
  197. package/dist/mcp/tools/qe/code-quality/index.js.map +1 -0
  198. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts +58 -0
  199. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts.map +1 -0
  200. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js +172 -0
  201. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js.map +1 -0
  202. package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts +73 -0
  203. package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts.map +1 -0
  204. package/dist/mcp/tools/qe/coverage/calculate-trends.js +240 -0
  205. package/dist/mcp/tools/qe/coverage/calculate-trends.js.map +1 -0
  206. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts +38 -0
  207. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts.map +1 -0
  208. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js +204 -0
  209. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js.map +1 -0
  210. package/dist/mcp/tools/qe/coverage/index.d.ts +12 -0
  211. package/dist/mcp/tools/qe/coverage/index.d.ts.map +1 -0
  212. package/dist/mcp/tools/qe/coverage/index.js +23 -0
  213. package/dist/mcp/tools/qe/coverage/index.js.map +1 -0
  214. package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts +46 -0
  215. package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts.map +1 -0
  216. package/dist/mcp/tools/qe/coverage/recommend-tests.js +248 -0
  217. package/dist/mcp/tools/qe/coverage/recommend-tests.js.map +1 -0
  218. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts +179 -0
  219. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts.map +1 -0
  220. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js +554 -0
  221. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js.map +1 -0
  222. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts +172 -0
  223. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts.map +1 -0
  224. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js +498 -0
  225. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js.map +1 -0
  226. package/dist/mcp/tools/qe/flaky-detection/index.d.ts +35 -0
  227. package/dist/mcp/tools/qe/flaky-detection/index.d.ts.map +1 -0
  228. package/dist/mcp/tools/qe/flaky-detection/index.js +66 -0
  229. package/dist/mcp/tools/qe/flaky-detection/index.js.map +1 -0
  230. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts +159 -0
  231. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts.map +1 -0
  232. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js +462 -0
  233. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js.map +1 -0
  234. package/dist/mcp/tools/qe/fleet/index.d.ts +422 -0
  235. package/dist/mcp/tools/qe/fleet/index.d.ts.map +1 -0
  236. package/dist/mcp/tools/qe/fleet/index.js +652 -0
  237. package/dist/mcp/tools/qe/fleet/index.js.map +1 -0
  238. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts +180 -0
  239. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts.map +1 -0
  240. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js +347 -0
  241. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js.map +1 -0
  242. package/dist/mcp/tools/qe/performance/generate-report.d.ts +146 -0
  243. package/dist/mcp/tools/qe/performance/generate-report.d.ts.map +1 -0
  244. package/dist/mcp/tools/qe/performance/generate-report.js +354 -0
  245. package/dist/mcp/tools/qe/performance/generate-report.js.map +1 -0
  246. package/dist/mcp/tools/qe/performance/index.d.ts +13 -0
  247. package/dist/mcp/tools/qe/performance/index.d.ts.map +1 -0
  248. package/dist/mcp/tools/qe/performance/index.js +24 -0
  249. package/dist/mcp/tools/qe/performance/index.js.map +1 -0
  250. package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts +120 -0
  251. package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts.map +1 -0
  252. package/dist/mcp/tools/qe/performance/monitor-realtime.js +215 -0
  253. package/dist/mcp/tools/qe/performance/monitor-realtime.js.map +1 -0
  254. package/dist/mcp/tools/qe/performance/run-benchmark.d.ts +68 -0
  255. package/dist/mcp/tools/qe/performance/run-benchmark.d.ts.map +1 -0
  256. package/dist/mcp/tools/qe/performance/run-benchmark.js +120 -0
  257. package/dist/mcp/tools/qe/performance/run-benchmark.js.map +1 -0
  258. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts +239 -0
  259. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts.map +1 -0
  260. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js +671 -0
  261. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js.map +1 -0
  262. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts +219 -0
  263. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts.map +1 -0
  264. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js +732 -0
  265. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js.map +1 -0
  266. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts +447 -0
  267. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts.map +1 -0
  268. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js +551 -0
  269. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js.map +1 -0
  270. package/dist/mcp/tools/qe/quality-gates/index.d.ts +40 -0
  271. package/dist/mcp/tools/qe/quality-gates/index.d.ts.map +1 -0
  272. package/dist/mcp/tools/qe/quality-gates/index.js +56 -0
  273. package/dist/mcp/tools/qe/quality-gates/index.js.map +1 -0
  274. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts +226 -0
  275. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts.map +1 -0
  276. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js +603 -0
  277. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js.map +1 -0
  278. package/dist/mcp/tools/qe/regression/analyze-risk.d.ts +212 -0
  279. package/dist/mcp/tools/qe/regression/analyze-risk.d.ts.map +1 -0
  280. package/dist/mcp/tools/qe/regression/analyze-risk.js +617 -0
  281. package/dist/mcp/tools/qe/regression/analyze-risk.js.map +1 -0
  282. package/dist/mcp/tools/qe/regression/index.d.ts +36 -0
  283. package/dist/mcp/tools/qe/regression/index.d.ts.map +1 -0
  284. package/dist/mcp/tools/qe/regression/index.js +63 -0
  285. package/dist/mcp/tools/qe/regression/index.js.map +1 -0
  286. package/dist/mcp/tools/qe/regression/select-tests.d.ts +241 -0
  287. package/dist/mcp/tools/qe/regression/select-tests.d.ts.map +1 -0
  288. package/dist/mcp/tools/qe/regression/select-tests.js +601 -0
  289. package/dist/mcp/tools/qe/regression/select-tests.js.map +1 -0
  290. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts +134 -0
  291. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts.map +1 -0
  292. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js +737 -0
  293. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js.map +1 -0
  294. package/dist/mcp/tools/qe/requirements/index.d.ts +40 -0
  295. package/dist/mcp/tools/qe/requirements/index.d.ts.map +1 -0
  296. package/dist/mcp/tools/qe/requirements/index.js +84 -0
  297. package/dist/mcp/tools/qe/requirements/index.js.map +1 -0
  298. package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts +196 -0
  299. package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts.map +1 -0
  300. package/dist/mcp/tools/qe/requirements/validate-requirements.js +740 -0
  301. package/dist/mcp/tools/qe/requirements/validate-requirements.js.map +1 -0
  302. package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts +300 -0
  303. package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts.map +1 -0
  304. package/dist/mcp/tools/qe/security/detect-vulnerabilities.js +492 -0
  305. package/dist/mcp/tools/qe/security/detect-vulnerabilities.js.map +1 -0
  306. package/dist/mcp/tools/qe/security/index.d.ts +34 -0
  307. package/dist/mcp/tools/qe/security/index.d.ts.map +1 -0
  308. package/dist/mcp/tools/qe/security/index.js +44 -0
  309. package/dist/mcp/tools/qe/security/index.js.map +1 -0
  310. package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts +240 -0
  311. package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts.map +1 -0
  312. package/dist/mcp/tools/qe/security/scan-comprehensive.js +535 -0
  313. package/dist/mcp/tools/qe/security/scan-comprehensive.js.map +1 -0
  314. package/dist/mcp/tools/qe/security/validate-compliance.d.ts +299 -0
  315. package/dist/mcp/tools/qe/security/validate-compliance.d.ts.map +1 -0
  316. package/dist/mcp/tools/qe/security/validate-compliance.js +517 -0
  317. package/dist/mcp/tools/qe/security/validate-compliance.js.map +1 -0
  318. package/dist/mcp/tools/qe/shared/types.d.ts +840 -0
  319. package/dist/mcp/tools/qe/shared/types.d.ts.map +1 -0
  320. package/dist/mcp/tools/qe/shared/types.js +13 -0
  321. package/dist/mcp/tools/qe/shared/types.js.map +1 -0
  322. package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts +264 -0
  323. package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts.map +1 -0
  324. package/dist/mcp/tools/qe/test-data/analyze-schema.js +553 -0
  325. package/dist/mcp/tools/qe/test-data/analyze-schema.js.map +1 -0
  326. package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts +167 -0
  327. package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts.map +1 -0
  328. package/dist/mcp/tools/qe/test-data/generate-test-data.js +336 -0
  329. package/dist/mcp/tools/qe/test-data/generate-test-data.js.map +1 -0
  330. package/dist/mcp/tools/qe/test-data/index.d.ts +44 -0
  331. package/dist/mcp/tools/qe/test-data/index.d.ts.map +1 -0
  332. package/dist/mcp/tools/qe/test-data/index.js +90 -0
  333. package/dist/mcp/tools/qe/test-data/index.js.map +1 -0
  334. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts +165 -0
  335. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts.map +1 -0
  336. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js +342 -0
  337. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js.map +1 -0
  338. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts +144 -0
  339. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts.map +1 -0
  340. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js +432 -0
  341. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js.map +1 -0
  342. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts +98 -0
  343. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts.map +1 -0
  344. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js +459 -0
  345. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js.map +1 -0
  346. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts +83 -0
  347. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts.map +1 -0
  348. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js +483 -0
  349. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js.map +1 -0
  350. package/dist/mcp/tools/qe/test-generation/index.d.ts +56 -0
  351. package/dist/mcp/tools/qe/test-generation/index.d.ts.map +1 -0
  352. package/dist/mcp/tools/qe/test-generation/index.js +97 -0
  353. package/dist/mcp/tools/qe/test-generation/index.js.map +1 -0
  354. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts +124 -0
  355. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts.map +1 -0
  356. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js +362 -0
  357. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js.map +1 -0
  358. package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts +119 -0
  359. package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts.map +1 -0
  360. package/dist/mcp/tools/qe/visual/compare-screenshots.js +280 -0
  361. package/dist/mcp/tools/qe/visual/compare-screenshots.js.map +1 -0
  362. package/dist/mcp/tools/qe/visual/detect-regression.d.ts +138 -0
  363. package/dist/mcp/tools/qe/visual/detect-regression.d.ts.map +1 -0
  364. package/dist/mcp/tools/qe/visual/detect-regression.js +271 -0
  365. package/dist/mcp/tools/qe/visual/detect-regression.js.map +1 -0
  366. package/dist/mcp/tools/qe/visual/index.d.ts +16 -0
  367. package/dist/mcp/tools/qe/visual/index.d.ts.map +1 -0
  368. package/dist/mcp/tools/qe/visual/index.js +22 -0
  369. package/dist/mcp/tools/qe/visual/index.js.map +1 -0
  370. package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts +276 -0
  371. package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts.map +1 -0
  372. package/dist/mcp/tools/qe/visual/validate-accessibility.js +413 -0
  373. package/dist/mcp/tools/qe/visual/validate-accessibility.js.map +1 -0
  374. package/dist/mcp/tools.d.ts +44 -0
  375. package/dist/mcp/tools.d.ts.map +1 -1
  376. package/dist/mcp/tools.js +1980 -1
  377. package/dist/mcp/tools.js.map +1 -1
  378. package/package.json +2 -2
  379. package/dist/learning/__mocks__/LearningEngine.d.ts +0 -39
  380. package/dist/learning/__mocks__/LearningEngine.d.ts.map +0 -1
  381. package/dist/learning/__mocks__/LearningEngine.js +0 -116
  382. package/dist/learning/__mocks__/LearningEngine.js.map +0 -1
  383. package/dist/utils/__mocks__/Database.d.ts +0 -85
  384. package/dist/utils/__mocks__/Database.d.ts.map +0 -1
  385. package/dist/utils/__mocks__/Database.js +0 -125
  386. package/dist/utils/__mocks__/Database.js.map +0 -1
  387. package/dist/utils/__mocks__/Logger.d.ts +0 -26
  388. package/dist/utils/__mocks__/Logger.d.ts.map +0 -1
  389. package/dist/utils/__mocks__/Logger.js +0 -44
  390. package/dist/utils/__mocks__/Logger.js.map +0 -1
@@ -1,777 +1,764 @@
1
- ---
2
- name: accessibility-testing
3
- description: WCAG 2.2 compliance testing, screen reader validation, and inclusive design verification. Use when ensuring legal compliance (ADA, Section 508), testing for disabilities, or building accessible applications for 1 billion disabled users globally.
4
- version: 1.0.0
5
- category: specialized-testing
6
- tags:
7
- - accessibility
8
- - a11y
9
- - wcag
10
- - screen-readers
11
- - aria
12
- - inclusive-design
13
- - ada-compliance
14
- difficulty: intermediate
15
- estimated_time: 75-90 minutes
16
- author: agentic-qe
17
- ---
18
-
19
- # Accessibility Testing
20
-
21
- ## Core Principle
22
-
23
- **1 billion people have disabilities. Building inaccessible software excludes 15% of humanity.**
24
-
25
- Accessibility testing ensures software works for everyone, including people with visual, motor, cognitive, and hearing disabilities. It's not just ethical - it's legally required and expands your market by $13 trillion.
26
-
27
- ## What is Accessibility Testing?
28
-
29
- **Accessibility (a11y):** Ensuring people with disabilities can perceive, understand, navigate, and interact with software using assistive technologies.
30
-
31
- **Why Critical:**
32
- - **Legal:** ADA, Section 508, EU Directive 2016/2102 require accessibility
33
- - **Market:** $13T purchasing power of disabled community
34
- - **Litigation:** 250%+ increase in a11y lawsuits (2019-2024)
35
- - **Ethics:** Equal access is a fundamental right
36
- - **UX:** Accessible design benefits all users (curb-cut effect)
37
-
38
- **Goal:** WCAG 2.2 Level AA compliance + excellent user experience with assistive tech.
39
-
40
- ## WCAG 2.2 Compliance Levels
41
-
42
- ### Conformance Levels
43
-
44
- **Level A (Minimum)**
45
- - Basic accessibility
46
- - Addresses most critical barriers
47
- - **Requirement:** Legal minimum in many jurisdictions
48
-
49
- **Level AA (Standard)**
50
- - Addresses majority of barriers
51
- - **Requirement:** US federal government (Section 508)
52
- - **Recommendation:** Industry standard for most websites
53
-
54
- **Level AAA (Enhanced)**
55
- - Highest level of accessibility
56
- - Not required for full sites (some criteria impossible for all content)
57
- - **Use when:** Specialized accessibility-focused sites
58
-
59
- **Most Organizations Target:** WCAG 2.2 Level AA
60
-
61
- ---
62
-
63
- ## POUR Principles
64
-
65
- ### 1. Perceivable
66
- **Users must be able to perceive information**
67
-
68
- **Requirements:**
69
- - Text alternatives for non-text content
70
- - Captions for videos
71
- - Audio descriptions for video
72
- - Adaptable content (different presentations)
73
- - Distinguishable content (color contrast, text resize)
74
-
75
- **Example:**
76
- ```html
77
- <!-- ❌ BAD: Image without alt text -->
78
- <img src="product.jpg">
79
-
80
- <!-- ✅ GOOD: Descriptive alt text -->
81
- <img src="product.jpg" alt="Blue wireless headphones with noise cancellation">
82
-
83
- <!-- BAD: Color-only error indication -->
84
- <span style="color: red">Error</span>
85
-
86
- <!-- GOOD: Color + icon + text -->
87
- <span class="error" role="alert">
88
- <span aria-hidden="true">⚠️</span>
89
- Error: Invalid email format
90
- </span>
91
- ```
92
-
93
- ---
94
-
95
- ### 2. Operable
96
- **Users must be able to operate the interface**
97
-
98
- **Requirements:**
99
- - Keyboard accessible (no mouse required)
100
- - Enough time to read/use content
101
- - No content causing seizures (no flashing > 3x/sec)
102
- - Navigable (skip links, headings, focus order)
103
- - Input modalities (touch, voice, etc.)
104
-
105
- **Example:**
106
- ```html
107
- <!-- ❌ BAD: Mouse-only interaction -->
108
- <div onclick="submitForm()">Submit</div>
109
-
110
- <!-- ✅ GOOD: Keyboard accessible button -->
111
- <button type="submit" onclick="submitForm()">Submit</button>
112
-
113
- <!-- GOOD: Skip navigation link -->
114
- <a href="#main-content" class="skip-link">
115
- Skip to main content
116
- </a>
117
-
118
- <nav>...</nav>
119
-
120
- <main id="main-content">...</main>
121
- ```
122
-
123
- ---
124
-
125
- ### 3. Understandable
126
- **Information and operation must be understandable**
127
-
128
- **Requirements:**
129
- - Readable text (language identified, unusual words explained)
130
- - Predictable operation (consistent navigation)
131
- - Input assistance (error identification, labels, suggestions)
132
- - Compatible with assistive technologies
133
-
134
- **Example:**
135
- ```html
136
- <!-- ❌ BAD: Unclear error -->
137
- <span>Error</span>
138
-
139
- <!-- ✅ GOOD: Clear, actionable error -->
140
- <div role="alert" aria-live="assertive">
141
- <strong>Error:</strong> Password must be at least 8 characters,
142
- including one uppercase letter and one number.
143
- </div>
144
-
145
- <!-- ✅ GOOD: Form labels -->
146
- <label for="email">
147
- Email Address (required)
148
- </label>
149
- <input
150
- type="email"
151
- id="email"
152
- name="email"
153
- required
154
- aria-required="true"
155
- aria-describedby="email-help"
156
- >
157
- <span id="email-help">We'll never share your email.</span>
158
- ```
159
-
160
- ---
161
-
162
- ### 4. Robust
163
- **Content must work with current and future tools**
164
-
165
- **Requirements:**
166
- - Valid HTML/CSS
167
- - Name, role, value available to assistive tech
168
- - Status messages announced
169
- - Compatible with user agents and assistive tech
170
-
171
- **Example:**
172
- ```html
173
- <!-- GOOD: Custom component with ARIA -->
174
- <div
175
- role="button"
176
- tabindex="0"
177
- aria-pressed="false"
178
- onkeydown="handleKeyPress(event)"
179
- onclick="toggleButton()"
180
- >
181
- Toggle Feature
182
- </div>
183
-
184
- <!-- ✅ GOOD: Status message -->
185
- <div role="status" aria-live="polite" aria-atomic="true">
186
- 3 items added to cart
187
- </div>
188
- ```
189
-
190
- ---
191
-
192
- ## Manual Testing Techniques
193
-
194
- ### 1. Keyboard-Only Navigation
195
-
196
- **Test keyboard accessibility:**
197
- ```
198
- Tab → Move to next focusable element
199
- Shift+Tab Move to previous focusable element
200
- Enter → Activate links/buttons
201
- Space → Activate buttons, toggle checkboxes
202
- Arrow keys→ Navigate within components (menus, sliders)
203
- Esc → Close dialogs/menus
204
- ```
205
-
206
- **Checklist:**
207
- - [ ] All interactive elements reachable via keyboard
208
- - [ ] Visible focus indicator (outline/highlight)
209
- - [ ] Logical tab order (follows visual layout)
210
- - [ ] No keyboard traps (can navigate away)
211
- - [ ] Skip navigation link present
212
- - [ ] Keyboard shortcuts documented
213
-
214
- **Common Issues:**
215
- ```html
216
- <!-- ❌ BAD: Custom div without keyboard support -->
217
- <div onclick="openModal()">Open</div>
218
-
219
- <!-- ✅ GOOD: Button with keyboard support -->
220
- <button onclick="openModal()">Open</button>
221
-
222
- <!-- GOOD: Custom element with keyboard -->
223
- <div
224
- role="button"
225
- tabindex="0"
226
- onclick="openModal()"
227
- onkeydown="if(event.key==='Enter') openModal()"
228
- >
229
- Open
230
- </div>
231
- ```
232
-
233
- ---
234
-
235
- ### 2. Screen Reader Testing
236
-
237
- **Major Screen Readers:**
238
- - **JAWS** (Windows) - Most popular, commercial
239
- - **NVDA** (Windows) - Free, open-source
240
- - **VoiceOver** (macOS/iOS) - Built-in to Apple devices
241
- - **TalkBack** (Android) - Built-in to Android
242
- - **Narrator** (Windows) - Built-in to Windows
243
-
244
- **VoiceOver Basics (macOS):**
245
- ```
246
- Cmd+F5 → Toggle VoiceOver
247
- VO+Right/Left → Navigate elements (VO = Ctrl+Option)
248
- VO+Shift+Down → Interact with element
249
- VO+Space → Activate element
250
- VO+A → Read from top
251
- VO+U → Rotor (headings, links, landmarks)
252
- ```
253
-
254
- **Screen Reader Checklist:**
255
- - [ ] All images have alt text (or alt="" for decorative)
256
- - [ ] Headings announce correctly (h1, h2, etc.)
257
- - [ ] Form labels associated with inputs
258
- - [ ] Links have descriptive text (not "click here")
259
- - [ ] Dynamic content announced (aria-live)
260
- - [ ] Custom components have proper roles
261
- - [ ] Page language identified
262
- - [ ] Reading order logical
263
-
264
- **Example Testing Script:**
265
- ```
266
- 1. Enable screen reader
267
- 2. Navigate to page
268
- 3. Verify page title announced
269
- 4. Navigate by headings (h1 → h2 → h3)
270
- 5. Navigate by landmarks (nav, main, footer)
271
- 6. Tab through form, verify labels read
272
- 7. Submit form with errors, verify error messages read
273
- 8. Navigate list of items, verify count announced
274
- 9. Open modal, verify focus trapped
275
- 10. Close modal, verify focus returned
276
- ```
277
-
278
- ---
279
-
280
- ### 3. Color Contrast Testing
281
-
282
- **WCAG Requirements:**
283
- - **Normal text:** 4.5:1 contrast ratio (AA), 7:1 (AAA)
284
- - **Large text (18pt+):** 3:1 contrast ratio (AA), 4.5:1 (AAA)
285
- - **UI components:** 3:1 contrast ratio
286
-
287
- **Tools:**
288
- - Chrome DevTools (built-in contrast checker)
289
- - WebAIM Contrast Checker
290
- - Colour Contrast Analyser (CCA)
291
-
292
- **Manual Test:**
293
- ```html
294
- <!-- BAD: Insufficient contrast (2.5:1) -->
295
- <p style="color: #777; background: #fff;">Low contrast text</p>
296
-
297
- <!-- ✅ GOOD: Sufficient contrast (4.6:1) -->
298
- <p style="color: #595959; background: #fff;">Readable text</p>
299
-
300
- <!-- GOOD: High contrast (12.6:1) -->
301
- <p style="color: #000; background: #fff;">High contrast text</p>
302
- ```
303
-
304
- **Testing Checklist:**
305
- - [ ] All text meets 4.5:1 ratio
306
- - [ ] Large text meets 3:1 ratio
307
- - [ ] Links distinguishable without color alone
308
- - [ ] UI components meet 3:1 ratio
309
- - [ ] Focus indicators meet 3:1 ratio
310
-
311
- ---
312
-
313
- ### 4. Text Resize & Zoom
314
-
315
- **Requirements:**
316
- - Text resizeable up to 200% without loss of content/functionality
317
- - No horizontal scrolling at 400% zoom (except data tables)
318
-
319
- **Manual Test:**
320
- ```
321
- 1. Open page in browser
322
- 2. Zoom to 200% (Cmd/Ctrl + "+")
323
- - Verify all text readable
324
- - Verify no content hidden
325
- - Verify functionality intact
326
- 3. Zoom to 400%
327
- - Verify no horizontal scrolling
328
- - Verify content reflows appropriately
329
- ```
330
-
331
- **CSS Best Practices:**
332
- ```css
333
- /* ✅ GOOD: Relative units */
334
- body {
335
- font-size: 1rem; /* 16px default */
336
- }
337
- h1 {
338
- font-size: 2rem; /* 32px default */
339
- }
340
-
341
- /* ❌ BAD: Fixed pixel sizes */
342
- body {
343
- font-size: 12px; /* Doesn't scale with user preferences */
344
- }
345
- ```
346
-
347
- ---
348
-
349
- ## Automated Testing
350
-
351
- ### 1. axe-core Integration
352
-
353
- **Install:**
354
- ```bash
355
- npm install --save-dev @axe-core/playwright
356
- ```
357
-
358
- **Playwright Example:**
359
- ```javascript
360
- import { test, expect } from '@playwright/test';
361
- import AxeBuilder from '@axe-core/playwright';
362
-
363
- test('homepage should not have accessibility violations', async ({ page }) => {
364
- await page.goto('https://example.com');
365
-
366
- const accessibilityScanResults = await new AxeBuilder({ page })
367
- .withTags(['wcag2a', 'wcag2aa', 'wcag21aa', 'wcag22aa'])
368
- .analyze();
369
-
370
- expect(accessibilityScanResults.violations).toEqual([]);
371
- });
372
-
373
- test('form should have proper labels', async ({ page }) => {
374
- await page.goto('https://example.com/signup');
375
-
376
- const results = await new AxeBuilder({ page })
377
- .include('#signup-form')
378
- .analyze();
379
-
380
- // Allow specific known issues
381
- const allowedViolations = results.violations.filter(v =>
382
- v.id !== 'color-contrast' // Being fixed in next sprint
383
- );
384
-
385
- expect(allowedViolations).toEqual([]);
386
- });
387
- ```
388
-
389
- **CI/CD Integration:**
390
- ```yaml
391
- # .github/workflows/a11y.yml
392
- name: Accessibility Tests
393
-
394
- on: [pull_request]
395
-
396
- jobs:
397
- a11y:
398
- runs-on: ubuntu-latest
399
- steps:
400
- - uses: actions/checkout@v3
401
- - uses: actions/setup-node@v3
402
- - run: npm ci
403
- - run: npm run test:a11y
404
-
405
- - name: Upload a11y results
406
- if: failure()
407
- uses: actions/upload-artifact@v3
408
- with:
409
- name: axe-results
410
- path: a11y-results/
411
- ```
412
-
413
- ---
414
-
415
- ### 2. Pa11y Testing
416
-
417
- **Install:**
418
- ```bash
419
- npm install --save-dev pa11y
420
- ```
421
-
422
- **Configuration:**
423
- ```javascript
424
- // .pa11yrc
425
- {
426
- "standard": "WCAG2AA",
427
- "timeout": 30000,
428
- "wait": 1000,
429
- "chromeLaunchConfig": {
430
- "args": ["--no-sandbox"]
431
- },
432
- "runners": [
433
- "axe",
434
- "htmlcs"
435
- ],
436
- "ignore": [
437
- "color-contrast" // Temporarily ignore while fixing
438
- ]
439
- }
440
- ```
441
-
442
- **Usage:**
443
- ```javascript
444
- const pa11y = require('pa11y');
445
-
446
- async function runA11yTests() {
447
- const results = await pa11y('https://example.com', {
448
- standard: 'WCAG2AA',
449
- includeWarnings: true,
450
- includeNotices: false
451
- });
452
-
453
- console.log(`Found ${results.issues.length} issues`);
454
-
455
- results.issues.forEach(issue => {
456
- console.log(`${issue.type}: ${issue.message}`);
457
- console.log(`Element: ${issue.selector}`);
458
- console.log(`Code: ${issue.code}\n`);
459
- });
460
- }
461
- ```
462
-
463
- ---
464
-
465
- ### 3. Lighthouse Accessibility Audit
466
-
467
- **Chrome DevTools:**
468
- ```
469
- 1. Open DevTools (F12)
470
- 2. Go to Lighthouse tab
471
- 3. Select "Accessibility" category
472
- 4. Click "Analyze page load"
473
- 5. Review score and recommendations
474
- ```
475
-
476
- **Programmatic:**
477
- ```javascript
478
- const lighthouse = require('lighthouse');
479
- const chromeLauncher = require('chrome-launcher');
480
-
481
- async function runLighthouse() {
482
- const chrome = await chromeLauncher.launch({ chromeFlags: ['--headless'] });
483
-
484
- const options = {
485
- logLevel: 'info',
486
- output: 'html',
487
- onlyCategories: ['accessibility'],
488
- port: chrome.port
489
- };
490
-
491
- const runnerResult = await lighthouse('https://example.com', options);
492
-
493
- const accessibilityScore = runnerResult.lhr.categories.accessibility.score * 100;
494
- console.log(`Accessibility Score: ${accessibilityScore}`);
495
-
496
- await chrome.kill();
497
- }
498
- ```
499
-
500
- ---
501
-
502
- ## ARIA Best Practices
503
-
504
- ### When to Use ARIA
505
-
506
- **First Rule of ARIA:** Don't use ARIA if you can use native HTML
507
-
508
- ```html
509
- <!-- ❌ BAD: ARIA on native element -->
510
- <div role="button" tabindex="0" onclick="submit()">Submit</div>
511
-
512
- <!-- ✅ GOOD: Native element -->
513
- <button onclick="submit()">Submit</button>
514
-
515
- <!-- ARIA OK: Custom component with no native equivalent -->
516
- <div role="tablist">
517
- <button role="tab" aria-selected="true">Tab 1</button>
518
- <button role="tab" aria-selected="false">Tab 2</button>
519
- </div>
520
- ```
521
-
522
- ---
523
-
524
- ### Common ARIA Patterns
525
-
526
- **Landmark Roles:**
527
- ```html
528
- <header role="banner">Site header</header>
529
- <nav role="navigation">Main navigation</nav>
530
- <main role="main">Main content</main>
531
- <aside role="complementary">Sidebar</aside>
532
- <footer role="contentinfo">Site footer</footer>
533
- ```
534
-
535
- **Live Regions:**
536
- ```html
537
- <!-- Polite: Announces when convenient -->
538
- <div role="status" aria-live="polite" aria-atomic="true">
539
- 3 items added to cart
540
- </div>
541
-
542
- <!-- Assertive: Announces immediately -->
543
- <div role="alert" aria-live="assertive">
544
- Error: Payment failed. Please try again.
545
- </div>
546
- ```
547
-
548
- **Form Accessibility:**
549
- ```html
550
- <label for="username">Username</label>
551
- <input
552
- type="text"
553
- id="username"
554
- aria-required="true"
555
- aria-describedby="username-help username-error"
556
- >
557
- <span id="username-help">Choose a unique username</span>
558
- <span id="username-error" role="alert" class="error">
559
- Username already taken
560
- </span>
561
- ```
562
-
563
- **Modals/Dialogs:**
564
- ```html
565
- <div
566
- role="dialog"
567
- aria-labelledby="dialog-title"
568
- aria-describedby="dialog-desc"
569
- aria-modal="true"
570
- >
571
- <h2 id="dialog-title">Confirm Action</h2>
572
- <p id="dialog-desc">Are you sure you want to delete?</p>
573
- <button onclick="confirmDelete()">Confirm</button>
574
- <button onclick="closeDialog()">Cancel</button>
575
- </div>
576
- ```
577
-
578
- ---
579
-
580
- ## Common Accessibility Issues
581
-
582
- ### Issue 1: Missing Alt Text
583
- ```html
584
- <!-- ❌ Problem -->
585
- <img src="chart.png">
586
-
587
- <!-- Solution -->
588
- <img src="chart.png" alt="Sales growth chart showing 25% increase in Q4">
589
-
590
- <!-- ✅ Decorative images -->
591
- <img src="decorative-line.png" alt="" role="presentation">
592
- ```
593
-
594
- ---
595
-
596
- ### Issue 2: Empty Links
597
- ```html
598
- <!-- Problem -->
599
- <a href="/products">
600
- <img src="icon.png" alt="">
601
- </a>
602
-
603
- <!-- ✅ Solution -->
604
- <a href="/products">
605
- <img src="icon.png" alt="View all products">
606
- </a>
607
- ```
608
-
609
- ---
610
-
611
- ### Issue 3: Form Labels Missing
612
- ```html
613
- <!-- ❌ Problem -->
614
- <input type="text" placeholder="Email">
615
-
616
- <!-- ✅ Solution -->
617
- <label for="email">Email Address</label>
618
- <input type="email" id="email" placeholder="you@example.com">
619
-
620
- <!-- Alternative: aria-label -->
621
- <input
622
- type="email"
623
- aria-label="Email Address"
624
- placeholder="you@example.com"
625
- >
626
- ```
627
-
628
- ---
629
-
630
- ### Issue 4: Poor Focus Management
631
- ```javascript
632
- // Problem: Focus lost when modal opens
633
- function openModal() {
634
- document.getElementById('modal').style.display = 'block';
635
- }
636
-
637
- // ✅ Solution: Manage focus properly
638
- function openModal() {
639
- const modal = document.getElementById('modal');
640
- const previouslyFocused = document.activeElement;
641
-
642
- modal.style.display = 'block';
643
- modal.querySelector('button').focus(); // Focus first button
644
-
645
- // Trap focus within modal
646
- modal.addEventListener('keydown', (e) => {
647
- if (e.key === 'Tab') {
648
- trapFocus(modal, e);
649
- }
650
- });
651
-
652
- // Restore focus on close
653
- modal.dataset.previousFocus = previouslyFocused;
654
- }
655
-
656
- function closeModal() {
657
- const modal = document.getElementById('modal');
658
- modal.style.display = 'none';
659
-
660
- // Restore focus
661
- const previousFocus = document.querySelector(modal.dataset.previousFocus);
662
- if (previousFocus) previousFocus.focus();
663
- }
664
- ```
665
-
666
- ---
667
-
668
- ## Using with QE Agents
669
-
670
- ### qe-accessibility-validator: Automated Compliance
671
-
672
- ```typescript
673
- // Agent runs comprehensive a11y validation
674
- const a11yResults = await agent.validateAccessibility({
675
- url: 'https://example.com/checkout',
676
- standard: 'WCAG2.2',
677
- level: 'AA',
678
- includeScreenReaderSimulation: true
679
- });
680
-
681
- // Returns:
682
- // {
683
- // score: 0.92,
684
- // violations: [
685
- // { rule: 'color-contrast', severity: 'serious', count: 3 },
686
- // { rule: 'label', severity: 'critical', count: 1 }
687
- // ],
688
- // passes: 47,
689
- // incomplete: 2,
690
- // screenReaderReport: {
691
- // navigation: 'good',
692
- // formLabels: 'needs-improvement',
693
- // landmarkStructure: 'excellent'
694
- // }
695
- // }
696
- ```
697
-
698
- ---
699
-
700
- ### qe-visual-tester: Keyboard & Focus Testing
701
-
702
- ```typescript
703
- // Agent validates focus indicators
704
- await agent.visualA11yTest({
705
- page: '/signup',
706
- checks: ['focus-visible', 'keyboard-navigation', 'tab-order'],
707
- generateReport: true
708
- });
709
-
710
- // Captures screenshots of:
711
- // - Focus states for all interactive elements
712
- // - Tab order visualization
713
- // - Keyboard navigation paths
714
- ```
715
-
716
- ---
717
-
718
- ### Fleet Coordination for Comprehensive A11y
719
-
720
- ```typescript
721
- const a11yFleet = await FleetManager.coordinate({
722
- strategy: 'comprehensive-accessibility',
723
- agents: [
724
- 'qe-accessibility-validator', // Automated scanning
725
- 'qe-visual-tester', // Visual & keyboard checks
726
- 'qe-test-generator', // Generate a11y tests
727
- 'qe-quality-gate' // Enforce compliance
728
- ]
729
- });
730
-
731
- await a11yFleet.execute({
732
- target: 'production-candidate',
733
- wcagLevel: 'AA',
734
- failOn: 'critical-violations',
735
- generateRemediationGuide: true
736
- });
737
- ```
738
-
739
- ---
740
-
741
- ## Related Skills
742
-
743
- **Core Testing:**
744
- - [agentic-quality-engineering](../agentic-quality-engineering/) - Agent-driven a11y testing
745
- - [regression-testing](../regression-testing/) - A11y in regression suite
746
- - [visual-testing-advanced](../visual-testing-advanced/) - Visual a11y checks
747
-
748
- **Specialized Testing:**
749
- - [mobile-testing](../mobile-testing/) - Mobile a11y (VoiceOver, TalkBack)
750
- - [compatibility-testing](../compatibility-testing/) - Cross-browser a11y
751
- - [compliance-testing](../compliance-testing/) - Legal compliance (ADA)
752
-
753
- ---
754
-
755
- ## Remember
756
-
757
- **Accessibility is a legal requirement, not a nice-to-have.**
758
-
759
- - 1 billion people with disabilities globally
760
- - $13 trillion purchasing power
761
- - 250%+ increase in lawsuits (2019-2024)
762
- - ADA, Section 508, EU regulations enforced
763
-
764
- **Automated testing catches only 30-50% of issues.**
765
-
766
- Combine automated scans with:
767
- - Manual keyboard testing
768
- - Screen reader testing
769
- - Real user testing with people with disabilities
770
-
771
- **Shift accessibility left:**
772
- - Design with accessibility in mind
773
- - Develop with semantic HTML + ARIA
774
- - Test throughout development (not at the end)
775
- - Include a11y in definition of done
776
-
777
- **With Agents:** `qe-accessibility-validator` automates WCAG 2.2 compliance checking, screen reader simulation, and focus management validation. Use agents to enforce accessibility standards in CI/CD and catch violations before production.
1
+ ---
2
+ name: accessibility-testing
3
+ description: WCAG 2.2 compliance testing, screen reader validation, and inclusive design verification. Use when ensuring legal compliance (ADA, Section 508), testing for disabilities, or building accessible applications for 1 billion disabled users globally.
4
+ ---
5
+
6
+ # Accessibility Testing
7
+
8
+ ## Core Principle
9
+
10
+ **1 billion people have disabilities. Building inaccessible software excludes 15% of humanity.**
11
+
12
+ Accessibility testing ensures software works for everyone, including people with visual, motor, cognitive, and hearing disabilities. It's not just ethical - it's legally required and expands your market by $13 trillion.
13
+
14
+ ## What is Accessibility Testing?
15
+
16
+ **Accessibility (a11y):** Ensuring people with disabilities can perceive, understand, navigate, and interact with software using assistive technologies.
17
+
18
+ **Why Critical:**
19
+ - **Legal:** ADA, Section 508, EU Directive 2016/2102 require accessibility
20
+ - **Market:** $13T purchasing power of disabled community
21
+ - **Litigation:** 250%+ increase in a11y lawsuits (2019-2024)
22
+ - **Ethics:** Equal access is a fundamental right
23
+ - **UX:** Accessible design benefits all users (curb-cut effect)
24
+
25
+ **Goal:** WCAG 2.2 Level AA compliance + excellent user experience with assistive tech.
26
+
27
+ ## WCAG 2.2 Compliance Levels
28
+
29
+ ### Conformance Levels
30
+
31
+ **Level A (Minimum)**
32
+ - Basic accessibility
33
+ - Addresses most critical barriers
34
+ - **Requirement:** Legal minimum in many jurisdictions
35
+
36
+ **Level AA (Standard)**
37
+ - Addresses majority of barriers
38
+ - **Requirement:** US federal government (Section 508)
39
+ - **Recommendation:** Industry standard for most websites
40
+
41
+ **Level AAA (Enhanced)**
42
+ - Highest level of accessibility
43
+ - Not required for full sites (some criteria impossible for all content)
44
+ - **Use when:** Specialized accessibility-focused sites
45
+
46
+ **Most Organizations Target:** WCAG 2.2 Level AA
47
+
48
+ ---
49
+
50
+ ## POUR Principles
51
+
52
+ ### 1. Perceivable
53
+ **Users must be able to perceive information**
54
+
55
+ **Requirements:**
56
+ - Text alternatives for non-text content
57
+ - Captions for videos
58
+ - Audio descriptions for video
59
+ - Adaptable content (different presentations)
60
+ - Distinguishable content (color contrast, text resize)
61
+
62
+ **Example:**
63
+ ```html
64
+ <!-- ❌ BAD: Image without alt text -->
65
+ <img src="product.jpg">
66
+
67
+ <!-- ✅ GOOD: Descriptive alt text -->
68
+ <img src="product.jpg" alt="Blue wireless headphones with noise cancellation">
69
+
70
+ <!-- ❌ BAD: Color-only error indication -->
71
+ <span style="color: red">Error</span>
72
+
73
+ <!-- GOOD: Color + icon + text -->
74
+ <span class="error" role="alert">
75
+ <span aria-hidden="true">⚠️</span>
76
+ Error: Invalid email format
77
+ </span>
78
+ ```
79
+
80
+ ---
81
+
82
+ ### 2. Operable
83
+ **Users must be able to operate the interface**
84
+
85
+ **Requirements:**
86
+ - Keyboard accessible (no mouse required)
87
+ - Enough time to read/use content
88
+ - No content causing seizures (no flashing > 3x/sec)
89
+ - Navigable (skip links, headings, focus order)
90
+ - Input modalities (touch, voice, etc.)
91
+
92
+ **Example:**
93
+ ```html
94
+ <!-- ❌ BAD: Mouse-only interaction -->
95
+ <div onclick="submitForm()">Submit</div>
96
+
97
+ <!-- ✅ GOOD: Keyboard accessible button -->
98
+ <button type="submit" onclick="submitForm()">Submit</button>
99
+
100
+ <!-- GOOD: Skip navigation link -->
101
+ <a href="#main-content" class="skip-link">
102
+ Skip to main content
103
+ </a>
104
+
105
+ <nav>...</nav>
106
+
107
+ <main id="main-content">...</main>
108
+ ```
109
+
110
+ ---
111
+
112
+ ### 3. Understandable
113
+ **Information and operation must be understandable**
114
+
115
+ **Requirements:**
116
+ - Readable text (language identified, unusual words explained)
117
+ - Predictable operation (consistent navigation)
118
+ - Input assistance (error identification, labels, suggestions)
119
+ - Compatible with assistive technologies
120
+
121
+ **Example:**
122
+ ```html
123
+ <!-- ❌ BAD: Unclear error -->
124
+ <span>Error</span>
125
+
126
+ <!-- GOOD: Clear, actionable error -->
127
+ <div role="alert" aria-live="assertive">
128
+ <strong>Error:</strong> Password must be at least 8 characters,
129
+ including one uppercase letter and one number.
130
+ </div>
131
+
132
+ <!-- GOOD: Form labels -->
133
+ <label for="email">
134
+ Email Address (required)
135
+ </label>
136
+ <input
137
+ type="email"
138
+ id="email"
139
+ name="email"
140
+ required
141
+ aria-required="true"
142
+ aria-describedby="email-help"
143
+ >
144
+ <span id="email-help">We'll never share your email.</span>
145
+ ```
146
+
147
+ ---
148
+
149
+ ### 4. Robust
150
+ **Content must work with current and future tools**
151
+
152
+ **Requirements:**
153
+ - Valid HTML/CSS
154
+ - Name, role, value available to assistive tech
155
+ - Status messages announced
156
+ - Compatible with user agents and assistive tech
157
+
158
+ **Example:**
159
+ ```html
160
+ <!-- ✅ GOOD: Custom component with ARIA -->
161
+ <div
162
+ role="button"
163
+ tabindex="0"
164
+ aria-pressed="false"
165
+ onkeydown="handleKeyPress(event)"
166
+ onclick="toggleButton()"
167
+ >
168
+ Toggle Feature
169
+ </div>
170
+
171
+ <!-- ✅ GOOD: Status message -->
172
+ <div role="status" aria-live="polite" aria-atomic="true">
173
+ 3 items added to cart
174
+ </div>
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Manual Testing Techniques
180
+
181
+ ### 1. Keyboard-Only Navigation
182
+
183
+ **Test keyboard accessibility:**
184
+ ```
185
+ Tab → Move to next focusable element
186
+ Shift+Tab Move to previous focusable element
187
+ Enter → Activate links/buttons
188
+ Space → Activate buttons, toggle checkboxes
189
+ Arrow keys→ Navigate within components (menus, sliders)
190
+ Esc → Close dialogs/menus
191
+ ```
192
+
193
+ **Checklist:**
194
+ - [ ] All interactive elements reachable via keyboard
195
+ - [ ] Visible focus indicator (outline/highlight)
196
+ - [ ] Logical tab order (follows visual layout)
197
+ - [ ] No keyboard traps (can navigate away)
198
+ - [ ] Skip navigation link present
199
+ - [ ] Keyboard shortcuts documented
200
+
201
+ **Common Issues:**
202
+ ```html
203
+ <!-- BAD: Custom div without keyboard support -->
204
+ <div onclick="openModal()">Open</div>
205
+
206
+ <!-- ✅ GOOD: Button with keyboard support -->
207
+ <button onclick="openModal()">Open</button>
208
+
209
+ <!-- GOOD: Custom element with keyboard -->
210
+ <div
211
+ role="button"
212
+ tabindex="0"
213
+ onclick="openModal()"
214
+ onkeydown="if(event.key==='Enter') openModal()"
215
+ >
216
+ Open
217
+ </div>
218
+ ```
219
+
220
+ ---
221
+
222
+ ### 2. Screen Reader Testing
223
+
224
+ **Major Screen Readers:**
225
+ - **JAWS** (Windows) - Most popular, commercial
226
+ - **NVDA** (Windows) - Free, open-source
227
+ - **VoiceOver** (macOS/iOS) - Built-in to Apple devices
228
+ - **TalkBack** (Android) - Built-in to Android
229
+ - **Narrator** (Windows) - Built-in to Windows
230
+
231
+ **VoiceOver Basics (macOS):**
232
+ ```
233
+ Cmd+F5 → Toggle VoiceOver
234
+ VO+Right/Left → Navigate elements (VO = Ctrl+Option)
235
+ VO+Shift+Down → Interact with element
236
+ VO+Space → Activate element
237
+ VO+A → Read from top
238
+ VO+U → Rotor (headings, links, landmarks)
239
+ ```
240
+
241
+ **Screen Reader Checklist:**
242
+ - [ ] All images have alt text (or alt="" for decorative)
243
+ - [ ] Headings announce correctly (h1, h2, etc.)
244
+ - [ ] Form labels associated with inputs
245
+ - [ ] Links have descriptive text (not "click here")
246
+ - [ ] Dynamic content announced (aria-live)
247
+ - [ ] Custom components have proper roles
248
+ - [ ] Page language identified
249
+ - [ ] Reading order logical
250
+
251
+ **Example Testing Script:**
252
+ ```
253
+ 1. Enable screen reader
254
+ 2. Navigate to page
255
+ 3. Verify page title announced
256
+ 4. Navigate by headings (h1 h2 → h3)
257
+ 5. Navigate by landmarks (nav, main, footer)
258
+ 6. Tab through form, verify labels read
259
+ 7. Submit form with errors, verify error messages read
260
+ 8. Navigate list of items, verify count announced
261
+ 9. Open modal, verify focus trapped
262
+ 10. Close modal, verify focus returned
263
+ ```
264
+
265
+ ---
266
+
267
+ ### 3. Color Contrast Testing
268
+
269
+ **WCAG Requirements:**
270
+ - **Normal text:** 4.5:1 contrast ratio (AA), 7:1 (AAA)
271
+ - **Large text (18pt+):** 3:1 contrast ratio (AA), 4.5:1 (AAA)
272
+ - **UI components:** 3:1 contrast ratio
273
+
274
+ **Tools:**
275
+ - Chrome DevTools (built-in contrast checker)
276
+ - WebAIM Contrast Checker
277
+ - Colour Contrast Analyser (CCA)
278
+
279
+ **Manual Test:**
280
+ ```html
281
+ <!-- ❌ BAD: Insufficient contrast (2.5:1) -->
282
+ <p style="color: #777; background: #fff;">Low contrast text</p>
283
+
284
+ <!-- GOOD: Sufficient contrast (4.6:1) -->
285
+ <p style="color: #595959; background: #fff;">Readable text</p>
286
+
287
+ <!-- ✅ GOOD: High contrast (12.6:1) -->
288
+ <p style="color: #000; background: #fff;">High contrast text</p>
289
+ ```
290
+
291
+ **Testing Checklist:**
292
+ - [ ] All text meets 4.5:1 ratio
293
+ - [ ] Large text meets 3:1 ratio
294
+ - [ ] Links distinguishable without color alone
295
+ - [ ] UI components meet 3:1 ratio
296
+ - [ ] Focus indicators meet 3:1 ratio
297
+
298
+ ---
299
+
300
+ ### 4. Text Resize & Zoom
301
+
302
+ **Requirements:**
303
+ - Text resizeable up to 200% without loss of content/functionality
304
+ - No horizontal scrolling at 400% zoom (except data tables)
305
+
306
+ **Manual Test:**
307
+ ```
308
+ 1. Open page in browser
309
+ 2. Zoom to 200% (Cmd/Ctrl + "+")
310
+ - Verify all text readable
311
+ - Verify no content hidden
312
+ - Verify functionality intact
313
+ 3. Zoom to 400%
314
+ - Verify no horizontal scrolling
315
+ - Verify content reflows appropriately
316
+ ```
317
+
318
+ **CSS Best Practices:**
319
+ ```css
320
+ /* ✅ GOOD: Relative units */
321
+ body {
322
+ font-size: 1rem; /* 16px default */
323
+ }
324
+ h1 {
325
+ font-size: 2rem; /* 32px default */
326
+ }
327
+
328
+ /* BAD: Fixed pixel sizes */
329
+ body {
330
+ font-size: 12px; /* Doesn't scale with user preferences */
331
+ }
332
+ ```
333
+
334
+ ---
335
+
336
+ ## Automated Testing
337
+
338
+ ### 1. axe-core Integration
339
+
340
+ **Install:**
341
+ ```bash
342
+ npm install --save-dev @axe-core/playwright
343
+ ```
344
+
345
+ **Playwright Example:**
346
+ ```javascript
347
+ import { test, expect } from '@playwright/test';
348
+ import AxeBuilder from '@axe-core/playwright';
349
+
350
+ test('homepage should not have accessibility violations', async ({ page }) => {
351
+ await page.goto('https://example.com');
352
+
353
+ const accessibilityScanResults = await new AxeBuilder({ page })
354
+ .withTags(['wcag2a', 'wcag2aa', 'wcag21aa', 'wcag22aa'])
355
+ .analyze();
356
+
357
+ expect(accessibilityScanResults.violations).toEqual([]);
358
+ });
359
+
360
+ test('form should have proper labels', async ({ page }) => {
361
+ await page.goto('https://example.com/signup');
362
+
363
+ const results = await new AxeBuilder({ page })
364
+ .include('#signup-form')
365
+ .analyze();
366
+
367
+ // Allow specific known issues
368
+ const allowedViolations = results.violations.filter(v =>
369
+ v.id !== 'color-contrast' // Being fixed in next sprint
370
+ );
371
+
372
+ expect(allowedViolations).toEqual([]);
373
+ });
374
+ ```
375
+
376
+ **CI/CD Integration:**
377
+ ```yaml
378
+ # .github/workflows/a11y.yml
379
+ name: Accessibility Tests
380
+
381
+ on: [pull_request]
382
+
383
+ jobs:
384
+ a11y:
385
+ runs-on: ubuntu-latest
386
+ steps:
387
+ - uses: actions/checkout@v3
388
+ - uses: actions/setup-node@v3
389
+ - run: npm ci
390
+ - run: npm run test:a11y
391
+
392
+ - name: Upload a11y results
393
+ if: failure()
394
+ uses: actions/upload-artifact@v3
395
+ with:
396
+ name: axe-results
397
+ path: a11y-results/
398
+ ```
399
+
400
+ ---
401
+
402
+ ### 2. Pa11y Testing
403
+
404
+ **Install:**
405
+ ```bash
406
+ npm install --save-dev pa11y
407
+ ```
408
+
409
+ **Configuration:**
410
+ ```javascript
411
+ // .pa11yrc
412
+ {
413
+ "standard": "WCAG2AA",
414
+ "timeout": 30000,
415
+ "wait": 1000,
416
+ "chromeLaunchConfig": {
417
+ "args": ["--no-sandbox"]
418
+ },
419
+ "runners": [
420
+ "axe",
421
+ "htmlcs"
422
+ ],
423
+ "ignore": [
424
+ "color-contrast" // Temporarily ignore while fixing
425
+ ]
426
+ }
427
+ ```
428
+
429
+ **Usage:**
430
+ ```javascript
431
+ const pa11y = require('pa11y');
432
+
433
+ async function runA11yTests() {
434
+ const results = await pa11y('https://example.com', {
435
+ standard: 'WCAG2AA',
436
+ includeWarnings: true,
437
+ includeNotices: false
438
+ });
439
+
440
+ console.log(`Found ${results.issues.length} issues`);
441
+
442
+ results.issues.forEach(issue => {
443
+ console.log(`${issue.type}: ${issue.message}`);
444
+ console.log(`Element: ${issue.selector}`);
445
+ console.log(`Code: ${issue.code}\n`);
446
+ });
447
+ }
448
+ ```
449
+
450
+ ---
451
+
452
+ ### 3. Lighthouse Accessibility Audit
453
+
454
+ **Chrome DevTools:**
455
+ ```
456
+ 1. Open DevTools (F12)
457
+ 2. Go to Lighthouse tab
458
+ 3. Select "Accessibility" category
459
+ 4. Click "Analyze page load"
460
+ 5. Review score and recommendations
461
+ ```
462
+
463
+ **Programmatic:**
464
+ ```javascript
465
+ const lighthouse = require('lighthouse');
466
+ const chromeLauncher = require('chrome-launcher');
467
+
468
+ async function runLighthouse() {
469
+ const chrome = await chromeLauncher.launch({ chromeFlags: ['--headless'] });
470
+
471
+ const options = {
472
+ logLevel: 'info',
473
+ output: 'html',
474
+ onlyCategories: ['accessibility'],
475
+ port: chrome.port
476
+ };
477
+
478
+ const runnerResult = await lighthouse('https://example.com', options);
479
+
480
+ const accessibilityScore = runnerResult.lhr.categories.accessibility.score * 100;
481
+ console.log(`Accessibility Score: ${accessibilityScore}`);
482
+
483
+ await chrome.kill();
484
+ }
485
+ ```
486
+
487
+ ---
488
+
489
+ ## ARIA Best Practices
490
+
491
+ ### When to Use ARIA
492
+
493
+ **First Rule of ARIA:** Don't use ARIA if you can use native HTML
494
+
495
+ ```html
496
+ <!-- ❌ BAD: ARIA on native element -->
497
+ <div role="button" tabindex="0" onclick="submit()">Submit</div>
498
+
499
+ <!-- ✅ GOOD: Native element -->
500
+ <button onclick="submit()">Submit</button>
501
+
502
+ <!-- ARIA OK: Custom component with no native equivalent -->
503
+ <div role="tablist">
504
+ <button role="tab" aria-selected="true">Tab 1</button>
505
+ <button role="tab" aria-selected="false">Tab 2</button>
506
+ </div>
507
+ ```
508
+
509
+ ---
510
+
511
+ ### Common ARIA Patterns
512
+
513
+ **Landmark Roles:**
514
+ ```html
515
+ <header role="banner">Site header</header>
516
+ <nav role="navigation">Main navigation</nav>
517
+ <main role="main">Main content</main>
518
+ <aside role="complementary">Sidebar</aside>
519
+ <footer role="contentinfo">Site footer</footer>
520
+ ```
521
+
522
+ **Live Regions:**
523
+ ```html
524
+ <!-- Polite: Announces when convenient -->
525
+ <div role="status" aria-live="polite" aria-atomic="true">
526
+ 3 items added to cart
527
+ </div>
528
+
529
+ <!-- Assertive: Announces immediately -->
530
+ <div role="alert" aria-live="assertive">
531
+ Error: Payment failed. Please try again.
532
+ </div>
533
+ ```
534
+
535
+ **Form Accessibility:**
536
+ ```html
537
+ <label for="username">Username</label>
538
+ <input
539
+ type="text"
540
+ id="username"
541
+ aria-required="true"
542
+ aria-describedby="username-help username-error"
543
+ >
544
+ <span id="username-help">Choose a unique username</span>
545
+ <span id="username-error" role="alert" class="error">
546
+ Username already taken
547
+ </span>
548
+ ```
549
+
550
+ **Modals/Dialogs:**
551
+ ```html
552
+ <div
553
+ role="dialog"
554
+ aria-labelledby="dialog-title"
555
+ aria-describedby="dialog-desc"
556
+ aria-modal="true"
557
+ >
558
+ <h2 id="dialog-title">Confirm Action</h2>
559
+ <p id="dialog-desc">Are you sure you want to delete?</p>
560
+ <button onclick="confirmDelete()">Confirm</button>
561
+ <button onclick="closeDialog()">Cancel</button>
562
+ </div>
563
+ ```
564
+
565
+ ---
566
+
567
+ ## Common Accessibility Issues
568
+
569
+ ### Issue 1: Missing Alt Text
570
+ ```html
571
+ <!-- Problem -->
572
+ <img src="chart.png">
573
+
574
+ <!-- ✅ Solution -->
575
+ <img src="chart.png" alt="Sales growth chart showing 25% increase in Q4">
576
+
577
+ <!-- ✅ Decorative images -->
578
+ <img src="decorative-line.png" alt="" role="presentation">
579
+ ```
580
+
581
+ ---
582
+
583
+ ### Issue 2: Empty Links
584
+ ```html
585
+ <!-- ❌ Problem -->
586
+ <a href="/products">
587
+ <img src="icon.png" alt="">
588
+ </a>
589
+
590
+ <!-- ✅ Solution -->
591
+ <a href="/products">
592
+ <img src="icon.png" alt="View all products">
593
+ </a>
594
+ ```
595
+
596
+ ---
597
+
598
+ ### Issue 3: Form Labels Missing
599
+ ```html
600
+ <!-- Problem -->
601
+ <input type="text" placeholder="Email">
602
+
603
+ <!-- ✅ Solution -->
604
+ <label for="email">Email Address</label>
605
+ <input type="email" id="email" placeholder="you@example.com">
606
+
607
+ <!-- ✅ Alternative: aria-label -->
608
+ <input
609
+ type="email"
610
+ aria-label="Email Address"
611
+ placeholder="you@example.com"
612
+ >
613
+ ```
614
+
615
+ ---
616
+
617
+ ### Issue 4: Poor Focus Management
618
+ ```javascript
619
+ // ❌ Problem: Focus lost when modal opens
620
+ function openModal() {
621
+ document.getElementById('modal').style.display = 'block';
622
+ }
623
+
624
+ // ✅ Solution: Manage focus properly
625
+ function openModal() {
626
+ const modal = document.getElementById('modal');
627
+ const previouslyFocused = document.activeElement;
628
+
629
+ modal.style.display = 'block';
630
+ modal.querySelector('button').focus(); // Focus first button
631
+
632
+ // Trap focus within modal
633
+ modal.addEventListener('keydown', (e) => {
634
+ if (e.key === 'Tab') {
635
+ trapFocus(modal, e);
636
+ }
637
+ });
638
+
639
+ // Restore focus on close
640
+ modal.dataset.previousFocus = previouslyFocused;
641
+ }
642
+
643
+ function closeModal() {
644
+ const modal = document.getElementById('modal');
645
+ modal.style.display = 'none';
646
+
647
+ // Restore focus
648
+ const previousFocus = document.querySelector(modal.dataset.previousFocus);
649
+ if (previousFocus) previousFocus.focus();
650
+ }
651
+ ```
652
+
653
+ ---
654
+
655
+ ## Using with QE Agents
656
+
657
+ ### qe-accessibility-validator: Automated Compliance
658
+
659
+ ```typescript
660
+ // Agent runs comprehensive a11y validation
661
+ const a11yResults = await agent.validateAccessibility({
662
+ url: 'https://example.com/checkout',
663
+ standard: 'WCAG2.2',
664
+ level: 'AA',
665
+ includeScreenReaderSimulation: true
666
+ });
667
+
668
+ // Returns:
669
+ // {
670
+ // score: 0.92,
671
+ // violations: [
672
+ // { rule: 'color-contrast', severity: 'serious', count: 3 },
673
+ // { rule: 'label', severity: 'critical', count: 1 }
674
+ // ],
675
+ // passes: 47,
676
+ // incomplete: 2,
677
+ // screenReaderReport: {
678
+ // navigation: 'good',
679
+ // formLabels: 'needs-improvement',
680
+ // landmarkStructure: 'excellent'
681
+ // }
682
+ // }
683
+ ```
684
+
685
+ ---
686
+
687
+ ### qe-visual-tester: Keyboard & Focus Testing
688
+
689
+ ```typescript
690
+ // Agent validates focus indicators
691
+ await agent.visualA11yTest({
692
+ page: '/signup',
693
+ checks: ['focus-visible', 'keyboard-navigation', 'tab-order'],
694
+ generateReport: true
695
+ });
696
+
697
+ // Captures screenshots of:
698
+ // - Focus states for all interactive elements
699
+ // - Tab order visualization
700
+ // - Keyboard navigation paths
701
+ ```
702
+
703
+ ---
704
+
705
+ ### Fleet Coordination for Comprehensive A11y
706
+
707
+ ```typescript
708
+ const a11yFleet = await FleetManager.coordinate({
709
+ strategy: 'comprehensive-accessibility',
710
+ agents: [
711
+ 'qe-accessibility-validator', // Automated scanning
712
+ 'qe-visual-tester', // Visual & keyboard checks
713
+ 'qe-test-generator', // Generate a11y tests
714
+ 'qe-quality-gate' // Enforce compliance
715
+ ]
716
+ });
717
+
718
+ await a11yFleet.execute({
719
+ target: 'production-candidate',
720
+ wcagLevel: 'AA',
721
+ failOn: 'critical-violations',
722
+ generateRemediationGuide: true
723
+ });
724
+ ```
725
+
726
+ ---
727
+
728
+ ## Related Skills
729
+
730
+ **Core Testing:**
731
+ - [agentic-quality-engineering](../agentic-quality-engineering/) - Agent-driven a11y testing
732
+ - [regression-testing](../regression-testing/) - A11y in regression suite
733
+ - [visual-testing-advanced](../visual-testing-advanced/) - Visual a11y checks
734
+
735
+ **Specialized Testing:**
736
+ - [mobile-testing](../mobile-testing/) - Mobile a11y (VoiceOver, TalkBack)
737
+ - [compatibility-testing](../compatibility-testing/) - Cross-browser a11y
738
+ - [compliance-testing](../compliance-testing/) - Legal compliance (ADA)
739
+
740
+ ---
741
+
742
+ ## Remember
743
+
744
+ **Accessibility is a legal requirement, not a nice-to-have.**
745
+
746
+ - 1 billion people with disabilities globally
747
+ - $13 trillion purchasing power
748
+ - 250%+ increase in lawsuits (2019-2024)
749
+ - ADA, Section 508, EU regulations enforced
750
+
751
+ **Automated testing catches only 30-50% of issues.**
752
+
753
+ Combine automated scans with:
754
+ - Manual keyboard testing
755
+ - Screen reader testing
756
+ - Real user testing with people with disabilities
757
+
758
+ **Shift accessibility left:**
759
+ - Design with accessibility in mind
760
+ - Develop with semantic HTML + ARIA
761
+ - Test throughout development (not at the end)
762
+ - Include a11y in definition of done
763
+
764
+ **With Agents:** `qe-accessibility-validator` automates WCAG 2.2 compliance checking, screen reader simulation, and focus management validation. Use agents to enforce accessibility standards in CI/CD and catch violations before production.