Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

The Authorization header as shown in the AIO Tests API Token.

Code Block
headers = {'Authorization': 'AioAuth <Your API Token>'}

...

As a post-execution step, AIO Tests currently supports the JUnit XML Report format and the TestNG report format.
To import results from either of these formats to AIO Tests, the Import Results API can be used in post-execution listeners/hooks.

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.