Skip to main content

Test Cases

Test cases are the core data model in QA Hub. Each has a unique code, Gherkin BDD content, and metadata.

Endpoints

MethodPathScopeDescription
GET/api/v1/casesreadList test cases
POST/api/v1/caseswriteCreate a test case
GET/api/v1/cases/{id}readGet a single test case
PATCH/api/v1/cases/{id}writeUpdate a test case
DELETE/api/v1/cases/{id}writeDelete a test case

The {id} parameter accepts either the cuid (clxyz...) or the human-readable code (TC-001).

List test cases

GET /api/v1/cases?project_id=clxyz123&status=READY&limit=50&offset=0
Authorization: Bearer qh_...

Query parameters

ParameterTypeDefaultDescription
project_idstringFilter by project
statusstringDRAFT, READY, or DEPRECATED
limitinteger100Max records (max 500)
offsetinteger0Pagination offset

Response

{
"data": [
{
"id": "clcase001",
"code": "TC-001",
"title": "Guest checkout — successful order",
"bdd_content": "Feature: Guest checkout\n\n Scenario: ...",
"status": "READY",
"priority": "HIGH",
"layer": "UI",
"is_e2e": true,
"automation_status": "MANUAL",
"tags": ["checkout", "guest"],
"tickets": [{ "key": "PROJ-42", "source": "JIRA" }]
}
],
"pagination": { "total": 148, "limit": 50, "offset": 0 }
}

Create a test case

POST /api/v1/cases
Authorization: Bearer qh_...
Content-Type: application/json

{
"title": "Login — invalid password shows error",
"bdd_content": "Feature: Login\n\n Scenario: Invalid password\n Given the user is on the login page\n When they enter an incorrect password\n Then an error message is displayed",
"project_id": "clxyz123",
"status": "DRAFT",
"priority": "HIGH",
"layer": "UI",
"is_e2e": false,
"tags": ["auth", "login"],
"tickets": [{ "key": "PROJ-10", "source": "JIRA" }]
}

Required fields: title, bdd_content

Update a test case

PATCH /api/v1/cases/TC-001
Authorization: Bearer qh_...
Content-Type: application/json

{
"status": "READY",
"automation_status": "AUTOMATED"
}

Only include the fields you want to change. All fields are optional in a PATCH request.

Automation status values

ValueMeaning
MANUALExecuted manually only
IN_PROGRESSAutomation is being written
AUTOMATEDHas a passing automated test
FLAKYAutomated but unstable
ARCHIVEDNo longer maintained