api-test-generator·codegen·active

API Test Generator

Reads OpenAPI / GraphQL schemas and emits contract + integration tests. Handles auth, pagination, idempotency, and rate-limit assertions.

EVANcursorclaude-codetrigger · ide
API Test Generator
Reads OpenAPI or GraphQL schemas and emits contract + integration tests covering auth, pagination, idempotency, and rate-limit assertions.
When this skill fires
·An engineer points EVAN at an OpenAPI URL or GraphQL schema file
·A schema change is detected in CI and EVAN regenerates the affected tests
·A Gherkin scenario implies an API call against an endpoint EVAN has schema for
Test layers generated
Contract tests
Verify that the implementation matches the schema:
·Every documented endpoint exists
·Required parameters are validated
·Response shapes match the schema for each documented status code
·Content-Type and other headers conform
Integration tests
Verify behavior beyond the schema:
·Auth — unauthenticated requests get 401, expired tokens get 401, scoped tokens are enforced
·Pagination — cursor stability, total counts, edge cases (empty page, single-page set)
·IdempotencyIdempotency-Key header is honored; replays return the same response
·Rate limiting — 429 is returned at the documented threshold; Retry-After is set
Auth handling
EVAN reads the security schemes section of the OpenAPI doc and generates auth fixtures automatically. For oauth2, it sets up token-fetch helpers; for apiKey, header injection; for custom schemes, it asks once and remembers.
Tests never hardcode tokens. They use environment variables and a token-rotation fixture so the suite remains green when secrets are rotated.
Pagination strategies
EVAN handles three pagination shapes:
·Cursor-based?cursor=...&limit=..., tests for cursor stability across inserts
·Offset-based?offset=...&limit=..., tests for skip-ahead correctness
·Page-based?page=...&size=..., tests for last-page boundary
What it produces
A test file (Playwright or Vitest, configurable):
·One describe per endpoint
·Contract tests in a describe.skip block toggleable per environment
·Integration tests grouped by behavior (auth, pagination, idempotency, rate-limit)
·A fixture file for shared auth + base-URL setup
Example
For POST /api/payments:
·Contract: required fields validated, 400 returned on missing amount, 201 returned on success with Payment shape
·Integration: idempotent on Idempotency-Key, rate-limited at 100 req/min, auth required (Authorization: Bearer)