Autonomous browser testing framework powered by Playwright. Discover bugs through intelligent random exploration, comprehensive network analysis, and extended testing sessions.
comet-monkey is a lightweight, zero-configuration autonomous testing tool that:
- π€ Explores autonomously - Discovers and interacts with page elements randomly
- π Analyzes networks - Tracks all HTTP requests, identifies 404s and failures
- π Generates reports - Produces detailed JSON reports with screenshots
- β‘ Runs instantly - No setup, no configuration, just
npm start - π¬ Captures everything - Screenshots, console errors, network data
- π§ͺ Tests thoroughly - Extended 60+ second exploration sessions
Perfect for:
- CI/CD pipelines - Automated pre-flight checks
- Exploratory testing - Finding unexpected bugs
- Regression detection - Catching breaking changes early
- Performance monitoring - Tracking load times and network issues
- Accessibility validation - Ensuring keyboard navigation and ARIA labels
| Feature | comet-monkey | Cypress | Playwright | Testim |
|---|---|---|---|---|
| Cost | Free | Free | Free | $50K+/year |
| Setup Time | 5 min | 2 hours | 1 hour | 4-8 hours |
| Autonomous | β | β | β | |
| Network Analysis | β | β | ||
| Extended Sessions | β | β | β | β |
| Zero Config | β | β | β | β |
| Open Source | β | β | β | β |
# Clone the repository
git clone https://github.com/Yashraj786/comet-monkey.git
cd comet-monkey
# Install dependencies
npm install# Run basic health checks (2 seconds)
npm run test:basic
# Analyze network requests (5 seconds)
npm run test:network
# Test interactive flows (10 seconds)
npm run test:interactive
# Extended 60-second exploration
npm run test:extended
# Run all tests
npm run test:all# Test your own website
node src/comet-monkey.js
# Edit src/comet-monkey.js and change BASE_URL=== Nexus AI Comet Inspection Started ===
β Homepage loads
β Page title correct - Nexus AI // Cyberpunk
β Login form renders
β Health endpoint responds - Status: 503
β CSS/JS loaded - CSS: loaded, JS: loaded
β Security headers present
β No fatal console errors - Found: 0 errors
β Mobile viewport works
β Form validation attributes
β 404 page handling - Status: 404
β Backend connectivity
β API endpoints accessible - Status: 503
=== Test Summary ===
Passed: 12/12
Report saved to: screenshots/inspection-report.json
=== DETAILED NETWORK INSPECTION STARTED ===
Total Requests: 16
Failed Requests: 0
Requests by Status Code:
β 200: 14 requests
β 302: 1 requests
β οΈ 404: 1 requests (intentional)
β Report saved to: screenshots/detailed-network-report.json
β±οΈ [60s] Extended Autonomous Testing Session Complete
π STATISTICS:
Duration: 60s
Pages Visited: 60
Unique URLs: 4
Elements Clicked: 105
Forms Tested: 52
Network Requests: 883
Errors Encountered: 30
Average Load Time: 25ms
β Report saved to: screenshots/extended-session-report.json
Each script has a CONFIG object at the top that you can customize:
const CONFIG = {
BASE_URL: 'http://localhost:3000', // Target URL
TEST_USER: { email: 'test@example.com', password: 'password' },
SCREENSHOT_DIR: 'playwright-screenshots', // Report directory
TIMEOUT: 30000, // Request timeout (ms)
INTERACTION_DELAY: 500, // Delay between actions (ms)
MAX_INTERACTIONS: 5, // Max random clicks per page
SESSION_DURATION_MS: 60000 // Extended session duration (ms)
};- Purpose: Quick sanity checks on your application
- Runtime: 2-3 seconds
- Coverage: 12 critical validations
- Output:
inspection-report.json
npm run test:basicTests:
- Page accessibility
- Page titles and metadata
- Login form rendering
- Health endpoints
- CSS/JS loading
- Security headers
- Console errors
- Responsive design
- Form validation
- 404 handling
- Backend connectivity
- API endpoints
- Purpose: Deep dive into network requests
- Runtime: 5-10 seconds
- Coverage: All HTTP requests, status codes, failures
- Output:
detailed-network-report.json
npm run test:networkAnalyzes:
- All HTTP requests
- Status code distribution
- Failed requests
- 404 errors with URLs
- Network failures
- Response times
- Purpose: Test user interactions and forms
- Runtime: 10-15 seconds
- Coverage: Element discovery, clicking, form filling, keyboard nav
- Output:
interactive-test-report.json
npm run test:interactiveTests:
- Element discovery (links, buttons, inputs)
- Clicking interactions
- Form field filling
- Keyboard navigation (Tab key)
- Sidebar navigation
- Accessibility attributes
- Mobile viewport
- Purpose: Continuous autonomous exploration
- Runtime: 60+ seconds
- Coverage: Multi-page navigation, random interactions, form testing
- Output:
extended-session-report.json+ screenshots
npm run test:extendedExplores:
- Multiple pages in sequence
- Random element clicking (105+ elements)
- Form testing (52+ forms)
- Error tracking
- Performance metrics
- Network monitoring
All tests generate JSON reports in the screenshots/ directory:
{
"timestamp": "2025-12-02T00:32:20.468Z",
"duration_ms": 60000,
"tests": [
{
"name": "Homepage loads",
"passed": true,
"details": ""
}
],
"interactions": [...],
"errors": [...],
"performance": {
"avg_load_time": 25,
"total_requests": 883
}
}View a report:
cat screenshots/extended-session-report.json | jq .Run before every deployment to catch breaking changes:
# .github/workflows/test.yml
- name: Pre-flight checks
run: npm run test:basic
- name: Network validation
run: npm run test:networkRun extended sessions to find edge cases:
# Schedule via cron
0 2 * * * cd /path/to/comet-monkey && npm run test:extendedTest across staging, QA, and production:
# Test staging
BASE_URL=https://staging.example.com npm run test:extended
# Test production
BASE_URL=https://example.com npm run test:basicTrack performance trends over time:
# Collect reports daily
npm run test:extended
# Archive and analyze: screenshots/extended-session-report.jsonEnsure keyboard navigation and ARIA labels work:
npm run test:interactive
# Check report for keyboard navigation results# Terminal 1: Start your app
npm run dev
# Terminal 2: Run tests
npm run test:allBASE_URL=http://localhost:3000 npm run test:basicEdit src/comet-monkey.js and change the CONFIG object:
const CONFIG = {
BASE_URL: 'https://your-site.com',
TIMEOUT: 60000, // Increase for slow sites
SESSION_DURATION_MS: 120000 // 2-minute extended session
};# View summary
cat screenshots/extended-session-report.json | jq '.performance'
# Find all errors
cat screenshots/extended-session-report.json | jq '.errors'
# Count interactions
cat screenshots/extended-session-report.json | jq '.interactions | length'Error: Port 3000 is in use
Solution: Stop other processes or change BASE_URL in config
Error: Failed to launch browser
Solution: Install Playwright browsers
npx playwright installError: Timeout of 30000ms exceeded
Solution: Increase TIMEOUT in CONFIG or check network
Error: playwright-screenshots directory not writable
Solution: Create directory and check permissions
mkdir -p playwright-screenshots
chmod 755 playwright-screenshotsTypical performance on modern web apps:
| Metric | Benchmark |
|---|---|
| Basic test runtime | 2-3 seconds |
| Network analysis | 5-10 seconds |
| Interactive test | 10-15 seconds |
| Extended session | 60-120 seconds |
| Page load time | 20-50ms |
| Network requests | 10-50 per page |
| Screenshots | 20-30 per session |
Contributions are welcome! Please feel free to:
- Report bugs - Open an issue with details
- Suggest features - Describe your use case
- Submit PRs - Fork, develop, and submit pull request
- Improve docs - Fix typos, add examples
See CONTRIBUTING.md for details.
MIT License - feel free to use in personal and commercial projects.
See LICENSE for details.
Built with:
- Playwright - Browser automation
- Node.js - JavaScript runtime
Inspired by:
- Testing best practices
- Autonomous bug discovery
- Developer-first tools
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: yash.ramteke369@gmail.com
- Basic health checks
- Network analysis
- Interactive testing
- Extended sessions
- Cloud dashboard (planned for v2)
- CI/CD integration helpers
- AI-powered bug reports
- Team collaboration
- Historical trend analysis
If you find comet-monkey useful, please:
- β Star this repository
- π Report bugs and issues
- π¬ Share feedback and suggestions
- π£ Tell others about it!
Made with β€οΈ for developers who want better testing.
Last updated: December 2, 2025