The API runs on the HTTP protocol and represents a set of methods by which queries are made and responses are returned for each operation. All responses come in the form of JSON structures.
A user can log in if they have a login and secret key. These should be added to the heads of all API queries. Every user can generate a secret key in their profile settings. Headers required for login:
Key | Value |
SecretKeyBase64 | {secretKeyBase64} |
Authorization | PrivateToken {secretKeyBase64} |
All links to API queries in the current documentation include the base URL of the Test IT system, e.g. http://demo.testit.software/
To get a list of automated runs for a project, send the following query:
GET /api/Public/GetTestRuns/{projectId} (Deprecated)
Where: {projectId} - project ID
Sample cURL query (in general terms):
curl -X POST "http://192.168.88.140/api/Public/GetTestRuns/{projectId}" -H "accept:application/json" -H"SecretKeyBase64: {SecretKeyBase64}" -H "UserName: {UserName}"
Sample cURL query:
curl -X POST "http://192.168.88.140/api/Public/GetTestRuns/3504" -H "accept: application/json" -H "SecretKeyBase64: ZndlUXkyNXFCbkJRUmJvUw==" -H "UserName: admin"
To put a run into "In progress" status, send the following query:
POST /api/Public/StartTestRun/{testRunId} (Deprecated)
Where: {testRunId} - this is a valid launch UUID
Once the query has been completed successfully, the run will enter "In progress" status.
Sample cURL query (in general terms):
curl -X POST "http://192.168.88.140/api/Public/StartTestRun/{ID}" -H "accept: application/json" -H"SecretKeyBase64: {SecretKeyBase64}" -H "UserName: {UserName}"
Sample cURL query:
curl -X POST "http://192.168.88.140/api/Public/StartTestRun/cd2a79db-00cf-4606-adbe00eb6fd0dc4a" -H "accept: application/json" -H "SecretKeyBase64: admin" -H "UserName:ZndlUXkyNXFCbkJRUmJvUw=="
To put a run into "Stopped" status, send the following query:
POST /api/Public/StopTestRun/{testRunId} (Deprecated)
Where: {testRunId} - this is a valid launch UUID
Once the query has been completed successfully, the run will enter "Stopped" status. A result of "Skipped" will be set for all test points for which no results are obtained.
Sample cURL query (in general terms):
curl -X POST "http://192.168.88.140/api/Public/StopTestRun/{ID}" -H "accept: application/json" -H"SecretKeyBase64: {SecretKeyBase64}" -H "UserName: {UserName}"
Sample cURL query:
curl -X POST "http://192.168.88.140/api/Public/StopTestRun/cd2a79db-00cf-4606-adbe00eb6fd0dc4a" -H "accept: application/json" -H "SecretKeyBase64: admin" -H "UserName:ZndlUXkyNXFCbkJRUmJvUw=="
To put a run into "Completed" status, send the following query:
POST /api/Public/CompleteTestRun/{testRunId} (Deprecated)
Where: {testRunId} is a valid launch UUID
Once the query has been completed successfully, the test run will enter "Completed" status. A result of "Skipped" will be set for all test points for which no results are obtained.
Sample cURL query (in general terms):
curl -X POST "http://192.168.88.140/api/Public/CompleteTestRun/{testRunId}" -H "accept:application/json" -H"SecretKeyBase64: {SecretKeyBase64}" -H "UserName: {UserName}"
Sample cURL query:
curl -X POST "http://192.168.88.140/api/Public/CompleteTestRun/cd2a79db-00cf-4606-adbe00eb6fd0dc4a" -H "accept: application/json" -H "SecretKeyBase64: admin" -H "UserName:ZndlUXkyNXFCbkJRUmJvUw=="
To add the result of an autotest to the system, send the following query:
POST /api/v2/testResults (available in Swagger) (Deprecated)
Query body:
{"testRunId": "string","testPlanGlobalId": 0,"autoTestExternalId": "string","configurationGlobalId": 0,"outcome": "string","message": "string","stackTrace": "string","duration": 0,"stepResults": [{"action": "string","duration": 0,"outcome": "string"}]}
Where:
testRunId is a valid run UUID in which the result is received
testPlanGlobalId is the ID of the test plan
autoTestExternalId is a line identifying the external autotest
configurationGlobalId is the ID of the configuration in which the result is received
outcome is the outcome of the test (acceptable values are Passed, Skipped, Blocked, or Failed)
message is an accompanying message (optional field)
stackTrace is an optional stack trace (*optional field)
duration is a positive integer value characterizing the time taken to complete the test in milliseconds
stepResults is a list of steps that have been completed
stepResults.action is the name of a method/step that was called
stepResults.duration is the time it took for a method/step to be completed
stepResults.outcome is the result of a completed method/step
A test case can have multiple autotests. When setting the results of autotests in the test plan, the final result of a test point is compiled based on the following weights:
Status | Status weight |
Passed | 1 |
Skipped | 2 |
Blocked | 3 |
In progress | 4 |
Failed | 5 |
| |
| |
| |
Sample cURL query (in general terms):
curl -X POST "http://192.168.88.140/api/Public/SetAutoTestResult" -H "accept: application/json" -H"SecretKeyBase64: {SecretKeyBase64}" -H "UserName: {UserName}" -H "Content-Type:application/json-patch+json" -d "{ \"testRunId\": \"{testRunId}\", \"testPlanGlobalId\": 0, \"autoTestExternalId\": \"{autoTestExternalId}\", \"configurationGlobalId\": 0, \"status\": \"{Ready/NotReady}\", \"outcome\": \"{Passed/NotPassed/Skipped}\", \"message\": \"string\", \"stackTrace\": \"string\"}"
Sample cURL query:
curl -X POST "http://192.168.88.140/api/v2/testResults" -H "accept: application/json" -H"Authorization: PrivateToken {SecretKeyBase64}" -H "Content-Type: application/jsonpatch+json" -d "{ \"testRunId\": \"{testRunId}\", \"testPlanGlobalId\": 0, \"autoTestExternalId\": \"{autoTestExternalId}\", \"configurationGlobalId\":{configurationGlobalId}, \"outcome\": \"{Passed/Skipped/Blocked/Failed}\", \"message\": \"{message}\", \"stackTrace\": \"{stackTrace}\", \"duration\": {duration}, \"stepResults\": [ {\"action\": \"{action_name}\", \"duration\": {duration}, \"outcome\": \"{Passed/Skipped/Blocked/Failed}\" } ]}"curl -X POST "http://192.168.88.140/api/v2/testResults" -H "accept: application/json" -H"Authorization: PrivateToken a3RxVjJtQlV4RFFOamF5Ng==" -H "Content-Type: application/jsonpatch+json" -d "{ \"testRunId\": \"a547fe79-a441-4d3c-a365-fe639b97a677\", \"testPlanGlobalId\": 16308, \"autoTestExternalId\": \"autotest1\", \"configurationGlobalId\":16250, \"outcome\": \"Passed\", \"message\": \"Test message\", \"stackTrace\": \"TeststackTrace\", \"duration\": 15920, \"stepResults\": [ { \"action\": \"step1\", \"duration\":15920, \"outcome\": \"Passed\" } ]}"
To create a new test run, send the following query:
POST /api/Public/CreateTestRun (Deprecated)
This method creates a new test run in the existing test plan.
Once the query is completed successfully, the GUID of the test run is returned and displayed in the test plan with Pending status. StopTestRun
Query body:
{"projectGlobalId": 0,"testPlanGlobalId": 0,"testPoints": [{"configurationGlobalId": 0,"testCaseGlobalId": 0}]}
Where:
projectGlobalId is a positive number indicating the project's global ID
testPlanGlobalId is a positive number indicating the global test plan's global ID
testPoints is an entity describing test verification. It contains the ID of the test case and configuration
Sample cURL query (in general terms):
curl -X POST "http://192.168.88.140/api/Public/CreateTestRun" -H "accept: application/json" -H "SecretKeyBase64: " -H "UserName: " -H "Content-Type: application/json-patch+json" -d "{ \"projectGlobalId\": 0, \"testPlanGlobalId\": 0, \"testPoints\": [ { \"configurationGlobalId\":0, \"testCaseGlobalId\": 0 } ]}"
Sample cURL query:
curl -X POST "http://192.168.88.140/api/Public/CreateTestRun" -H "accept: application/json" -H "SecretKeyBase64: V1U1YVJXOW9hRTkwTVZaSmNXaHNSQT09" -H "UserName: admin" -H "Content-Type:application/json-patch+json" -d "{ \"projectGlobalId\": 10844, \"testPlanGlobalId\": 10856, \"testPoints\": [ { \"configurationGlobalId\": 10846, \"testCaseGlobalId\": 10852 }, { \"configurationGlobalId\": 10846, \"testCaseGlobalId\": 10850 }, { \"configurationGlobalId\":10846, \"testCaseGlobalId\": 10848 } ]}"
POST /api/Public/attachment
Sample cURL query (in general terms):
curl -X POST "http://192.168.88.140/api/Public/attachment" -H "accept: application/json" -H"SecretKeyBase64: {SecretKeyBase64}" -H "Content-Type: multipart/form-data" -F "file=@{file_path};type=image/jpeg"
Sample cURL query:
curl -X POST "http://192.168.88.140/api/Public/attachment" -H "accept: application/json" -H"SecretKeyBase64: U2VjcmV0S2V5QmFzZTY0" -H "Content-Type: multipart/form-data" -F "file=@file.png;type=image/jpeg"
Login
Generating a secret key
Creating a project
Creating a test case
Creating an autotest
Attaching an auto-test to a test case. Result: the test case is marked as automated
Creating a test plan
Creating a test suite
Adding a configuration to a test suite
Adding an automated test case to a test suite. Result: marked as automated in the "Result 1 test point" section
Creating a test run, i.e. selecting an automated test point and pressing the "Create test run" button
Getting a test run list for the project using GET /api/Public/GetTestRuns/{projectGlobalId}
Launching a test run via POST /api/Public/StartTestRun/{testRunId}
Assigning a result to an autotest via POST /api/v2/testResults
Completing a test run
If all autotest results are set, the test run will enter "Completed" status
To explicitly complte a test run, i.e. put it in "Completed" status, sent POST /api/Public /CompleteTestRun/{testRunId}
To stop a test run, send POST /api/Public/StopTestRun/{testRunId}