界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

kb-testing-strategy

kb-testing-strategy

【数据与研究】Reference data, not a reviewer. Accessibility testing decision trees, browser/AT compatibility matrices, manual vs. automated test coverage, regression testing patterns, and acceptance criteria templates for user stories.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: kb-testing-strategy description: Reference data, not a reviewer. Accessibility testing decision trees, browser/AT compatibility matrices, manual vs. automated test coverage, regression testing patterns, and acceptance criteria templates for user stories. license: MIT disable-model-invocation: true user-invocable: false metadata: tier: reference domain: cross-cutting output: none effort: low title: Testing Strategy

Testing Strategy Skill

Decision frameworks for accessibility testing — when to use automated tools vs. manual testing, which screen reader + browser combinations to test, and how to write accessibility acceptance criteria.


Automated vs. Manual Testing Coverage

Each row, with what automated tools catch (~30-40%) and what requires manual testing (~60-70%).

What Automated Tools Catch (~30-40%)What Requires Manual Testing (~60-70%)
Missing alt text on imagesAlt text quality and accuracy
Missing form labelsLabel clarity and helpfulness
Color contrast ratios (computed)Color contrast in context (gradients, images)
Missing lang attributeCorrect language identification
Duplicate IDsLogical reading order
Missing ARIA roles on custom widgetsCorrect ARIA role for the interaction pattern
Heading hierarchy violationsHeading text meaningfulness
Empty links and buttonsLink/button text descriptiveness
Missing table headersTable caption and header association quality
Syntax errors in ARIAScreen reader announcement correctness

Browser + Screen Reader Compatibility Matrix

Primary Test Combinations (Required)

Each screen reader, with its browser, OS and priority.

Screen ReaderBrowserOSPriority
NVDAFirefoxWindowsMust test
NVDAChromeWindowsMust test
JAWSChromeWindowsMust test
VoiceOverSafarimacOSMust test
VoiceOverSafariiOSMust test
TalkBackChromeAndroidShould test

Secondary (Nice to Have)

Each screen reader, with its browser and OS.

Screen ReaderBrowserOS
NarratorEdgeWindows
JAWSEdgeWindows

Testing Decision Tree

Is it a new component or page?
├── Yes → Full test coverage (automated + manual)
│   ├── Run axe-core / Lighthouse scan
│   ├── Keyboard-only navigation test
│   ├── Screen reader announcement test (NVDA + VoiceOver minimum)
│   └── Visual check at 200% zoom
└── No → What changed?
    ├── Colors/styling → Contrast check + visual review
    ├── Interactive behavior → Keyboard + screen reader test
    ├── Content/text → Screen reader announcement check
    ├── Layout/order → Reading order + focus order test
    └── Dependencies updated → Regression scan (axe-core)

Regression Testing Patterns

CI Pipeline Accessibility Gates

  1. axe-core scan: Run on every PR. Fail on new critical/serious violations.
  2. Baseline management: Store known issues in .a11y-baseline.json. Only fail on new issues.
  3. Lighthouse score threshold: Set minimum accessibility score (e.g., 90). Fail on regression.
  4. Visual regression: Capture screenshots at 200% zoom. Compare for focus indicator and layout changes.

Preventing Regressions

  • Add accessibility assertions to existing component tests (see testing-accessibility.instructions.md)
  • Include keyboard navigation in E2E test suites
  • Track accessibility score trends over time (not just pass/fail)

Acceptance Criteria Template

For User Stories

Given [context],
When [action by keyboard/mouse/screen reader],
Then [accessible outcome]:

- [ ] Component has an accessible name (via label, aria-label, or aria-labelledby)
- [ ] Component has the correct ARIA role
- [ ] Component is reachable and operable by keyboard (Tab, Enter, Space, Escape, Arrows as appropriate)
- [ ] Focus is visible when the component receives focus
- [ ] State changes are announced to screen readers (aria-expanded, aria-selected, aria-checked, etc.)
- [ ] Error messages are associated with their inputs (aria-describedby or aria-errormessage)
- [ ] Content is readable at 200% zoom without horizontal scrolling
- [ ] Color is not the only means of conveying information

Common Testing Tools

Each tool, with type and best for.

ToolTypeBest For
axe-core / @axe-core/cliAutomatedCI/CD integration, broad violation scan
LighthouseAutomatedPerformance + accessibility combined score
WAVESemi-automatedVisual overlay of accessibility features/issues
Accessibility InsightsSemi-automatedFastPass (automated) + Assessment (guided manual)
pa11yAutomatedCI/CD, HTML CodeSniffer rules
jest-axeUnit testComponent-level axe scans in jest
cypress-axeE2E testPage-level axe scans in Cypress
playwright + @axe-core/playwrightE2E testPage-level axe scans in Playwright

Screen Reader Testing Quick Reference

NVDA (Windows)

Each key, with its action.

KeyAction
Insert + SpaceToggle focus/browse mode
TabMove to next focusable element
HNext heading
DNext landmark
FNext form field
TNext table
Insert + F7Elements list (links, headings, landmarks)

VoiceOver (macOS)

Each key, with its action.

KeyAction
VO (Ctrl+Option) + RightMove to next element
VO + SpaceActivate current element
VO + UOpen rotor (navigate by type)
VO + Cmd + HNext heading
我的收藏