AI-driven automated E2E test generation & execution platform powered by Gemini, Playwright, and Firebase.
Fetch test cases from Firebase Firestore, select which ones to run through an interactive TUI, and execute them with a Playwright-based AI agent β all from your terminal.
- Features
- Architecture
- Prerequisites
- Installation
- Configuration
- Usage
- Firebase Setup
- Project Structure
- API Reference
- Firebase Integration β Fetch test cases from Firestore, persist results back
- Interactive TUI β Visual test case selection with checkboxes, live execution progress
- AI-Powered Execution β Gemini 2.5 Flash-Lite + Playwright MCP for intelligent browser automation
- Multiple Modes β TUI, CLI, and REST API
- Live Feedback β Real-time pass/fail status during execution
- Screenshot Capture β Automatic screenshots uploaded to Firebase Storage
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β TUI (Rich/ β β CLI β β REST API β
β Textual) β β (argparse) β β (FastAPI) β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β β
βββββββββββββββββββΌβββββββββββββββββββ
β
ββββββββββββ΄βββββββββββ
β Test Executor β
β Agent (LangGraph + β
β Gemini + Playwrightβ
β MCP) β
ββββββββββββ¬βββββββββββ
β
ββββββββββββ΄βββββββββββ
β Firebase (Firestoreβ
β + Storage) β
βββββββββββββββββββββββ
- Python 3.12+
- Node.js 18+ (for Playwright MCP server)
- Firebase Project with Firestore enabled
- Google API Key for Gemini
# Clone the repo
git clone https://github.com/your-username/Agentic_Tester.git
cd Agentic_Tester
# Create virtual environment (recommended)
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txtCopy the example and fill in your values:
cp .env.example .envEdit .env:
# Gemini
GOOGLE_API_KEY=your-gemini-api-key
# Firebase
FIREBASE_PROJECT_ID=agentic-tester-ded1d
FIREBASE_API_KEY=your-firebase-api-key
FIREBASE_CREDENTIALS_PATH=./firebase-credentials.json
# Target
TARGET_URL=https://example.com- Go to Firebase Console β Project Settings β Service Accounts
- Click Generate new private key
- Save the JSON file as
firebase-credentials.jsonin the project root
Launch the visual terminal interface:
python main.py tuiHow it works:
- Enter your Project ID and Target URL
- Click Fetch (or press
F) to load test cases from Firebase - A loading spinner shows while fetching
- Test cases appear as a checkbox list β select/deselect what to run
- Click Execute Selected (or press
R) to run the tests - Watch live results as each test completes
Keyboard shortcuts:
| Key | Action |
|---|---|
F |
Fetch test cases from Firebase |
A |
Select all test cases |
D |
Deselect all test cases |
R |
Run selected tests |
Q |
Quit |
Fetch and run all test cases for a project:
python main.py execute --from-firebase --project demo-projectWith a specific suite:
python main.py execute --from-firebase --project demo-project --suite-id suite-001Override target URL:
python main.py execute --from-firebase --project demo-project --url https://mysite.comRun tests from a local JSON file:
python main.py execute --test-file sample_test_cases.json --url https://example.comStart the FastAPI server:
python main.py serve --port 8000Then use the API endpoints (see API Reference below).
Your Firestore database should have a test_cases collection. Each document should follow this schema:
{
"id": "tc-001",
"project_id": "demo-project",
"title": "Verify Homepage Loads",
"description": "Navigate to homepage and verify title",
"steps": [
{
"action": "navigate",
"value": "https://example.com",
"description": "Navigate to the homepage"
},
{
"action": "assert",
"expected": "Example Domain",
"description": "Verify the page title"
}
],
"expected_result": "Homepage loads correctly",
"priority": "high",
"category": "functional"
}Supported fields:
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Unique test case ID |
project_id |
string | Yes | Project identifier (used for filtering) |
title |
string | Yes | Test case name |
description |
string | No | Detailed description |
steps |
array | No | Ordered list of test steps |
expected_result |
string | No | Expected outcome |
priority |
string | No | high, medium, or low |
category |
string | No | functional, boundary, negative, ui, or api |
| Field | Type | Description |
|---|---|---|
action |
string | navigate, click, fill, assert, snapshot |
selector |
string | CSS/XPath selector for target element |
value |
string | Input value or navigation URL |
expected |
string | Expected value for assertions |
description |
string | Human-readable description |
Agentic_Tester/
βββ main.py # Entry point (CLI, TUI, Server)
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (gitignored)
βββ .env.example # Environment template
βββ firebase-credentials.json # Firebase service account (gitignored)
βββ sample_test_cases.json # Example test cases (local file)
β
βββ src/
β βββ config.py # Settings from .env
β β
β βββ tui/
β β βββ tui.py # Interactive Textual TUI
β β
β βββ executor/
β β βββ agent.py # Test executor (LangGraph + Gemini)
β β βββ graph.py # LangGraph execution graph
β β βββ prompts.py # Execution prompts
β β βββ mcp_config.py # Playwright MCP config
β β βββ state.py # Graph state model
β β βββ tools/ # Custom assertion tools
β β
β βββ models/
β β βββ test_case.py # TestCase, TestSuite models
β β βββ execution_result.py # ExecutionResult, Summary models
β β
β βββ storage/
β β βββ firebase_client.py # Firebase read/write operations
β β
β βββ api/
β βββ app.py # FastAPI app setup
β βββ routes/
β βββ execution.py # API endpoints
β
βββ tests/ # Test suite
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Health check |
GET |
/api/projects/{id}/test-cases |
Fetch test cases from Firebase |
POST |
/api/projects/{id}/execute-test |
Execute a single test case |
POST |
/api/projects/{id}/execute-tests |
Execute a test suite |
POST |
/api/projects/{id}/execute-from-firebase |
Fetch from Firebase & execute |
GET |
/api/projects/{id}/results |
Get execution results |
GET |
/api/projects/{id}/results/{eid} |
Get specific result |
curl -X POST http://localhost:8000/api/projects/demo-project/execute-from-firebase \
-H "Content-Type: application/json" \
-d '{"target_url": "https://example.com"}'curl http://localhost:8000/api/projects/demo-project/test-casesMIT