我对ZAPI(Jira的Zephyr(有问题我需要在创建的执行上标记执行,但当我尝试使用时:Rest API函数:StepResultResource/创建新StepResult/创建新的StepResult
对于先前创建的测试步骤,请使用API访问完全不同的测试。
你能告诉我在执行时需要使用哪个函数来执行测试步骤吗?我的代码:
jsondata = {}
jsondata['stepId'] = ''
jsondata['issueId'] = '25137'
jsondata['executionId'] = '6954'
jsondata['status'] = '1'
data_input = ''
r = requests.post(paths['zapiURL'] + 'latest/stepResult', data_input, jsondata, verify=paths['pathToCertificate'],
auth=(cred.getUser(paths['pathToCredentials']), cred.getPw(paths['pathToCredentials'])))
Rest Api:https://getzephyr.docs.apiary.io/
致问候,
Michal
我找到了一个解决方案。
jsondata={}
jsondata["status"] = data['testStatus']
jsondata["comment"] = data['testComment']
#jsondata["defects"] = data['defects']
headers = {"Content-Type": "application/json"}
r = requests.put(paths['zapiURL'] + 'latest/stepResult/'+data['testId'], json.dumps(jsondata), headers=headers, verify=paths['pathToCertificate'],
auth=(cred.getUser(paths['pathToCredentials']), cred.getPw(paths['pathToCredentials'])))
o = r.content.decode("utf-8")
joutput = json.loads(o)
return joutput