...
| Info |
|---|
The Authorization header as shown in the AIO Tests API Token. |
| Code Block |
|---|
headers = {'Authorization': 'AioAuth <Your API Token>'} |
...
| Code Block |
|---|
import requests
def _url(path):
return 'https://tcms.aiojiraapps.com/aio-tcms/api/v1' + path
projectKey = "ATSMPL"
headers = {'Authorization': 'AioAuth <Your API Token>'}
files = {'file': open("testng-results.xml", 'rb')}
data = {'addCaseToCycle': True, 'createNewRun': True}
response = requests.post(_url('/project/{}/testcycle/{}/import/results?type=JUnit'.format(projectKey,cycleKey)),
files=files, data=data,headers=headers)
print(response.text) |
5. Uploading attachment to a case [Swagger]
Attachments can be added to cases via API calls.
| Code Block |
|---|
import requests
projectKey = "ATSMPL"
caseKey = "ATSMPL-TC-1"
headers = {'Authorization': 'AioAuth <Your API Token>'}
files = {'file': ('test.jpeg', open("test.jpeg", 'rb'), 'image/jpeg')}
response = requests.post(_url('/project/{}/testcase/{}/attachment'.format(projectKey, caseKey)), files=files,
headers=headers)
print(response.text) |
For further queries and suggestions, please feel free to reach out to our customer support service via help@aiotests.com.