How spalanivelu1989/test-suite works
1. Product shape
- This repo is a Next.js-based control plane for an autonomous UI testing system. The user-facing app lives under app/, while the core orchestration, knowledge, reporting, and storage logic lives under src/.
2. Primary user flows
- The main flow starts in the run UI (app/page.tsx, app/RunForm.tsx) and drives a test-run lifecycle through /api/runs.
- Users can inspect run state, cancel a run, stream progress, and open generated reports via dedicated routes under app/api/runs/[id]/... and views under app/runs/[id]/.
3. Run orchestration boundary
- src/orchestrator/ is the execution brain. It coordinates staged test execution, wires knowledge into the prompt/context, and manages the overall run lifecycle through runService.ts, stages.ts, and orchestrate.ts.
- This is where the app turns a test request into a structured sequence of crawl/plan/generate/run/heal actions.
4. Agent execution layer
- src/agents/ contains the low-level runtime guards and workspace/crawl controls that keep browser-driving behavior safe and consistent.
- The repo also includes .claude/agents/ and .claude/skills/playwright-cli/, which define the AI subagents and the Playwright CLI skill contract they must follow. This is a key architectural boundary: the orchestrator delegates browser work to Claude agents, but those agents are constrained by the Playwright CLI skill set.
5. Browser and test automation
- Playwright is the execution backend for browser interactions and generated tests. The README explicitly requires npx playwright-cli install --skills, which indicates the system depends on token-efficient Playwright CLI commands rather than ad hoc browser scripting.
- The system is built to generate, run, and evolve Playwright test suites rather than just record one-off sessions.
6. Run persistence and live feedback
- Run state and execution artifacts are stored separately from the knowledge base. src/runStore/ and src/runManager/ handle persistence and lifecycle management for test runs.
- The UI consumes run updates through the streaming endpoint (app/api/runs/[id]/stream/route.ts) and renders progress/reporting components such as tables, details panes, charts, and trends.
7. Results and reporting
- After execution, results are parsed and validated in src/results/ and src/validator/.
- src/reporter/ turns raw run output into human-readable narratives and rendered reports, which are surfaced in the run detail pages and report endpoints.
8. Knowledge platform subsystem
- The src/knowledge/ tree is a separate but central subsystem for extracting, storing, retrieving, and distilling reusable testing knowledge.
- It includes ingestion, embeddings, retrieval, healing precedence, global patterns, app profiles, and business-context modeling. This is the system that lets the tool learn from prior runs and reuse patterns across apps.
9. Knowledge APIs and exploration UI
- Knowledge is exposed through API routes under app/api/knowledge/..., including apps, patterns, specs, and query translation/execution.
- The UI has dedicated exploration surfaces such as app/explore/ and app/sql-query/, which suggests the team can inspect, query, and calibrate the knowledge store directly.
10. Storage and schema
- The knowledge store uses Postgres with pgvector, confirmed by the migrations in src/knowledge/store/migrations/ and the architecture docs.
- This is not just a document store: it holds structured metadata, embeddings, pattern embeddings, title embeddings, and healing playbooks, enabling hybrid semantic and additive matching.
11. Domain corpus
- business-context/ contains the domain knowledge the system learns from: apps, workflows, screens, and SAP Fiori conventions/patterns.
- specs/ and docs/ capture architecture, design decisions, implementation notes, and phase plans. These files are part of the knowledge supply chain used for distillation and reuse.
12. Operational tooling
- bin/ contains maintenance and backfill jobs for knowledge distillation, embedding generation, provenance/heal backfills, CI runs, and smoke tests.
- src/observability/langfuse.ts shows optional telemetry/LLM observability integration, which matters because this system is an agent pipeline with long-running, multi-step executions.
13. Repo-level architecture summary
- The architecture is best drawn as four major zones: the Next.js UI/API layer, the orchestration/agent execution layer, the knowledge store/retrieval layer, and the reporting/persistence layer.
- Data flows from UI → run APIs → orchestrator → Claude/Playwright execution → results/reporting → run store, with a parallel loop from execution artifacts into the knowledge ingestion/distillation pipeline so future runs can reuse and heal from prior experience.
Main entry points: orchestrate.ts Orchestrate · runs Run APIs · store KB Store · runService.ts Run Service
Components 24
Next.js UI
User-facing app pages, API routes, and run/knowledge exploration screens.
- Run UI · Entry page for launching and inspecting test runs.
app/page.tsx - Run Form · Collects run inputs and starts the main lifecycle.
app/RunForm.tsx - Run APIs · Creates runs, streams progress, cancels, and exposes reports/state.
app/api/runs - Run Views · Run detail and report-facing screens.
app/runs/[id] - Knowledge APIs · App, pattern, spec, and query endpoints for the knowledge store.
app/api/knowledge - Explore UI · Pattern explorer and SQL query surfaces for inspecting knowledge.
app/explore - SQL Query · Direct SQL exploration and calibration interface.
app/sql-query
Execution Core
Run orchestration, agent controls, results processing, validation, and reporting.
- Run Service · Coordinates run lifecycle state and orchestration entrypoints.
src/orchestrator/runService.ts - Stages · Defines the staged crawl/plan/generate/run/heal flow.
src/orchestrator/stages.ts - Orchestrate · Main orchestration logic that turns requests into structured execution.
src/orchestrator/orchestrate.ts - Agent Guards · Safety and workspace controls for browser-driving agent execution.
src/agents - Results · Parses raw execution output into structured run results.
src/results/parse.ts - Validator · Checks run output and generated artifacts for correctness.
src/validator/validate.ts - Reporter · Builds narratives, rendered reports, and success metrics.
src/reporter/report.ts - Run Store · Stores run state and artifacts for live and post-run access.
src/runStore/store.ts - Run Manager · Manages run persistence and lifecycle coordination.
src/runManager/manager.ts
Knowledge Platform
Business context, retrieval, ingestion, healing, embeddings, and persistent store.
- Context Pack · Packages reusable knowledge into prompt/context bundles.
src/knowledge/assemble/contextPack.ts - Retrieval · Fetches app profiles, global patterns, and healing precedents.
src/knowledge/retrieve - Ingest · Extracts run artifacts and feeds them into the knowledge pipeline.
src/knowledge/ingest - Distill · Clusters, summarizes, and promotes reusable learnings.
src/knowledge/distill - Healing · Captures failures and builds healing precedents and provenance.
src/knowledge/heal - KB Store · Persistent knowledge database with embeddings and playbooks.
src/knowledge/store
CLI Agents
Claude agent definitions and the Playwright CLI skill contract.
- Playwright Skill · Contract for token-efficient Playwright CLI usage.
.claude/skills/playwright-cli/SKILL.md - Claude Agents · Designer, discoverer, and evolver roles used by orchestration.
.claude/agents
Connections 27
- Run UI → Run Form: starts · The landing page drives users into the run creation form.
- Run Form → Run APIs: creates runs · Form submissions call the run API lifecycle endpoint.
- Run APIs → Run Service: launches · Run routes delegate lifecycle control to the orchestrator service.
- Run Service → Orchestrate: executes · The service enters the main orchestration workflow.
- Orchestrate → Stages: plans · Orchestration is driven by staged execution steps.
- Orchestrate → Agent Guards: delegates · Browser work is handed to guarded agent/runtime controls.
- Agent Guards → Playwright Skill: constrains · Agent behavior follows the Playwright CLI skill contract.
- Agent Guards → Claude Agents: uses · Guarded execution is performed by Claude subagents.
- Orchestrate → Context Pack: injects context · Knowledge is packed into prompts and execution context.
- Context Pack → Retrieval: pulls from · Context packs are built from retrieved knowledge.
- Retrieval → KB Store: reads · Retrieval queries the persistent knowledge database.
- Orchestrate → Results: produces · Execution output is parsed into structured results.
- Results → Validator: checks · Parsed results are validated before reporting.
- Validator → Reporter: feeds · Validation outcomes shape the generated report.
- Reporter → Run Views: surfaces · Reports and narratives are shown in run detail pages.
- Run Service → Run Manager: manages · Lifecycle coordination is backed by the run manager.
- Run Manager → Run Store: persists · Run state and artifacts are stored for live updates.
- Run APIs → Run Store: streams state · API routes read and expose stored run updates.
- Run Views → Run APIs: polls/streams · Run views consume run state, cancellations, and reports.
- Knowledge APIs → KB Store: queries · Knowledge APIs expose database-backed content and search.
- Explore UI → Knowledge APIs: explores · The exploration UI calls knowledge endpoints.
- SQL Query → KB Store: inspects · SQL query UI is for direct store inspection and calibration.
- Run APIs → Ingest: triggers ingest · Completed or updated runs can be fed into ingestion.
- Ingest → Distill: distills · Ingested artifacts are summarized into reusable knowledge.
- Distill → KB Store: writes · Distilled patterns and embeddings are persisted.
- Results → Healing: captures failures · Failures and fixes feed the healing memory pipeline.
- Healing → KB Store: stores playbooks · Healing provenance and playbooks are written to the store.