Intelligent E2E Testing Platform - AI-powered test generation, execution, and analysis.
TestForge AI is a comprehensive testing platform that combines:
- Frontend: Electron + React + TypeScript with a modern UI
- Backend: FastAPI + Python with async support
- AI: LangGraph + RAG (ChromaDB) + OpenAI/Ollama for intelligent test generation
- Testing: Playwright for E2E, pytest for API, OpenTelemetry for tracing
- Multi-Layer Testing: Frontend (Playwright), Backend (API), Database, Infrastructure
- AI-Powered Test Generation: Generate tests from natural language descriptions
- Failure Analysis: AI-assisted root cause analysis with fix suggestions
- Distributed Tracing: OpenTelemetry integration for cross-layer visibility
- RAG-Enhanced Context: Codebase indexing for context-aware AI responses
- Comprehensive Reports: HTML, PDF, JSON, JUnit XML, and Markdown exports
- Modern UI: Dark/light theme, real-time test execution, trace visualization
- Node.js 18+
- Miniconda/Anaconda (Python env via conda only)
- PostgreSQL 16+
- Redis (optional)
- Ollama (optional, for local AI)
cd testforge
# Create conda env (run once)
conda create -n testforge-env python=3.12
conda activate testforge-env
# Install all dependencies (Makefile uses conda run -n testforge-env)
make install# Backend configuration
cp backend/.env.example backend/.env
# Edit backend/.env with your settingsdocker run -d --name testforge-db \
-e POSTGRES_USER=testforge \
-e POSTGRES_PASSWORD=testforge \
-e POSTGRES_DB=testforge \
-p 5432:5432 \
postgres:16make db-upgrade# Terminal 1: Start backend
make dev-backend
# Terminal 2: Start frontend (Electron)
make dev-electrontestforge/
├── package.json # Frontend dependencies
├── electron/ # Electron main process
│ ├── main.ts # Main entry point
│ ├── preload.ts # IPC bridge
│ └── backend-manager.ts # Backend process management
├── src/ # React frontend
│ ├── components/ # UI components
│ ├── features/ # Feature modules
│ ├── stores/ # Zustand stores
│ └── services/ # API client
├── backend/ # Python backend
│ ├── app/
│ │ ├── api/v1/ # REST endpoints
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ ├── core/
│ │ │ ├── runners/ # Test runners
│ │ │ └── tracing/ # OpenTelemetry
│ │ ├── ai/
│ │ │ ├── agents/ # LangGraph agents
│ │ │ └── rag/ # RAG pipeline
│ │ └── reports/ # Report generation
│ └── alembic/ # Database migrations
GET /api/v1/projects- List projectsPOST /api/v1/projects- Create projectGET /api/v1/projects/{id}- Get projectPATCH /api/v1/projects/{id}- Update projectDELETE /api/v1/projects/{id}- Delete project
GET /api/v1/projects/{id}/runs- List test runsPOST /api/v1/projects/{id}/runs- Start test runGET /api/v1/projects/{id}/runs/{run_id}- Get test runPOST /api/v1/projects/{id}/runs/{run_id}/stop- Stop test run
POST /api/v1/ai/generate- Generate testsPOST /api/v1/ai/analyze- Analyze failurePOST /api/v1/ai/chat- Chat with assistant
GET /api/v1/traces- List tracesGET /api/v1/traces/{id}- Get trace
POST /api/v1/reports/generate- Generate report
# Application
APP_NAME=TestForge AI
DEBUG=false
ENVIRONMENT=development
# Database
DATABASE_URL=postgresql+asyncpg://testforge:testforge@localhost:5432/testforge
# AI Providers
OPENAI_API_KEY=sk-...
OLLAMA_BASE_URL=http://localhost:11434
DEFAULT_AI_PROVIDER=openai
DEFAULT_AI_MODEL=gpt-4
# Tracing
ENABLE_TRACING=true
JAEGER_ENDPOINT=localhost:6831from app.core.runners import FrontendRunner, RunnerConfig
runner = FrontendRunner(RunnerConfig(
headless=True,
browser="chromium",
viewport_width=1280,
viewport_height=720,
))from app.core.runners import BackendRunner, RunnerConfig
runner = BackendRunner(RunnerConfig(
base_url="http://localhost:8000",
timeout_ms=30000,
))from app.core.runners import DatabaseRunner, RunnerConfig
runner = DatabaseRunner(RunnerConfig(
database_url="postgresql://...",
))from app.ai.agents import TestGeneratorAgent
agent = TestGeneratorAgent()
result = await agent.generate(
prompt="Generate login tests",
project_id="...",
test_type="e2e",
)from app.ai.agents import FailureAnalyzerAgent
agent = FailureAnalyzerAgent()
analysis = await agent.analyze(
error_message="Element not found",
error_stack="...",
test_name="login_test",
test_file="tests/login.spec.ts",
project_id="...",
)npm run build:frontendnpm run electron:buildcd backend
pyinstaller --onefile -n testforge-backend app/main.pymake test-frontend
make test-backendmake lint
make format
make typecheckMIT License
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request