Drop-in agentic workflow that auto-generates unit tests for any frontend project, in any framework. Zero production code changes. 90%+ coverage. Backend-flow aware. Self-learning.
TestPilot UI is an AI-powered frontend test engineer that understands component trees, user interactions, state management, and API integrations β then generates comprehensive tests that cover behavior, not implementation details.
Your Frontend Project + TestPilot UI = 90%+ Test Coverage
| Feature | Description |
|---|---|
| π Auto Framework Detection | Detects React/Vue/Angular/Svelte, routing, state management, CSS approach |
| π§ Component Tree Analysis | Maps pages β layouts β components, understands prop drilling and context |
| π Behavior-First Testing | Tests how users interact, not how code is structured |
| π Backend Flow Awareness | Understands API contracts, auth flows, data fetching to write meaningful tests |
| βΏ Accessibility Testing | Tests ARIA roles, labels, keyboard navigation, semantic HTML |
| π Iterative Coverage Loop | Up to 5 iterations, targeting biggest gaps each round |
| π‘οΈ Rollback Protection | Never allows coverage to drop |
| π Self-Learning | Captures JSDOM quirks, framework gotchas, and fix patterns automatically |
git clone https://github.com/switchcompany/testpilot-ui.git
cd testpilot-ui
./setup.sh /path/to/your/frontend/project
Open your project in VS Code with GitHub Copilot, then:
Option A β Full Project Run:
@workspace Run the full-workflow prompt to analyze and generate tests for this frontend project
Option B β Specific Components:
@workspace Run full-workflow for: Navbar, ContactForm, AuthModal, Dashboard
| Framework | Test Runner | Component Testing | DOM Environment | Coverage |
|---|---|---|---|---|
| React | Jest / Vitest | @testing-library/react | jsdom | c8 / istanbul |
| Next.js | Jest / Vitest | @testing-library/react | jsdom | c8 / istanbul |
| Vue | Vitest | @vue/test-utils, @testing-library/vue | jsdom / happy-dom | c8 |
| Nuxt | Vitest | @vue/test-utils | jsdom / happy-dom | c8 |
| Angular | Karma / Jest | TestBed | jsdom | karma-coverage |
| Svelte | Vitest | @testing-library/svelte | jsdom / happy-dom | c8 |
| SvelteKit | Vitest | @testing-library/svelte | jsdom / happy-dom | c8 |
| SolidJS | Vitest | @solidjs/testing-library | jsdom | c8 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TestPilot UI β Workflow β
β β
β βββββββββββ βββββββββββ ββββββββββββ βββββββββββββββββ β
β β Load ββββΆβ Detect ββββΆβ Analyze ββββΆβ Baseline β β
β βLearningsβ βFrameworkβ βComponentsβ β Coverage β β
β βββββββββββ βββββββββββ ββββββββββββ βββββββββ¬ββββββββ β
β β β
β βββββββββββ ββββββββββββββββββββββββββββββββββββββββ β
β β Self- βββββ Iteration Loop (Γ5) ββ β
β β Learn β β Fix β Generate β Run β Rollback βββ β
β βββββββββββ βββββββββββββββββββββββββββββββββββββββ β
β β
β Output: Tests + Coverage Report + Learnings β
β β
β π Backend Flow Awareness: β
β API contracts Β· Auth flows Β· Data fetching Β· Error handling β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Backend Flow Awareness β Most frontend test tools only understand components. TestPilot UI understands the full picture:
| Flow | What We Test |
|---|---|
| API Integration | Request payloads, response handling, error states (4xx, 5xx, network) |
| Auth Flow | Login β verify β redirect, token refresh, protected routes, logout |
| Form Submission | Validation β API call β success/error response β UI update |
| Data Fetching | Loading β data β error states, refetch, cache invalidation |
| Optimistic Updates | UI update β API call β rollback on failure |
TestPilot UI follows industry best practices:
β
DO: Test behavior (what users see and do)
β DON'T: Test implementation (state variables, internal methods)
β
DO: Use Testing Library queries (getByRole, getByText, getByLabelText)
β DON'T: Use CSS selectors or test IDs for everything
β
DO: Mock external dependencies (API, router, auth)
β DON'T: Mock internal components (test them integrated)
β
DO: Test accessibility (ARIA, keyboard, screen readers)
β DON'T: Skip a11y β it's both good UX and required by law
| Priority | What to Test | Why |
|---|---|---|
| π΄ Critical | Pages with forms, auth flows, payment | Direct business impact |
| π High | Components with user interaction logic | Core user experience |
| π‘ Medium | Hooks/composables, state management | Reusable logic |
| π’ Normal | Pure display components, layouts | Visual correctness |
| βͺ Low | Static pages, wrappers, providers | Minimal logic |
TestPilot UI knows every JSDOM limitation and has workarounds pre-loaded:
| Missing API | Workaround |
|---|---|
Response / Request |
Mock next/server entirely |
IntersectionObserver |
Global mock in setup file |
ResizeObserver |
Global mock in setup file |
matchMedia |
Mock with jest.fn() returning match object |
window.scrollTo |
Mock as jest.fn() |
fetch |
Global mock or msw for realistic API mocking |
crypto.randomUUID() |
Mock or polyfill |
TextEncoder / TextDecoder |
Import from util in setup |
Pre-seeded knowledge for common frameworks (in knowledge-packs/):
| Pack | Patterns | Source |
|---|---|---|
react-nextjs.md |
20+ patterns | Learned from production Next.js 16 project |
vue-nuxt.md |
15+ patterns | Vue 3 + Nuxt 3 best practices |
angular.md |
12+ patterns | Angular 17+ patterns |
svelte.md |
10+ patterns | Svelte 5 + SvelteKit patterns |
testpilot-ui/
βββ .github/
β βββ copilot-instructions.md # Agent brain β frontend-specialized
β βββ copilot-setup-steps.yml # Environment verification
β βββ agent-config.yml # Central hub path config
β βββ ISSUE_TEMPLATE/
β β βββ analyze-and-test.yml # GitHub Issue trigger template
β βββ prompts/
β βββ full-workflow.prompt.md # Main orchestrator
β βββ detect-tech-stack.prompt.md # Framework detection
β βββ analyze-project.prompt.md # Component tree analysis
β βββ analyze-existing-tests.prompt.md # Test audit
β βββ generate-coverage-report.prompt.md # Coverage config
β βββ write-unit-tests.prompt.md # Test writing playbook
β βββ fix-broken-tests.prompt.md # JSDOM + framework fixes
β βββ self-learn.prompt.md # Knowledge capture
βββ knowledge-packs/
β βββ react-nextjs.md
β βββ vue-nuxt.md
β βββ angular.md
β βββ svelte.md
βββ LEARNINGS.md # Cross-project knowledge base
βββ setup.sh # Project setup script
βββ update.sh # Update script
βββ CONTRIBUTING.md # Contribution guide
βββ SECURITY.md # Security policy
βββ LICENSE # MIT License
| Metric | Before | After | Delta |
|---|---|---|---|
| Line Coverage | 0% | 85% | +85% |
| Test Files | 0 | 6 | +6 |
| Test Cases | 0 | 71 | +71 |
| Iterations | β | 3 | β |
| Production Files Modified | β | 0 | β |
Tests Generated:
Patterns Discovered: 15 (JSDOM Response mock, next/jest transform handling, module-level env capture, SWC JSX limitation, Suspense wrapper requirements, and more)
MIT Β© 2025 TheSwitchCompany
TestPilot UI β Part of the TheSwitchCompany AI Agent Suite
TestPilot Core Β· TestPilot UI Β· More agents coming soon