npx skills add ...
npx skills add https://apidog.com --skill apidog-test-case
Apidog API test cases: query, create, update, delete, categorize, and run test-case and test-data resources; handle test steps, assertions, variable extractors, pre/post processors, datasets, and client display issues after CLI writes.
npx skills add https://apidog.com --skill apidog-test-case
Prerequisite: read
../apidog-cli/SKILL.mdfirst. If the stable entry skill conflicts with this domain skill, use the current CLI help and this skill as the source of truth. For API definitions, follow current CLI help for endpoint, schema, folder, and related commands. For multi-step flows, read../apidog-test-scenario/SKILL.md.
Always use the current CLI help for exact arguments. When creating or updating API test cases, pay special attention to categoryId display risks, the boundary between test-case and test-scenario, requestBody/processor/assertion/extractor structure, and run-time verification. Agents must validate payloads with cli-schema validate before writing, then use get to confirm the saved structure.
apidog-test-scenario.apidog-test-automation.test-report from current CLI help; use apidog-test-automation for execution and report boundaries.| Concept | CLI resource | Notes |
|---|---|---|
| API test case | test-case | Test data and steps bound to an endpoint |
| Test category | test-case category | Test case category; use it to obtain a valid categoryId before creating a case |
| Test dataset | test-data | Data source for iteration runs |
| API definition | endpoint | Dependency of a case; not the case itself |
| Test scenario | test-scenario | Multi-step workflow orchestration with different boundaries |
Use current CLI help for test-case, test-data, and apidog run --test-case. Use test-case category to obtain categoryId; current test-case category does not support --endpoint. To view cases under an endpoint, use test-case list --endpoint <endpointId>. apidog run --test-case accepts only caseId.
When importing a single-endpoint case into a test scenario, do not handwrite scenario steps in this skill. Switch to apidog-test-scenario and use:
apidog endpoint list/get.apidog test-case category --project <projectId> to obtain a valid categoryId; to inspect existing endpoint cases, run apidog test-case list --project <projectId> --endpoint <endpointId>.list and then get one as a template.test-case-create schema.test-case get <caseId> and confirm the saved backend structure.test-report according to current CLI help; if report details are missing, use apidog-test-automation for local/cloud report boundaries.categoryId is a key required field for client display, not an ordinary optional category. An invalid categoryId may make a case visible to CLI get/list but invisible or unusable in the client category list. Always obtain a valid ID with test-case category before creating a case.
Before updating, always get the original structure and modify that complete structure. Then validate against test-case-update schema to avoid losing existing steps, assertions, variable extractors, or processors. update is not JSON Patch and does not merge array elements by id.
The test-case-create and test-case-update schemas include processor, assertion, extractor, and enum documentation. When writing processors for the first time, read the schema first; do not guess field names, enum values, or legacy formats. Current test-case-update validates processor data by type; for example, extractor validates variableType/subject/shareScope, assertion validates subject/comparison, and delay requires numeric data.
test-case get may return an empty string for method. This does not mean the client displays the HTTP method incorrectly; the client usually displays it from the bound endpoint. Current test-case-update schema accepts this readback structure. Do not guess and rewrite the method unless the user explicitly asks to change the bound endpoint or request method.
If the user cares about client display, verify all of the following:
test-case get after create or update.apidog-cli-checkup and first confirm project, branch, endpoint, categoryId, and readback structure.requestBody.data must be a string; do not write JSON Body as an object.\n; this improves client readability without changing execution semantics.preProcessors and postProcessors use the flat structure { id, type, data, defaultEnable, enable }; do not use legacy nested { type, config }.id values for processors, especially assertion, extractor, and customScript; missing IDs may validate but still confuse the runner or client parser.data.variableType: "globals"; if a scope is needed, prefer data.shareScope: "PROJECT". TEAM is team-wide and may depend on paid capabilities; do not default to it unless explicitly requested.cli-schema validate before writing and test-case get after writing.Example:
--environment for reproducibility.| Symptom | Action |
|---|---|
| Case created but missing in client | Check project, branch, endpoint, and valid categoryId |
| Steps missing after update | Rebuild from full get output; update does not patch arrays |
| Assertion does not run | Check processor type, data, enable, and generated report |
| Extracted variable is empty | Check subject, JSONPath, response shape, variableType, and shareScope |
| New CLI parameter is missing | Use apidog-cli-checkup to verify version and help |
{
"requestBody": {
"type": "application/json",
"data": "{\n \"name\": \"Demo\",\n \"description\": \"Readable in client\"\n}"
},
"postProcessors": [
{
"id": "postProcessors.0.customScript",
"type": "customScript",
"data": "pm.test('returns id', function () {\n var body = pm.response.json();\n pm.expect(body.data.id).to.exist;\n});",
"defaultEnable": true,
"enable": true
},
{
"id": "postProcessors.1.extractor",
"type": "extractor",
"data": {
"variableName": "project_pet_name",
"variableType": "globals",
"shareScope": "PROJECT",
"subject": "responseJson",
"expression": "$.name"
},
"defaultEnable": true,
"enable": true
}
]
}