Test cases - Update
- TypeScript
- Python
Update a single test case with updateTestCase()
.
Update a single test case with update_test_case()
.
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.
pipelineSlug
This is the slug of the pipeline that the test case belongs to.
payload
The payload
argument is the 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.
Return value
Case ID
The ID of the updated test case as a UUID string.
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)
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
The ID of the test case to update as a UUID string.
name
The name of the test case as a string. This field is optional and can be null
.
inputs?
The inputs for the test case. This field is optional and can be null
, representing the input data as a JSON object.
expectedOutputs?
The expected outputs for the test case. This field is optional and can be null
, representing the expected output data as a JSON object.
archived?
The archive status of the test case as a boolean. This field is optional and can be null
. If true, the test case is considered archived.