Test cases - Update
- TypeScript
- Python
Update a single test case with updateTestCase()
.
Update a single test case with update_test_case()
.
Example
typescript
constcaseId = awaitupdateTestCase ({id : "550e8400-e29b-41d4-a716-446655440000",name : "New test case name",})console .log ("Case ID: ",caseId );
python
import osimport gentracegentrace.init(api_key=os.getenv("GENTRACE_API_KEY"))cases = gentrace.get_test_cases(pipeline_slug="testing-pipeline-id")case_id = gentrace.update_test_case(pipeline_slug="example-pipeline",payload={"id": cases[0]["id"],"name": "Updated test case name","inputs": {"d": 1},},)print("Case ID: ", case_id)
Arguments
payload
The payload
argument is a JavaScript payload of the new test case payload (type UpdateTestCase
).
The payload is merged with the existing test case payload. This means that you can update a single field of the test case without specifying the entire test case payload.
These are the possible keyword arguments.
pipeline_slug: str
payload: UpdateTestCase
The payload is merged with the existing test case payload. This means that you can update a single field of the test case without specifying the entire test case payload.
Return value
caseId: str (UUID)
Types
🛠️ UpdateTestCase
This type defines the structure for updating the properties of an existing test case. Below are the fields of the UpdateTestCase
type.
id: string (UUID)
name: string
inputs?: object
expectedOutputs?: object
archived?: boolean