When to activate
- Generating test suites from OpenAPI specifications
- Creating contract tests to validate API responses against schemas
- Building integration tests for endpoint workflows
- Setting up load tests for performance benchmarks
- Automating regression tests for API changes
When NOT to use
- For unit testing business logic (use language-specific test tools)
- For E2E frontend testing
- For database migration testing
Instructions
- Parse OpenAPI spec. Extract all paths, methods, request bodies, response schemas, and auth requirements.
- Generate contract tests. For each endpoint, validate response status codes, headers, and JSON schema conformance.
- Build integration tests. Chain related endpoints (create → read → update → delete) with data assertions.
- Create edge case tests. Missing fields, invalid types, boundary values, unauthorized access, rate limit triggers.
- Set up test fixtures. Seed data, auth tokens, and environment configs for test isolation.
- Generate load tests. k6 or Artillery scripts targeting critical endpoints with ramp-up scenarios.
- Output test report. Pass/fail summary, coverage %, uncovered endpoints, and performance metrics.
Example
// Contract test — GET /users/{id}
describe('GET /users/{id}', () => {
it('returns 200 with valid user schema', async () => {
const res = await request.get('/users/123', { headers: authHeader });
expect(res.status).toBe(200);
expect(res.body).toMatchSchema(userSchema);
expect(res.headers['content-type']).toContain('application/json');
});
it('returns 404 for non-existent user', async () => {
const res = await request.get('/users/000000', { headers: authHeader });
expect(res.status).toBe(404);
expect(res.body.error.code).toBe('USER_NOT_FOUND');
});
});
1---2name: api-test-generator3description: Generate comprehensive API test suites — contract tests, integration tests, and load tests from OpenAPI specs4allowed-tools: [Read, Write, Bash, Grep]5effort: high6metadata:7 source: https://skillmd.com/skills/uitbreidenos/api-test-generator8---910## When to activate1112- Generating test suites from OpenAPI specifications13- Creating contract tests to validate API responses against schemas14- Building integration tests for endpoint workflows15- Setting up load tests for performance benchmarks16- Automating regression tests for API changes1718## When NOT to use1920- For unit testing business logic (use language-specific test tools)21- For E2E frontend testing22- For database migration testing2324## Instructions25261. **Parse OpenAPI spec.** Extract all paths, methods, request bodies, response schemas, and auth requirements.272. **Generate contract tests.** For each endpoint, validate response status codes, headers, and JSON schema conformance.283. **Build integration tests.** Chain related endpoints (create → read → update → delete) with data assertions.294. **Create edge case tests.** Missing fields, invalid types, boundary values, unauthorized access, rate limit triggers.305. **Set up test fixtures.** Seed data, auth tokens, and environment configs for test isolation.316. **Generate load tests.** k6 or Artillery scripts targeting critical endpoints with ramp-up scenarios.327. **Output test report.** Pass/fail summary, coverage %, uncovered endpoints, and performance metrics.3334## Example3536```javascript37// Contract test — GET /users/{id}38describe('GET /users/{id}', () => {39 it('returns 200 with valid user schema', async () => {40 const res = await request.get('/users/123', { headers: authHeader });41 expect(res.status).toBe(200);42 expect(res.body).toMatchSchema(userSchema);43 expect(res.headers['content-type']).toContain('application/json');44 });4546 it('returns 404 for non-existent user', async () => {47 const res = await request.get('/users/000000', { headers: authHeader });48 expect(res.status).toBe(404);49 expect(res.body.error.code).toBe('USER_NOT_FOUND');50 });51});52```