The Adaptive API Automation Framework is a modular, extensible API test automation framework built using Python and Pytest, designed to evolve incrementally into a production-grade automation solution.
Rather than focusing on quick test scripts, this framework emphasizes long-term maintainability, clean architecture, and real-world API testing practices.
This repository is developed in private mode and follows a phased roadmap, with documentation intentionally kept stable to reflect professional framework evolution.
This framework is built around the following principles:
- Architecture first, scripts later
- Clear separation of concerns
- Predictable and debuggable execution
- Framework failures should never mask API failures
- Scalability without compromising readability
This framework intentionally avoids automatic retry mechanisms.
Rationale:
- Retries can mask real backend or contract issues
- Deterministic failures improve root cause analysis
- Each failure must be actionable and explainable
Retries may be suitable for resilience testing, but this framework prioritizes correctness, observability, and defect visibility.
- Provide a reusable and extensible API automation foundation
- Abstract HTTP communication and authentication logic
- Support multi-environment execution
- Enable reliable, readable, and scalable test suites
- Prepare the framework for CI/CD and parallel execution
- Tests never call HTTP libraries directly
- API communication flows through a single client abstraction
- Authentication is isolated from test logic
- Environment configuration is externalized
- Fixtures manage lifecycle and dependencies
- Failures represent actual API behavior, not framework issues
adaptive-api-framework/
│
├── core/
│ ├── api_client.py # Centralized HTTP client
│ ├── auth_handler.py # Authentication & headers handling
│ ├── config.py # Application configuration
│ └── path_resolver.py # Reliable path resolution
│
├── auth/
│ ├── generatic_auth.py # Generic Auth Handler with abstract method
│ └── github_pat_handler.py # Specified Auth (Github PAT token)
│
├── tests/
│ ├── conftest.py # Pytest fixtures & setup
│ └── test_*.py # API test cases
│
├── utils/
│ └── logger.py # Logging utility
│
├── .config/
│ └── .env # Environment variables (not committed)
│
├── requirements.txt
└── README.md
The framework uses a single API client abstraction responsible for:
- Executing HTTP requests
- Managing base URLs
- Injecting headers and authentication
- Handling timeouts and request configuration
Benefits:
- No duplicated request logic
- Easier debugging
- Clean extension points for retries, hooks, and tracing
- Token-based authentication (e.g., GitHub Personal Access Token)
- Credentials sourced strictly from environment variables
- Authentication logic fully decoupled from tests
Designed for future support of:
- OAuth-based authentication
- Multiple authentication strategies per environment
- Environment variables loaded using
python-dotenv - Centralized configuration access via
AppConfig - Supports multiple environments (test, staging, production)
BASE_URL=https://api.github.com
TIMEOUT=10
PAT_KEY=your_github_token_here-
Pytest is used as the test runner
-
Fixtures manage shared dependencies (API client, auth context)
-
Tests focus on:
- Status code validation
- Response structure checks
- Core content verification
pytest -vPlanned validation layers include:
- Status code assertions
- Response schema validation
- Business rule validations
- Negative and edge-case testing
- Rate-limit and error handling scenarios
The framework is structured to support:
- Structured request/response logging
- Debug-level tracing
- Failure diagnostics
- Optional integration with reporting tools
Logging is currently minimal by design and will evolve in later phases.
Planned enhancements include:
- Parallel test execution
- Environment-based test selection
- Retry mechanisms
- Tag-based execution
- CI/CD pipeline integration
- Test reporting and metrics
- Phase 1: Core foundation & API client abstraction ✅
- Phase 2: Validation layers & test organization ✅
- Phase 3: Reliability (logging, reporting) ✅
- Phase 4: CI/CD & scalability
- Phase 5: Advanced features (contract testing, observability)
- Development: Active
- Documentation: Stable (long-term)
This project is built for architectural learning and professional growth. It evolves incrementally to mirror real-world automation framework development, rather than presenting a prematurely “complete” solution.
Prasad Helaskar
Automation Tester | Python | API & UI Automation