Browser Explorer is an AI-powered web browsing agent that automatically explores websites, tests interactive elements, and generates comprehensive Playwright test suites. Built with a modular architecture combining traditional crawling with AI-enhanced capabilities, it's designed to be the ultimate tool for automated web testing and exploration.
- 🔍 Intelligent Web Crawling: Breadth-first search algorithm for systematic website exploration
- 🤖 AI-Powered Element Detection: Hybrid AI + traditional detection for 25+ element types
- 🎯 Smart Interaction: Automated interaction with forms, buttons, dropdowns, modals, and more
- 📸 Comprehensive Recording: Complete user path capture with screenshots and timing
- 🧪 Test Generation: Automatic Playwright/Cypress/Puppeteer test suite generation
- 📄 Page Object Model: Clean, maintainable test structure with POM pattern
- 🔐 Multi-Strategy Authentication: Support for Basic, OAuth, MFA, and API key auth
- 🥷 Stealth Mode: Advanced anti-bot detection evasion
- 🧩 CAPTCHA Handling: Detection and solving capabilities
- 📊 Distributed Crawling: Redis-based queue for scalable operations
- 🐳 Docker Support: Full containerization with docker-compose
- 📈 Monitoring & Metrics: Built-in observability and health checks
- Complete infrastructure and crawling engine
- Traditional element detection and interaction
- Test generation pipeline with multiple frameworks
- Authentication system and session management
- CLI interface with comprehensive commands
- Docker containerization and deployment ready
- Mastra AI agent integration (shell classes only)
- Stagehand browser automation tools (not integrated)
- Natural language capabilities
- Self-healing test features
Note: While the infrastructure is production-ready, the AI capabilities that differentiate this from traditional crawlers are pending integration. See TODO.md for the complete roadmap.
- Node.js 20+
- Docker and Docker Compose (for full deployment)
- Redis (for distributed crawling)
- PostgreSQL (for data persistence)
# Clone the repository
git clone https://github.com/yourusername/browser-explorer.git
cd browser-explorer
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Build the project
npm run build
# Run with Docker (recommended)
docker-compose up -d
# Or run locally
npm start# Initialize configuration
browser-explorer init
# Crawl a website and generate tests
browser-explorer crawl https://example.com --output ./tests --depth 3
# Run specific test generation
browser-explorer test https://example.com/login --framework playwright
# Validate generated tests
browser-explorer validate ./tests
# Start monitoring dashboard
browser-explorer serve --port 3000
# Debug mode with verbose logging
browser-explorer debug https://example.com --verboseimport { BrowserExplorer } from 'browser-explorer';
// Initialize the explorer
const explorer = new BrowserExplorer({
headless: true,
depth: 3,
parallel: 5,
stealth: true
});
// Start exploration
const results = await explorer.explore('https://example.com', {
authentication: {
strategy: 'basic',
credentials: { username: 'user', password: 'pass' }
},
output: {
directory: './generated-tests',
framework: 'playwright'
}
});
// Generate Page Object Model
await explorer.generatePageObjects(results);Browser Explorer
├── CLI/API Layer # User interfaces
├── Core Services # Orchestration and workflow
├── Components # Element detection, interaction, recording
├── Infrastructure # Config, logging, metrics, storage
└── Runtime # Playwright, Redis, Docker, Node.js
- Crawler Module: BFS, resilient, and distributed crawling strategies
- Detection Module: AI-ready element detection with 25+ element types
- Generation Module: Multi-framework test generation with POM
- Authentication Module: Pluggable auth strategies and session management
- Monitoring Module: Metrics, traces, and health monitoring
See ARCHITECTURE.md for detailed architecture documentation.
crawler:
depth: 3
parallel: 5
timeout: 30000
respectRobotsTxt: true
detection:
useAI: false # Will be true when AI integration is complete
fallbackToSelectors: true
generation:
framework: playwright
outputDir: ./tests
generatePageObjects: true
browser:
headless: true
viewport:
width: 1920
height: 1080# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/browser_explorer
# Redis
REDIS_URL=redis://localhost:6379
# API Keys (when AI integration is complete)
OPENAI_API_KEY=your-key-here
ANTHROPIC_API_KEY=your-key-here
# Monitoring
ENABLE_METRICS=true
METRICS_PORT=9090# Install dependencies
npm install
# Run in development mode
npm run dev
# Run tests
npm test
# Run linting
npm run lint
# Type checking
npm run typecheck# Unit tests
npm run test:unit
# Integration tests
npm run test:integration
# Performance tests
npm run test:performance
# Self-test the system
npm run self-test# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Scale crawler workers
docker-compose up -d --scale crawler=5
# Stop all services
docker-compose downThe system includes comprehensive monitoring capabilities:
- Metrics: Application and infrastructure metrics
- Tracing: Distributed tracing for request flows
- Health Checks: Liveness, readiness, and dependency checks
- Dashboards: Built-in monitoring dashboard at
/metrics
We welcome contributions! Please see our Contributing Guide for details.
- Mastra AI Integration - Implement proper AI agent configurations
- Stagehand Integration - Add natural language browser control
- Self-Healing Tests - AI-powered test maintenance
- Enhanced Detection - Natural language element queries
- Getting Started Guide - Complete setup and first steps
- Quick Examples - Working code examples
- Configuration Guide - Setup and configuration
- Documentation Index - Complete documentation overview
- API Reference - All classes, interfaces, and functions
- Architecture Overview - System design and patterns
- Implementation Status - Current gaps and roadmap
- Browser Agent - Core browser automation
- Authentication System - Multi-strategy auth
- AI Element Detection - Element identification
- Web Crawler - Systematic web exploration
- Test Generation - Automated test creation
- Contributing Guide - How to contribute
- Development Setup - Local development
- Testing Guide - Running and writing tests
- Docker Guide - Containerization
- AI Integration - Mastra and AI workflows
- Performance Optimization - Scaling and optimization
- Security Guide - Security best practices
- Troubleshooting - Common issues and solutions
- Server Mode: CLI advertises but not implemented (
src/cli/BrowserExplorerCLI.ts:334) - Authentication Setup: CLI auth command exists but non-functional (
src/cli/BrowserExplorerCLI.ts:417) - Stagehand AI Integration: Core AI detection completely disabled (
src/detectors/AIElementDetector.ts:23-28) - Test Generation: Placeholder implementations for core features (
src/generation/TestGenerator.ts:497-507)
- OAuth authentication flows (framework exists, needs provider implementations)
- MFA support (basic structure, needs TOTP integration)
- Browser-Crawler integration (service architecture incomplete)
- CLI debug commands (advertised but not functional)
- Basic browser automation and control
- Username/password authentication
- Selector-based element detection
- Basic test generation templates
- Configuration management
- Session persistence
- Docker infrastructure
See Implementation Status Report for detailed analysis of all gaps, priorities, and planned fixes.
- Mastra agent implementation
- Stagehand tool integration
- Basic natural language support
- Self-healing test capabilities
- AI-powered visual regression
- Intelligent assertion generation
- Multi-agent collaboration
- Advanced learning capabilities
- Enterprise integrations
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Playwright for browser automation
- Designed for Mastra AI framework integration
- Prepared for Stagehand natural language control
Made with ❤️ by the Browser Explorer Team