Build an API contract test matrix
Derive expected responses from a supplied contract, including failure and permission cases.
Requirements
A text model and the actual API contract. Executing tests requires the target environment.
Fill and copy
Final prompt
Using {{api_contract}}, design tests for {{endpoint}}. Cover a normal request, missing required fields, boundary values, invalid types, authentication, authorization and pagination where applicable. For each case give request, expected status and body assertions, with the contract passage supporting the expectation. Mark unspecified behavior as a question. Do not invent endpoints, execute requests or claim tests passed. Output the matrix before any test code. Fill in all variables to copy the completed prompt.
View original template
Original prompt
根据 {{接口契约}},为 {{目标接口}} 设计测试。按适用性覆盖正常请求、必填项缺失、边界值、无效类型、身份验证、权限和分页。每例给出请求、预期状态码、响应断言及支持该预期的契约段落。未定义行为列为问题。不要编造接口、执行请求或宣称测试通过。先输出测试矩阵,再考虑测试代码。Translation
Using {{api_contract}}, design tests for {{endpoint}}. Cover a normal request, missing required fields, boundary values, invalid types, authentication, authorization and pagination where applicable. For each case give request, expected status and body assertions, with the contract passage supporting the expectation. Mark unspecified behavior as a question. Do not invent endpoints, execute requests or claim tests passed. Output the matrix before any test code.