skills/test/SKILL.md
Build or improve a UI testing strategy covering visual regression, interaction testing, and accessibility assertions. Use when the user asks to add tests, set up testing, fix flaky tests, improve test coverage, validate UI behavior, catch visual bugs, or establish confidence in shipping frontend changes.
npx skillsauth add aladicf/better-web-ui testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Establish systematic confidence in UI behavior through the right mix of visual regression, interaction testing, and accessibility assertions.
Treat testing as a design input, not a post-ship safety net. The goal is not maximum coverage; it is catching the bugs that matter most without drowning the team in maintenance.
Consult the accessibility testing reference when the testing strategy needs automated axe checks, screen reader validation, or keyboard traversal tests. Consult the component accessibility reference when testing custom components for focus management, ARIA correctness, and keyboard behavior. Consult the interaction design reference when validating workflows under stress, error, or edge-case conditions. Consult the error-recovery reference when testing validation behavior, recoverable field errors, or abandonment paths. Consult the loading feedback and perceived performance reference when testing loading states, skeletons, stale-data cues, or perceived-performance behavior.
Users start this workflow with /test. Once this skill is active, load $frontend-design — it contains design principles, anti-patterns, and the Context Gathering Protocol. Follow that protocol before proceeding — if no design context exists yet, you MUST load $setup first. Additionally gather: the most common UI bugs currently escaping to production, the team's tolerance for test maintenance, and which parts of the UI change most frequently.
Identify what is breaking and what should be caught:
Map bug escape routes:
Evaluate current coverage:
Prioritize by risk and churn:
Catch unintended visual changes before they ship.
What to capture:
Baseline discipline:
Anti-flake practices:
Scope boundaries:
Validate that user actions produce correct outcomes.
Component-level interactions:
User flow validation:
Test data strategy:
Embed accessibility validation into the testing pipeline.
Automated checks (run on every build):
Keyboard traversal tests:
Screen reader smoke tests (for critical paths):
Motion and animation:
prefers-reduced-motion is respectedBalance speed, confidence, and maintenance cost:
| Layer | Scope | Speed | Purpose | |-------|-------|-------|---------| | Unit (component) | Single component, mocked dependencies | Fast (< 1s) | Logic, rendering, prop handling | | Integration (component + context) | Component with real providers, stubs | Medium (< 10s) | Interaction behavior, state transitions | | End-to-end (full browser) | Real browser, real network or stubs | Slow (< 30s per test) | Critical user flows, cross-page behavior | | Visual regression | Screenshot comparison | Medium (parallelizable) | Unintended visual changes |
Guidance:
Match the tool to the team's stack and the testing layer:
| Need | Strong options | Considerations | |------|----------------|----------------| | Component unit/integration | Vitest + Testing Library, Jest + Testing Library | Framework-agnostic; prefer Testing Library queries that mirror user behavior | | End-to-end critical flows | Playwright, Cypress | Playwright for speed and cross-browser parallelism; Cypress for simpler setup | | Visual regression | Chromatic, Loki, Playwright screenshots, Percy | Chromatic for Storybook integration; Playwright for in-house baseline management | | Accessibility automation | axe-core, @axe-core/react, Playwright + axe | Integrate into CI; treat as warnings, not blockers, until baseline is clean | | Interaction / user flow | Playwright, Cypress, Storybook Test Runner | Storybook Test Runner for isolated component interactions; Playwright/Cypress for full flows |
Pragmatic rules:
Before shipping the testing strategy:
development
Design security-conscious interfaces that protect users without frustrating them. Use when the user asks about MFA, password UX, breach notifications, trust indicators, secure forms, account recovery, or making security feel safe rather than scary.
development
Design or improve search experiences, result presentation, and filtering interfaces. Use when the user asks to add search, redesign search results, improve findability, build autocomplete, add filters, or fix zero-results dead ends.
development
Plan, implement, or improve an internationalization and localization strategy for UI content, formatting, and regional adaptation. Use when the user asks to add i18n, localize, translate, support multiple languages, handle regional formats, manage locale switching, or build a multilingual product.
development
Design, structure, or improve form interfaces for clarity, completion rates, and user confidence. Use when the user asks to build a form, redesign a form flow, improve form conversion, add multi-step forms, fix form UX, or structure field layouts and validation.