Third-Party Integration

The REST API makes it very easy for devops, IT operations and developers to integrate Leaptest with any third-party system.

The following is a simple Windows Powershell script that runs a pre-defined Leaptest schedule, polls for the results until they are available and then loops through all failed cases and shows how to get the relevant data structures within. The data can then be pushed to any third-party system such as TFS, JIRA or any other Application Lifecycle Management (ALM) system.

Please note that the script contains no error handling or logging mechanisms. It is meant only to demonstrate the core functionality of integrating Leaptest with a third-party system.

The script consists of four steps:

Step 1: Get the id of the schedule. This is done by a call to the REST API endpoint /api/v1/runSchedules.

Step 2: Run the schedule now. This is done by a call to /api/v1/runSchedules/{schedule id}/runNow, which will instruct the Controller to queue the schedule for execution as soon as possible.

Step 3: Keep polling for the result every 5 seconds until a new result is returned. This is done by a call to /api/v1/runSchedules/state/{schedule id}, which will return either the last old results or a “busy” result until new results are available.

Step 4: If there are any failed cases, iterate through the failed cases and use the data within to understand what went wrong. This can be very useful if for instance the integration is indended to automatically create new bugs in a bug-tracking system such as JIRA.

Running the script will yield results similar to the following:

You can explore the endpoints mentioned above by going to this url: http://localhost:9000/help/index#!/RunSchedules if you have the Controller installed on your own computer.

If you would like to use the REST API to integrate Leaptest with your own systems, feel free to contact prioritysupport@leaptest.com and we’ll do our best to help you get up and running in no time.