api-testing
强调以 schema 为契约的断言,有助于在 CI 中及早捕获接口回归。
生成针对 REST 与 GraphQL 的自动化测试,包含 schema、鉴权与边界断言。
帮你生成覆盖状态码、头部、鉴权、CRUD 流程与错误边界的 REST 与 GraphQL 自动化测试,支持 Playwright APIRequestContext、Supertest 或独立 HTTP 客户端。适合把 schema 当契约在 CI 验证、避免后端悄然变更破坏前端时用。特别强调用 Zod/AJV 做 schema 验证,并在真实测试环境断言响应形状而非只靠轻量断言。
▸ 展开 SKILL.md 英文原文
Test REST and GraphQL APIs with Playwright APIRequestContext, Supertest, or standalone HTTP clients. Covers schema validation with Zod 4/AJV, auth flow testing, CRUD lifecycle tests, error and header validation, pagination, and performance assertions. Use when: "API test," "endpoint test," "REST test," "GraphQL test," "schema validation," "Postman replacement." Not for: consumer-driven contract verification (Pact, broker) — use contract-testing; browser UI flows — use playwright-automation. Related: contract-testing, test-data-management, ci-cd-integration, playwright-automation.
帮我安装这个 skill:https://raw.githubusercontent.com/petrkindlmann/qa-skills/main/skills/api-testing/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/petrkindlmann/qa-skills/main/skills/api-testing/SKILL.md"<objective> A response that adds a nullable field or quietly drops one slips past `toHaveProperty` spot-checks and silently breaks the frontend in production. Schema-as-contract tests catch that drift in CI, not prod. This skill produces REST and GraphQL API tests that assert response shape, status codes, headers, auth boundaries, and timing — against a real test environment, not a mocked stand-in. </objective> ## Discovery Questions Check `.agents/qa-project-context.md` first — if it exists, use it and skip anything already answered there. Then: 1. **REST, GraphQL, or both?** REST-only suites use standard HTTP assertions. GraphQL needs query/mutation builders and benefits from an introsp