Apidog test case
Skill apidog/apidog-cli-skills/.well-known/agent-skills/apidog-test-case
AI Agent Skills for Apidog CLI, helping agents manage API projects, automated tests and CI workflows.
npx -y skills add apidog/apidog-cli-skills --skill apidog-test-caseAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
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.
SKILL.md
8.4 KB, as published. Nobody here has run it
API Test Cases
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.
When To Use
- Create automated test cases under a single endpoint.
- Update test steps, assertions, variable extractors, and pre/post processors.
- List test cases under an endpoint.
- Run API test cases by caseId, endpointId, or categoryId.
- Create or maintain test datasets.
- Diagnose issues such as missing test steps in the client, ineffective assertions, or empty extracted variables.
When Not To Use
- Multi-endpoint workflow orchestration or scenario modeling: use
apidog-test-scenario. - Only running existing scenarios, suites, or CI commands: use
apidog-test-automation. - Only editing API definitions, request parameters, or response models: use endpoint/schema commands from current CLI help.
- Only viewing test reports: use
test-reportfrom current CLI help; useapidog-test-automationfor execution and report boundaries.
Core Concepts
| 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 |
Command Entry Points
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 test-scenario import-steps <scenarioId> --project <projectId> --source test-case --endpoint <endpointId> --ids <testCaseIds> --sync manual
Standard Create Flow
- Confirm project and branch.
- Locate the endpoint with
apidog endpoint list/get. - Run
apidog test-case category --project <projectId>to obtain a validcategoryId; to inspect existing endpoint cases, runapidog test-case list --project <projectId> --endpoint <endpointId>. - If a similar case exists, use
listand thengetone as a template. - Fetch and validate the
test-case-createschema. - Build a complete JSON payload; do not create an empty shell with only name/endpointId.
- After creation, immediately run
test-case get <caseId>and confirm the saved backend structure. - Run once with a local JSON report to confirm requestBody, processors, assertions, and scripts work in the runner.
- If uploading reports, use
test-reportaccording to current CLI help; if report details are missing, useapidog-test-automationfor 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.
Standard Update Flow
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.
Test Step Display Rules
If the user cares about client display, verify all of the following:
- Run
test-case getafter create or update. - Confirm steps, assertions, extractors, and processors were saved by the backend.
- Confirm fields are not empty arrays, empty objects, or written to the wrong level.
- If CLI returns success but the client does not display the data, switch to
apidog-cli-checkupand first confirm project, branch, endpoint, categoryId, and readback structure.
Content And Processor Structure
requestBody.datamust be a string; do not write JSON Body as an object.- Format multiline JSON bodies, pre-scripts, and post-scripts with
\n; this improves client readability without changing execution semantics. preProcessorsandpostProcessorsuse the flat structure{ id, type, data, defaultEnable, enable }; do not use legacy nested{ type, config }.- Prefer stable
idvalues for processors, especiallyassertion,extractor, andcustomScript; missing IDs may validate but still confuse the runner or client parser. - When extracting global variables, use
data.variableType: "globals"; if a scope is needed, preferdata.shareScope: "PROJECT".TEAMis team-wide and may depend on paid capabilities; do not default to it unless explicitly requested. - Always run
cli-schema validatebefore writing andtest-case getafter writing.
Example:
{
"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
}
]
}
Running And Verification
- Run the case after writing when execution behavior matters.
- Use explicit
--environmentfor reproducibility. - Generate a local JSON report when diagnosing runner behavior.
- Do not treat client display success as execution success; validate both saved structure and run result when required.
Common Recovery
| 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 |