Test cases - Get
- TypeScript
- Python
Get all test cases for a given pipeline with getTestCases()
.
Get all test cases for a given pipeline with get_test_cases()
.
Arguments
Return value
Returns an array of TestCases
.
🛠️ TestCase
The TestCase
type represents the structure of a test case in TypeScript. Below are the fields of the TestCase
type.
id
The unique identifier for the test case as a UUID string
createdAt
The timestamp when the test case was created as ISO 8601 string.
archivedAt?
The timestamp when the test case was archived as ISO 8601 string. This can be null
if the test case has not been archived.
updatedAt
The timestamp when the test case was last updated as ISO 8601 string.
expectedOutputs?
An object representing the expected outputs for the test case as a JavaScript object. This can be null
if there are no expected outputs.
inputs
An object containing input data for the test case as a JavaScript object. The object keys are strings with associated values of any type.
name
The name of the test case.
pipelineId
The identifier for the pipeline that the test case is associated with as a UUID string.
Example
typescript
constcases = awaitgetTestCases ("example-pipeline");for (consttestCase ofcases ) {console .log ("Case: ",testCase .name ,testCase .id );}
python
import osimport gentracegentrace.init(api_key=os.getenv("GENTRACE_API_KEY"))cases = gentrace.get_test_cases(pipeline_slug="example-pipeline")for case in cases:print(case.get('id'))