testpilot-ui Svelte Themes

Testpilot Ui

🎨 AI Frontend Test Generation Agent β€” auto-generates unit tests for any frontend project. React, Next.js, Vue, Nuxt, Angular, Svelte. Backend-flow aware. Self-learning.

🎨 TestPilot UI β€” AI Frontend Test Generation Agent

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.


🎯 What It Does

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

Key Capabilities

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

πŸš€ Quick Start

1. Clone TestPilot UI (once per team)

git clone https://github.com/switchcompany/testpilot-ui.git
cd testpilot-ui

2. Set Up Your Project

./setup.sh /path/to/your/frontend/project

3. Run with Copilot

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

πŸ“Š Supported Frameworks

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

πŸ”„ How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    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     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

What Makes TestPilot UI Different

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

πŸ§ͺ Testing Philosophy

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

Test Priority Order

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

πŸ›‘οΈ JSDOM Mastery

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

πŸ“š Knowledge Packs

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

πŸ“ Repository Structure

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

πŸ“ˆ POC Results

TheSwitchCompany Website β€” Next.js 16 + React 19

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:

  • βœ… Component rendering (Navbar, Footer, AuthCTA)
  • βœ… Contact form validation (7 field validations, email format, submission)
  • βœ… API route testing (Brevo integration, SMTP fallback, error handling)
  • βœ… Auth flow (signup, login, verification, redirect)
  • βœ… Analytics tracking (Google Sheets integration)
  • βœ… Supabase config (environment detection, URL validation)
  • βœ… Middleware (route matching patterns)

Patterns Discovered: 15 (JSDOM Response mock, next/jest transform handling, module-level env capture, SWC JSX limitation, Suspense wrapper requirements, and more)


🏒 Enterprise Features

  • Cross-project learning β€” React patterns help Vue projects and vice versa
  • Central knowledge hub β€” team-wide frontend learnings sync via git
  • Targeted mode β€” test specific components without full project analysis
  • Backend flow awareness β€” understands API contracts for meaningful assertions
  • Accessibility built-in β€” every test considers a11y
  • CI/CD integration β€” trigger via GitHub Issues or Copilot CLI

πŸ“„ License

MIT Β© 2025 TheSwitchCompany


TestPilot UI β€” Part of the TheSwitchCompany AI Agent Suite
TestPilot Core Β· TestPilot UI Β· More agents coming soon

Top categories

Loading Svelte Themes