https://github.com/pc-2208/multi-agent-game-tester-poc
Multi-Agent Game Tester POC - Intelligent AI agent coordination for automated game testing with concurrent execution, comprehensive validation, and real-time reporting. Features specialized agents for planning, ranking, execution, and analysis of web-based game tests.
https://github.com/pc-2208/multi-agent-game-tester-poc
fastapi html nodejs openai playwright python testing
Last synced: 3 months ago
JSON representation
Multi-Agent Game Tester POC - Intelligent AI agent coordination for automated game testing with concurrent execution, comprehensive validation, and real-time reporting. Features specialized agents for planning, ranking, execution, and analysis of web-based game tests.
- Host: GitHub
- URL: https://github.com/pc-2208/multi-agent-game-tester-poc
- Owner: PC-2208
- Created: 2025-09-27T19:45:53.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-27T20:31:40.000Z (9 months ago)
- Last Synced: 2025-09-27T22:09:33.628Z (9 months ago)
- Topics: fastapi, html, nodejs, openai, playwright, python, testing
- Language: Python
- Homepage: http://localhost:8000/
- Size: 12.9 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multi-Agent Game Tester POC
A proof-of-concept implementation of an intelligent multi-agent system for automated game testing, featuring AI-powered test planning, execution, validation, and comprehensive reporting.
## Overview
This project demonstrates a sophisticated multi-agent architecture that automates the entire game testing lifecycle. The system uses multiple specialized AI agents working in coordination to plan, execute, validate, and analyze test cases for web-based games, specifically targeting `https://play.ezygamers.com/`.
## Architecture
The system consists of four main agent types working in harmony:
### 1. **Planner Agent** (`planner.py`)
- Generates 20+ candidate test cases automatically
- Creates structured test scenarios with steps, assertions, and metadata
- Provides test case templates for different game scenarios
### 2. **Ranker Agent** (`agents/ranker_agent.py`)
- Intelligently ranks and prioritizes test cases
- Selects the top 10 most valuable tests for execution
- Uses scoring algorithms to optimize test coverage
### 3. **Executor Agents** (`executor.py`, `executor_simple.py`)
- Execute test cases using Playwright for browser automation
- Capture comprehensive artifacts (screenshots, DOM, console logs, network traffic)
- Support both real browser execution and simulated execution modes
- Implement load balancing across multiple concurrent executors
### 4. **Analyzer Agent** (`agents/analyzer_agent.py`)
- Validates test results through multiple validation strategies
- Performs repeat validation for reproducibility testing
- Implements cross-agent validation for consensus building
- Generates detailed validation reports with confidence scores
### 5. **Orchestrator Agent** (`orchestrator.py`)
- Coordinates all agents and manages the testing workflow
- Implements concurrent execution with load balancing
- Generates comprehensive test reports
- Provides recommendations based on test results
## Features
- **Multi-Agent Coordination**: Specialized agents working together for comprehensive testing
- **Concurrent Execution**: Parallel test execution with configurable concurrency limits
- **Comprehensive Artifacts**: Screenshots, DOM snapshots, console logs, network traffic
- **Intelligent Validation**: Multi-layered validation with reproducibility testing
- **Real-time Reporting**: Live test execution reports with detailed analytics
- **Web Interface**: User-friendly dashboard for monitoring and control
- **RESTful API**: Complete API for integration with external systems
- **Performance Metrics**: Detailed performance analysis and timing data
## Prerequisites
- Python 3.8+
- Node.js (for Playwright)
- Modern web browser (Chrome/Chromium)
## Installation
1. **Clone the repository**
```bash
git clone
cd multi-agent-game-tester-poc
```
2. **Install Python dependencies**
```bash
pip install -r requirements.txt
```
3. **Install Playwright browsers**
```bash
playwright install
```
4. **Run the application**
```bash
python main.py
```
5. **Access the web interface**
Open your browser and navigate to `http://localhost:8000`
## Usage
### Web Interface
The system provides a user-friendly web interface where you can:
- View test execution status in real-time
- Generate and rank test cases
- Execute comprehensive test suites
- View detailed reports and analytics
- Download test artifacts
### API Endpoints
#### Generate Test Plan
```bash
GET /plan
```
Returns 20+ candidate test cases generated by the Planner Agent.
#### Rank Test Cases
```bash
GET /rank
```
Ranks test cases and returns the top 10 most valuable tests.
#### Execute Tests
```bash
POST /execute
```
Executes the top 10 ranked test cases with multiple agents.
#### Get Test Report
```bash
GET /reports/{run_id}
```
Retrieves a detailed test execution report for a specific run.
#### List All Reports
```bash
GET /reports
```
Lists all available test execution reports.
### Programmatic Usage
```python
from orchestrator import OrchestratorAgent
from planner import generate_plan
from agents.ranker_agent import RankerAgent
# Generate test cases
test_cases = generate_plan(20)
# Rank and select top tests
ranker = RankerAgent()
top_tests = ranker.rank_test_cases(test_cases, top_n=10)
# Execute with orchestrator
orchestrator = OrchestratorAgent(max_concurrent_executors=3)
run_id = await orchestrator.run_tests_async(top_tests)
```
## Test Execution Flow
1. **Planning Phase**: Planner Agent generates 20+ test case candidates
2. **Ranking Phase**: Ranker Agent evaluates and selects top 10 tests
3. **Execution Phase**: Multiple Executor Agents run tests concurrently
4. **Validation Phase**: Analyzer Agent validates results with multiple strategies
5. **Reporting Phase**: Orchestrator generates comprehensive reports
## Project Structure
```
multi-agent-game-tester-poc/
├── agents/ # Specialized agent implementations
│ ├── analyzer_agent.py # Test result validation agent
│ └── ranker_agent.py # Test case ranking agent
├── frontend/ # Web interface
│ └── index.html # Dashboard UI
├── runs/ # Test execution results
│ └── {run_id}/ # Individual test run artifacts
├── executor.py # Full-featured executor agent
├── executor_simple.py # Simplified executor for testing
├── main.py # FastAPI application entry point
├── orchestrator.py # Multi-agent coordination
├── planner.py # Test case generation
├── test_flow.py # End-to-end testing script
└── requirements.txt # Python dependencies
```
## Configuration
### Concurrency Settings
```python
# Configure maximum concurrent executors
orchestrator = OrchestratorAgent(max_concurrent_executors=3)
```
### Validation Settings
```python
# Configure validation parameters
analyzer = AnalyzerAgent()
analyzer.validation_runs = 3 # Number of repeat validations
analyzer.cross_agent_threshold = 0.8 # Agreement threshold
```
## Test Reports
Each test run generates comprehensive reports including:
- **Summary Statistics**: Pass/fail rates, execution times, validation scores
- **Individual Test Results**: Detailed results for each test case
- **Artifacts**: Screenshots, DOM snapshots, console logs, network traffic
- **Validation Details**: Repeat validation and cross-agent analysis
- **Recommendations**: Actionable insights based on test results
- **Performance Metrics**: Load times, rendering performance, network analysis
## Testing
Run the complete test suite:
```bash
python test_flow.py
```
This will test all API endpoints and verify the complete multi-agent workflow.
## Target Application
The system is specifically designed to test web-based games, with the current target being `https://play.ezygamers.com/`. The test cases are structured to validate:
- Game loading and initialization
- User interactions and gameplay mechanics
- Visual elements and UI components
- Performance and responsiveness
- Error handling and edge cases
## Future Enhancements
- **Machine Learning Integration**: AI-powered test case generation and optimization
- **Visual Testing**: Automated visual regression testing
- **Performance Benchmarking**: Advanced performance analysis and comparison
- **Test Data Management**: Dynamic test data generation and management
- **Integration Testing**: API and database integration testing
- **Mobile Testing**: Support for mobile game testing
- **Cloud Execution**: Distributed testing across multiple environments