From qa-skills
Generate API test suites using native unit test frameworks (pytest, vitest/jest, JUnit, go test) directly — no intermediate tools.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qa-skills:api-test-generatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate production-ready API test suites using the project's native unit test framework directly. No intermediate tools like Postman, Karate, or SoapUI — tests are written as first-class code using pytest+httpx, vitest+supertest, JUnit+REST-assured, or go test.
Generate production-ready API test suites using the project's native unit test framework directly. No intermediate tools like Postman, Karate, or SoapUI — tests are written as first-class code using pytest+httpx, vitest+supertest, JUnit+REST-assured, or go test.
Use this skill when the user asks for tasks like:
Use this skill for:
Do not use this skill for:
test-smell-detector)security-test-generator)e2e-test-generator)references/http-status-assertions.mdreferences/auth-patterns.mdreferences/test-structure-guide.mdassets/templates/pytest-api/assets/templates/vitest-api/examples/Run these steps in order. Do not skip steps unless a documented fallback branch applies.
Determine API source from one of:
Option A: OpenAPI/Swagger Spec Exists
# Find spec files
find . -maxdepth 3 -name "openapi.*" -o -name "swagger.*" -o -name "api-spec.*" | head -10
Read the spec and extract:
Option B: Source Code Analysis
# Detect framework
grep -rl "FastAPI\|flask\|express\|Spring\|gin\|Echo\|Fiber\|NestJS\|Rails\|Django" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.go" --include="*.rb" . | head -20
Extract endpoints from route definitions:
Option C: User-Provided Endpoint List
If user provides endpoints directly, parse them and confirm before generating.
# Check for existing test files
find . -maxdepth 4 -type f \( -name "test_*.py" -o -name "*.test.js" -o -name "*.test.ts" -o -name "*Test.java" -o -name "*_test.go" -o -name "*.spec.ts" -o -name "*.spec.js" \) | head -30
# Check for test config
find . -maxdepth 2 -name "pytest.ini" -o -name "pyproject.toml" -o -name "jest.config.*" -o -name "vitest.config.*" -o -name "pom.xml" -o -name "build.gradle" | head -10
If tests exist, read a sample to match the project's style:
Always use the project's native test framework. No intermediate tools.
| Project language | Default framework | HTTP client |
|---|---|---|
| Python (FastAPI/Flask/Django) | pytest | httpx (async) or requests |
| JavaScript/TypeScript (Express/NestJS) | vitest or jest | supertest or fetch |
| Java (Spring) | JUnit 5 | REST-assured or WebTestClient |
| Go (Gin/Echo/Fiber) | go test | net/http/httptest |
| Kotlin (Ktor/Spring) | JUnit 5 | REST-assured or ktor-client |
If the project already has tests, match the existing framework and style. User can override.
Only read references matching the generation needs:
| Need | Read this file |
|---|---|
| Status code assertion patterns | references/http-status-assertions.md |
| Auth test setup (OAuth2, JWT, API key) | references/auth-patterns.md |
| Test file structure and organization | references/test-structure-guide.md |
For each endpoint, generate tests covering:
Required test categories (always generate):
Conditional test categories (generate when applicable):
Test structure rules:
test_<action>_<condition>_<expected_result>Based on framework:
## API Test Generation Report
- **Source**: <OpenAPI spec | source code | user-provided>
- **Framework**: <pytest | jest | JUnit | etc.>
- **Endpoints covered**: <count>
- **Test files generated**: <count>
- **Total test cases**: <count>
### Generated Files
| File | Endpoints | Test count |
|---|---|---|
| <file> | <endpoints> | <count> |
### Test Categories Coverage
| Category | Count |
|---|---|
| Happy path | <n> |
| Input validation | <n> |
| Auth | <n> |
| Not found | <n> |
| Schema validation | <n> |
### How to Run
\`\`\`bash
<exact command to run tests>
\`\`\`
### Dependencies to Install
\`\`\`bash
<install command>
\`\`\`
Condition: Cannot determine endpoints from spec or code.
Action:
METHOD /path — descriptionTODO since no schema is availableCondition: Language/framework not in the supported table.
Action:
Condition: Only some endpoints are discoverable.
Action:
Consider this skill execution complete only when:
references/http-status-assertions.mdreferences/auth-patterns.mdreferences/test-structure-guide.mdassets/templates/examples/npx claudepluginhub umitozdemirf/qa-skills --plugin qa-skillsBuild API test suites — endpoint testing, contract testing, load testing for REST/GraphQL/gRPC APIs. Use when asked to "test this API", "API tests", "endpoint testing", "contract tests", or "load test".
Builds API test suites for endpoint integration, contract verification, and load testing on REST/GraphQL/gRPC APIs using tools like Supertest, Pact, k6.
Automates testing of REST/GraphQL API endpoints from OpenAPI specs: generates requests, validates schemas/responses, covers auth, CRUD, errors, idempotency. Supports Supertest, pytest, REST-assured.