Eliminating Testing Boilerplate
General-purpose HTTP libraries like requests or httpx are effective for making calls but require significant "glue code" for testing—such as manual JSON parsing, status code checks, and retry loops. APItestGenie abstracts these tasks into a ResponseWrapper object, allowing developers to chain assertions and handle complex responses without writing repetitive validation logic.
Core Features for Reliable Testing
- Chainable Assertions: Built-in methods like
assert_status,assert_json_key, andassert_json_valueallow for concise, readable test scripts. - Nested Path Validation: The library supports dot-notation (e.g.,
user.address.city) to verify deeply nested JSON structures, removing the need to manually unpack dictionaries. - Configurable Retry Logic: To handle flaky environments, the library includes native support for retries based on network failures or specific HTTP status codes (e.g., 500, 503), configurable via simple parameters like
retriesandretry_delay. - Flexible Modes: It provides a "Simple" mode for quick, one-off scripts and a "Client" mode for larger suites that require shared base URLs, headers, and session management.
Future Roadmap
Currently in version 1.0, the project focuses on stability and core HTTP verbs. Future development aims to further reduce manual effort through LLM-powered test generation, schema validation, and integration with BDD frameworks like Robot Framework and Behave.