how to upload junit test result file to existing test cycle
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2022
02:46 AM
05-19-2022
02:46 AM
how to upload junit test result file to existing test cycle
- As of now every time when we upload the junitresult.xml file into the zephyr scale, it creates a new test cycle. but I want to upload it to the existing test cycle and to a specific folder in the same post-call. which is not happening now.
- to customize the test cycle name I am sending the test cycle JSON object along with the junitresultfile.xml but, post-call is ignoring the test cycle JSON object.
below is my request:
import json
import requests
def upload_result_to_zyphyr():
headers = {
'Authorization': 'Bearer Token'
}
params = (
('projectKey', 'xxx'),
('autoCreateTestCases', 'true'),
)
payload = {
"name": "Sanity",
"description": "Any additional description can be added here.",
"jiraProjectVersion": 'null',
"folderId": 1111111,
}
files = {
'file': open('junitresult.xml', 'rb'),
}
data = {'data': json.dumps(payload)}
response = requests.post('https://api.zephyrscale.smartbear.com/v2/automations/executions/junit', headers=headers,params=params, data=data, files=files)
print(response.content)
upload_result_to_zyphyr()
Response:
I am getting a successful response with 200 OK and the result file is getting uploaded into the test cycle but, test cycle customization is not working.
Any suggestion on the above-mentioned points will be really appreciable.
Labels:
- Labels:
-
CommunityNews
-
InsideZephyrScale
-
Migration
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023
04:45 PM
01-31-2023
04:45 PM
I also have this problem - trying to make a POST request and additional JSON which contains information on test cycle for Zephyr scale is always ignored.
putting this as another Key "testCycle" in the form-data with value
{
"name":"regression overlays",
"description":"regression testing",
"jiraProjectVersion":1,
"folderId":7367090,
"customFields":null
}
trying to following this API doco
get a request back but test cases are not put inside test cycle which suggest JSON part of request is being ignored.
{
"testCycle": {
"id": 8411568,
"key": "ICRMK-R70"
}
}
