Skip to content

Commit 89de660

Browse files
Update Test Cases doc to reflect removed feature_id and added test_case_steps support
1 parent 0cadacd commit 89de660

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

src/pages/docs/api/test-cases.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ In the response, the steps field is returned as `steps` (not `test_case_steps` a
123123

124124
## Update test case
125125

126-
Updates the top-level fields of a test case. Test case steps are not managed through this endpoint.
126+
Updates the top-level fields of a test case, and optionally its test case steps.
127127

128128
**Endpoint:** `PUT /products/{product_id}/test_cases/{test_case_id}`
129129

@@ -132,14 +132,21 @@ Updates the top-level fields of a test case. Test case steps are not managed thr
132132
- `product_id` (number, required) - ID of the Product
133133
- `test_case_id` (number, required) - ID of the Test Case
134134

135-
All attributes must be provided inside the root object `test_case`. All fields are optional — only the fields you provide are updated.
135+
All attributes must be provided inside the root object `test_case`. All fields are optional — only the fields you provide are updated. `feature_id` is not accepted by this endpoint.
136136

137137
**Request Body:**
138138

139139
- `title` (string, optional) - Title of the test case
140140
- `requirements` (string, optional) - Requirements of the test case
141141
- `target_idx` (string, optional) - Reference of the test case in other system
142-
- `feature_id` (number, optional) - ID of the Feature to move the test case to. Must belong to the same product.
142+
- `test_case_steps` (array[Step], optional) - Array of step objects to create, update, or remove
143+
144+
**Step Object:**
145+
146+
- `id` (number, optional) - ID of an existing step to update or remove. Omit to add a new step.
147+
- `description` (string, optional) - Description of the step
148+
- `target_idx` (string, optional) - Reference of the test case step in other system
149+
- `_destroy` (boolean, optional) - Set to `true` to remove the step identified by `id`
143150

144151
**Example Request:**
145152

@@ -151,7 +158,12 @@ curl -X PUT "https://api.test.io/customer/v2/products/1/test_cases/123" \
151158
-H "Content-Type: application/json" \
152159
-d '{
153160
"test_case": {
154-
"title": "Login Test (updated)"
161+
"title": "Login Test (updated)",
162+
"test_case_steps": [
163+
{ "id": 456, "description": "Navigate to login page (updated)" },
164+
{ "description": "Confirm dashboard is shown" },
165+
{ "id": 789, "_destroy": true }
166+
]
155167
}
156168
}'
157169
```
@@ -162,6 +174,10 @@ curl -X PUT "https://api.test.io/customer/v2/products/1/test_cases/123" \
162174

163175
Returns the updated test case object. See the response shape in [Create a bulk of test cases](#create-a-bulk-of-test-cases) above.
164176

177+
{% callout type="note" %}
178+
If the test case is already in use by a test cycle, its steps are not edited in place — a hidden shadow copy of the test case is created (or reused) and the step changes are applied there instead, so historical test results tied to the original steps remain intact. In that case the response is the shadow copy: it has a different `id` from the one in the request URL, and subsequent requests should use that new `id`. The original `test_case_id` will then return `404` from [Get test case](#get-test-case), same as a deleted-but-in-use test case.
179+
{% /callout %}
180+
165181
## Delete test case
166182

167183
Deletes the specified test case from the product.

0 commit comments

Comments
 (0)