Install
openclaw skills install my-api-test-automationGenerate complete automated API test cases from interface documentation such as OpenAPI, Swagger exports, Postman collections, Markdown API docs, or endpoint tables. Use when Codex needs to analyze interface docs, generate executable API test cases, add configurable pre-request scripts and post-response assertion scripts, adapt the suite to a user-provided runtime environment, execute the generated tests, and produce a complete test report with pass/fail details, diagnostics, and environment summary.
openclaw skills install my-api-test-automationUse this skill to turn API or interface documentation into an executable automated test suite. Always carry the work through end-to-end: understand the API spec, generate complete test cases, wire pre-request and post-assertion logic, execute the suite in the requested environment, and emit a complete report.
Accept any of these as the source of truth:
Before generating tests, extract at least:
If the documentation is partial, continue by making explicit assumptions and record them in the final report.
Read environment-contract.md when the user provides runtime or environment details or asks to execute the generated suite.
Capture these items before execution:
postman, newman, pytest, or another user-mandated runnerPrefer these execution strategies:
newman when the user environment already relies on Postman collections or JavaScript test scripts.pytest plus requests when the user wants Python-based suites or the environment clearly supports Python better.Run scripts/prepare_test_workspace.py to create a stable workspace skeleton before filling in test logic.
Example:
python scripts/prepare_test_workspace.py --output C:\work\api-test-output --runner postman --env-name sit
Then populate the generated workspace with:
Always create or update case-manifest.json so the report stage can map results back to endpoints and coverage.
Use templates from assets/templates/ when you need a quick starting point.
Pre-request logic should handle things like:
Post-response assertion logic should validate both transport and business semantics:
Keep environment-sensitive values in config or env files rather than hard-coding them into each case.
If the user asks to run the suite, execute it in the provided environment after confirming the runner and prerequisites from the available local context.
Execution checklist:
newman, node, python, pytest, and so on)If the environment is missing a dependency, report the exact blocker and, when appropriate, suggest the minimal install command.
Run scripts/build_test_report.py after execution to generate a human-readable summary and machine-readable JSON report.
Example:
python scripts/build_test_report.py --manifest C:\work\api-test-output\case-manifest.json --results-dir C:\work\api-test-output\reports --output-md C:\work\api-test-output\reports\test-report.md --output-json C:\work\api-test-output\reports\test-report.json
The final report should include:
scripts/prepare_test_workspace.pyCreate a reusable output skeleton with config, report, and script directories plus a starter case-manifest.json.
scripts/build_test_report.pyMerge execution artifacts into a complete Markdown and JSON report.
references/environment-contract.mdRead when runtime or environment details are provided or when deciding how to execute the generated tests.
references/report-contract.mdRead when you need the expected report sections or result-file shape.
assets/templates/Use starter templates for environment config, pre-request script, post-assertion script, and test-plan notes. Copy and adapt them instead of re-creating boilerplate.