Schedule, Update and Delete a test plan using API


With Testsigma, you can create, update, and delete a schedule for test plan using API. You can also set the test plan execution in the queue to start tests outside office hours so that production time is not lost.

For more information on test plans, refer to manage test plans.

Test plan details using REST API

This endpoint allows users to get all test plans using REST API.

Request Type GET
Endpoint https://app.testsigma.com/api/v1/test_plans
Params query=applicationVersionId:<versionid>
Response Body (JSON) {
 "content": [{
 "id": 185,
 "applicationVersionId": 52,
 "name": "TP 1"
 <Other data>
 }]
 }
NOTE:

applicationVersionId: The ID of the application version where you want to schedule the test plan.

Schedule a test plan using REST API

This endpoint allows users to schedule a test plan using REST API.

Request Type POST
Endpoint https://app.testsigma.com/api/v1/schedule_executions
Authorization Bearer <API_Token>
Same as the Testsigma API key mentioned above.
Request Body Type (JSON) Raw
Payload
{
"name": "New Test Plan Schedule",
"executionId": 180,
"scheduleType": "ONCE",
"status": "ACTIVE",
"nextInterval": "2022-12-14T11:13:00.000",
"timezone": "EST"
}
Response Body(JSON)
{
"id": 21,
"executionId": 180,
"name": "New Test Plan Schedule",
"comments": null,
"scheduleType": "WEEKLY",
"nextInterval": 1671016380000,
"nextIntervalUTC": "2022-12-14T11:13:00Z",
"createdById": 10,
"createdDate": 1671006911289,
"updatedById": 10,
"updatedDate": 1671006911289,
"status": "ACTIVE"
}

Request fields
name: The name you want to give to test schedule.
scheduleType: How frequently you want to run tests ('ONCE' , 'HOURLY' , 'DAILY', 'WEEKLY', 'MONTHLY').
nextInterval: Date and time (yyyy-MM-dd'T'HH:mm:ss.SSS) to trigger the test plan. [Sample data: 2022-12-14T11:13:00.000]
timezone: The timezone you want to follow.
executionId: Test plan ID from get API.

Response fields
id: The ID of the Project in which you want to schedule a test plan.
executionId: Test plan ID from get API.
name: The name you want to give to the test schedule.
scheduletype: How frequently you want to run tests ('ONCE' , 'HOURLY' , 'DAILY', 'WEEKLY', 'MONTHLY').
nextinterval: Date and time (yyyy-MM-dd'T'HH:mm:ss.SSS) to trigger the test plan. [Sample data: 2022-12-14T11:13:00.000]
createdById/updatedById: The user ID of the creator/updater
createdDate/updatedDate: Date when the asset is created/updated.
Payload: The Request Body types.

Update a scheduled test plan using REST API

This endpoint allows users to update a scheduled test plan using REST API.

Request Type PUT
Endpoint https://app.testsigma.com/api/v1/schedule_executions/<scheduleId>
Authorization Bearer <API_Token>
Same as the Testsigma API key mentioned above.
Request Body Type (JSON) Raw
Request Body
{
"name": "Updated schedule",
"executionId": 180,
"scheduleType": "WEEKLY",
"status": "ACTIVE",
"nextInterval": "2022-12-20T15:28:00.000",
"timezone": "PST"
}
Response Body(JSON)
{
"id": 16,
"executionId": 180,
"name": "Updated schedule",
"comments": null,
"scheduleType": "WEEKLY",
"nextInterval": 1671578880000,
"nextIntervalUTC": "2022-12-20T23:28:00Z",
"createdById": 9,
"createdDate": 1670995456000,
"updatedById": 10,
"updatedDate": 1671548631732,
"status": "ACTIVE"
}
NOTE:

scheduleId: The ID of the required schedule of the plan selected

Delete a scheduled test plan using REST API

This endpoint allows users to delete a scheduled test plan using REST API.

Request Type DELETE
Endpoint https://staging.testsigma.com/api/v1/schedule_executions/<scheduleId>
NOTE:

DELETE method will delete the respective schedule and return status code 202.