- 6 Minutes to read
- Print
- PDF
Automation APIs
- 6 Minutes to read
- Print
- PDF
APIs allow you to trigger test and test set executions and retrieve results directly through APIs. These APIs make it easy to integrate automated testing with your CI/CD tools, such as Jenkins and others, by streamlining continuous integration and deployment workflows.
To use automation APIs, follow Panaya’s API setup guide and incorporate them into your CI/CD pipelines to enhance automation efficiency.
Authentication
Read this article explaining how to authenticate to Panaya via API.
Execute Tests
Executes one or more tests and returns the execution event id.
POST: https://{{env}}.panaya.com/api/v1/projects/{{projectID}}/pa/runTests
{
"testIds": [1024, 1025],
"description": "My description",
"webhook":
{
"url": "https://myURL/{eventId}",
"headers": {"X-Auth-Token": "", "Content-Type": "application/json"}
}
}
Note
Webhooks are optional and allow you to be notified when the event is complete.
If notifications are not required, use "webhook": {}
The {eventid} in the Webhook URL is optional.
Execute Test Sets
Executes one or more test sets and returns the event id.
POST: https://{{env}}.panaya.com/api/v1/projects/{{projectID}}/pa/runTestSets
{
"testSetIds": [1,2],
"description": "My description",
"webhook":
{
"url": "https://myURL/{eventId}",
"headers": {"X-Auth-Token": "", "Content-Type": "application/json"}
}
}
Note
Webhooks are optional and allow you to be notified when the event is complete.
If notifications are not required, use "webhook": {}
The {eventid} in the Webhook URL is optional.
Retrieve Test Results
Returns the event information and the run information.
GET: https://{{env}}.panaya.com/api/v1/projects/{{projectID}}/pa/getEvent/{{eventId}}
{
"eventId": 5,
"title": null,
"startTime": 1700748825000,
"endTime": null,
"totalRuns": 1,
"totalTests": 1,
"failedCount": 0,
"passedCount": 0,
"notRunCount": 0,
"invalidCount": 1,
"runingCount": 0,
"summary": 0,
"runResult": "Skipped",
"triggerType": "Planned run",
"executionState": "Completed",
"creationTime": 1700746180000,
"createdBy": "tdx panaya",
"description": null,
"webhook": null,
"queueItems": [
{
"id": 23,
"playerStartTime": null,
"playerEndTime": null,
"duration": null,
"testName": "Create Web Order",
"testId": 11062,
"testNodeId": 32462155,
"plannedRunName": "Run script",
"plannedRunOrderIndex": 1,
"status": 4,
"statusName": "Skipped",
"agent": "Arnaud_Panaya_agent",
"browserType": null,
"browserTypeName": null,
"executionId": null,
"evidenceExists": false,
"historicalResults": null,
"dataSetName": null,
"dataSetValues": null,
"statusDetails": "The test started running, but no result was reported after 24h",
"testDeleted": false,
"stepDeleted": false
}
]
}
Retrieve Test Sets
Returns all the test sets in the project.
Get https://{{env}}.panaya.com/api/v1/projects/{{projectId}}/pa/getTestSets
[
{
"id": 1,
"appId": 1,
"name": "one",
"type": null,
"history": [],
"attachments": [],
"comments": [],
"customTab2CustomFields": {},
"watcherData": {
"extraWatchers": [],
"baseWatchers": [],
"groupsWatchers": [],
"watchersChanged": false
},
"deletedAttachmentsIds": [],
"actionProperties": {
"actionSource": "BY_SITE",
"fromSite": true,
"fromCloneEntity": false,
"fromImport": false,
"fromAnalysis": false,
"singleAction": true
},
"dirtyFields": null,
"customFields": null,
"groupNameToGroupMetadata": {},
"agt": false,
"description": null,
"descriptionStripped": "",
"projectId": 57,
"entityId": 16298932,
"createdBy": 91224,
"testIds": null,
"paExecutionSchedulingIds": null,
"createdByName": "John Doe",
"creationDate": 1735033912000,
"owner": 0,
"ownerName": null,
"numOfTests": 0,
"numOfScheduling": 1,
"newEntity": false,
"hashtags": []
},
{
"id": 2,
"appId": 2,
"name": "two",
"type": null,
"history": [],
"attachments": [],
"comments": [],
"customTab2CustomFields": {},
"watcherData": {
"extraWatchers": [],
"baseWatchers": [],
"groupsWatchers": [],
"watchersChanged": false
},
"deletedAttachmentsIds": [],
"actionProperties": {
"actionSource": "BY_SITE",
"fromSite": true,
"fromCloneEntity": false,
"fromImport": false,
"fromAnalysis": false,
"singleAction": true
},
"dirtyFields": null,
"customFields": null,
"groupNameToGroupMetadata": {},
"agt": false,
"description": null,
"descriptionStripped": "",
"projectId": 57,
"entityId": 16298933,
"createdBy": 91224,
"testIds": null,
"paExecutionSchedulingIds": null,
"createdByName": "John Doe",
"creationDate": 1735033929000,
"owner": 0,
"ownerName": null,
"numOfTests": 2,
"numOfScheduling": 0,
"newEntity": false,
"hashtags": []
}
]
Retrieve Tests from Test Sets
Returns all the tests connected to the test set with the given ID ("appId" from the previous call).
Get https://{{env}}.panaya.com/api/v1/projects/{{projectId}}/pa/getTestsPerTestSet/{{testSetId}}
[
{
"nodeId": 2209408,
"testId": 1011,
"name": "New Automated Test (1)",
"priority": "High",
"status": "Passed",
"dueDate": null,
"inScope": true,
"inScopeDescription": "Yes",
"path": "Automation",
"module": null,
"itOwner": "",
"functionalArea": null,
"businessProcess": null,
"readyToTest": true,
"coverageEntryPoints": 0,
"cycleName": "Automation",
"foundInCycleNodeId": 2209381,
"testDbId": 1900646,
"usage": "Unknown",
"deletedTransaction": null,
"type": "Automated Test",
"changes": null,
"numOfDefects": 0,
"automationStatus": "Ready",
"orderIndex": 1
},
{
"nodeId": 2209382,
"testId": 1003,
"name": "New Automated Test",
"priority": "High",
"status": "Failed",
"dueDate": null,
"inScope": true,
"inScopeDescription": "Yes",
"path": "Automation",
"module": null,
"itOwner": "",
"functionalArea": null,
"businessProcess": null,
"readyToTest": true,
"coverageEntryPoints": 0,
"cycleName": "Automation",
"foundInCycleNodeId": 2209381,
"testDbId": 1900627,
"usage": "Unknown",
"deletedTransaction": null,
"type": "Automated Test",
"changes": null,
"numOfDefects": 1,
"automationStatus": "Ready",
"orderIndex": 2
}
]