← Back to all products
$29
API Testing Automation
Postman collections, Newman CI integration, contract testing with Pact, and load testing with k6 scripts.
PythonYAMLTOMLJSONMarkdown
📁 File Structure 8 files
api-testing-automation/
├── LICENSE
├── README.md
├── config.example.yaml
├── pyproject.toml
├── scripts/
│ ├── api_client.py
│ └── file_processor.py
└── tests/
├── conftest.py
└── test_core.py
📖 Documentation Preview README excerpt
API Testing Automation
Postman collections, Newman CI integration, contract testing with Pact, and load testing with k6 scripts.
Contents
config.example.yamlpyproject.tomlscripts/api_client.pyscripts/file_processor.pytests/conftest.pytests/test_core.py
Quick Start
1. Extract the ZIP archive
2. Review the README and documentation
3. Customize configuration files for your environment
4. Follow the setup guide for your specific use case
Requirements
- Python 3.10+ (for Python scripts)
- Relevant CLI tools for your platform
- Access to your target environment
License
MIT License — see LICENSE file.
Support
Questions or issues? Email megafolder122122@hotmail.com
---
Part of [Api Developer](https://inity13.github.io/api-developer-pro/)
📄 Code Sample .py preview
scripts/api_client.py
"""Generic API client with retry logic."""
import urllib.request
import urllib.error
import json
import time
from typing import Any, Dict, Optional
class APIClient:
"""HTTP API client with retry and error handling."""
def __init__(self, base_url: str, token: Optional[str] = None, max_retries: int = 3):
self.base_url = base_url.rstrip("/")
self.token = token
self.max_retries = max_retries
def _headers(self) -> Dict[str, str]:
headers = {"Content-Type": "application/json", "Accept": "application/json"}
if self.token:
headers["Authorization"] = f"Bearer {self.token}"
return headers
def request(self, method: str, path: str, data: Optional[Dict] = None) -> Dict[str, Any]:
url = f"{self.base_url}{path}"
body = json.dumps(data).encode() if data else None
for attempt in range(self.max_retries):
try:
req = urllib.request.Request(url, data=body, headers=self._headers(), method=method)
with urllib.request.urlopen(req, timeout=30) as resp:
return json.loads(resp.read())
except urllib.error.HTTPError as e:
if e.code >= 500 and attempt < self.max_retries - 1:
time.sleep(2 ** attempt)
continue
raise
except urllib.error.URLError:
if attempt < self.max_retries - 1:
time.sleep(2 ** attempt)
continue
raise
def get(self, path: str) -> Dict[str, Any]:
return self.request("GET", path)
def post(self, path: str, data: Dict) -> Dict[str, Any]:
return self.request("POST", path, data)
def put(self, path: str, data: Dict) -> Dict[str, Any]:
return self.request("PUT", path, data)
# ... 4 more lines ...