Task AI Tester is a lightweight FastAPI-based project demonstrating AI-driven API testing automation.
It consists of two FastAPI services (Task API and AI Test Agent) and a demo script that runs the full end-to-end process automatically.
task-ai/
├── agent/
│ └── ai_test_agent.py # AI Test Agent – generates, executes, and analyzes test cases via OpenAI API
├── api/
│ └── app.py # Simple FastAPI task management API (CRUD for tasks)
├── tests/
│ └── test_integration.py # Integration tests (optional, for pytest)
├── demo.py # One-click demo script that runs the entire flow
├── requirements.txt # Python dependencies
├── README.md # This file
├── report.md # Generated QA report (AI summary)
└── pytest.ini # Pytest configuration
- Python 3.11+ (tested on 3.12)
- pip package manager
- OpenAI API key (active billing required)
- Works on Windows, macOS, or Linux
Default ports:
- 5000 → Task API
- 5001 → AI Test Agent
git clone https://github.com/your-repo/task-ai-tester.git
cd task-ai-testerWindows (PowerShell):
python -m venv .venv
.\.venv\Scripts�ctivatemacOS / Linux:
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtYou must have an active OpenAI key from the OpenAI Platform.
$env:OPENAI_API_KEY = "your-secret-key"or on macOS/Linux:
export OPENAI_API_KEY="your-secret-key"uvicorn api.app:app --reload --port 5000uvicorn agent.ai_test_agent:app --reload --port 5001python demo.pyThis script will:
- Verify both services are up
- Fetch the OpenAPI spec
- Generate realistic test scenarios using the AI model
- Execute all generated API tests
- Analyze results and produce a Markdown QA report (
report.md)
After a successful run, you’ll see console output similar to:
AI Test Agent Starting...
Generated 14 test scenarios using AI
Executed 14 tests in 22.3 seconds
Results: 12 passed, 2 failed
Executive Summary: saved to report.md
And a report.md file will contain a detailed AI-written analysis report in Markdown format.
- Both services can be customized or extended for different APIs by modifying:
/api/app.pyfor business logic (your own API under test)/agent/ai_test_agent.pyfor test generation logic or OpenAI prompts
demo.pyprovides a single command demonstration flow.- Integration tests can be added under
/tests.
When finished working, deactivate your Python virtual environment:
deactivateThis project is provided for educational and testing purposes.