A professional Python-based REST API testing framework with a modern web dashboard β status code validation, JSON schema checking, payload integrity, latency benchmarking, and automated Postman collection export.
![]()
Built by Sandrine Uwineza β Technical Support Engineer Β· CCNA Certified Β· Computer Engineering BSc
When a web application reports an issue, a Technical Support or Application Support Engineer traces the problem through the API layer. This framework automates that diagnostic workflow β running systematic validation checks against every configured endpoint and producing a structured report.
Four validation modules run on every endpoint:
| Module | What it validates |
|---|---|
| Status Validator | HTTP status code matches expected (200, 404, 500, etc.) |
| Schema Validator | JSON response fields exist and have correct types |
| Latency Validator | Response time is within defined SLA threshold |
| Payload Validator | No null values, empty fields, or oversized payloads |
A modern, responsive web dashboard provides three views:
- Run Suite β execute all configured endpoints with tag filtering
- Custom Test β test any URL instantly with configurable parameters
- Endpoints β view all configured endpoint definitions
# Clone
git clone https://github.com/sandrineuwineza/rest-api-testing-framework.git
cd rest-api-testing-framework
# Virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
# Install
pip install -r requirements.txt
# Run web dashboard
python app.pyrest-api-testing-framework/
βββ app.py # Flask server + REST API
βββ runner.py # Core test execution engine
βββ requirements.txt
βββ Procfile # Railway / Render deployment
βββ render.yaml
βββ railway.toml
β
βββ config/
β βββ endpoints.json # Endpoint definitions + config
β
βββ validators/
β βββ status_validator.py # HTTP status code validation
β βββ schema_validator.py # JSON schema + field validation
β βββ latency_validator.py # Response time benchmarking
β βββ payload_validator.py # Payload integrity checks
β
βββ exporters/
β βββ postman_exporter.py # Postman Collection v2.1 generator
β
βββ reports/
β βββ report_generator.py # Markdown + JSON report output
β
βββ templates/
β βββ index.html # Modern web dashboard
β
βββ tests/
βββ test_framework.py # 30+ unit + integration tests
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Service health check |
| GET | /api/config |
Return endpoint configuration |
| GET | /api/tags |
List all available tags |
| POST | /api/run |
Run full test suite |
| POST | /api/run/endpoint |
Test a single custom endpoint |
| GET | /api/export/postman |
Download Postman Collection |
| POST | /api/report/markdown |
Download Markdown report |
Example β Run full suite:
curl -X POST http://localhost:5000/api/run \
-H "Content-Type: application/json" \
-d '{}'Example β Run smoke tests only:
curl -X POST http://localhost:5000/api/run \
-H "Content-Type: application/json" \
-d '{"tag": "smoke"}'Example β Test a custom endpoint:
curl -X POST http://localhost:5000/api/run/endpoint \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.github.com/users/sandrineuwineza",
"method": "GET",
"expected_status": 200,
"latency_threshold_ms": 3000
}'Edit config/endpoints.json to add your own API endpoints:
{
"name": "My API Test Suite",
"base_url": "https://api.mycompany.com",
"endpoints": [
{
"id": "get_users",
"name": "GET Users List",
"method": "GET",
"path": "/v1/users",
"expected_status": 200,
"expected_schema": {
"users": "array",
"total": "integer"
},
"expected_fields": ["users", "total", "page"],
"latency_threshold_ms": 1500,
"tags": ["smoke", "users"]
}
]
}The framework auto-generates a Postman Collection v2.1 from your endpoint configuration β including pre-written test scripts for each endpoint.
# Download via API
curl http://localhost:5000/api/export/postman -o collection.json
# Or click "Export Postman" in the dashboardImport the downloaded collection.json directly into Postman.
# All tests
python -m pytest tests/ -v
# With coverage report
python -m pytest tests/ -v --cov=. --cov-report=html
# Specific class
python -m pytest tests/ -v -k TestLatencyValidatorTest coverage: 30+ tests across 5 test classes covering all four validators and the Flask API.
- Push to GitHub
- render.com β New β Web Service
- Connect repo β reads
render.yamlautomatically - Live in ~3 minutes β free forever
- Push to GitHub
- railway.app β New Project β GitHub repo
- Reads
railway.tomlautomatically
API Testing: Status codes Β· Schema validation Β· Payload integrity
Latency benchmarking Β· Response header checks
Python: Modular architecture Β· dataclasses Β· urllib
Concurrent test execution Β· pytest
Postman: Collection v2.1 generation Β· Test scripts
Environment variables Β· Folder structure
Flask: REST API design Β· Route handlers Β· JSON responses
Engineering: Root cause analysis methodology Β· Error handling
SLA threshold management Β· Technical reporting
Documentation: OpenAPI-style endpoint reference Β· Inline docstrings
Professional Markdown report generation
MIT License
Sandrine Uwineza β Technical Support Engineer
π LinkedIn Β· π§ mrs.uwineza@gmail.com Β· π Tlalnepantla de Baz, Estado de MΓ©xico
"Built from real production support experience at Opina Platform β where REST API debugging was the primary diagnostic tool for resolving incidents on a live web application serving active users."