我正在尝试为导入执行结果调用“POST /rest/raven/1.0/import/execution/cucumber/multipart” - REST
由于此端点允许您发送两个 JSON 文件,因此我编写了以下空手道测试
@UploadResultMultiPartURL 场景:将执行结果导出到 xray 测试计划给定路径 'import/execution/cucumber/multipart' 和 header Authorization = 'Bearer' + accessToken 和 multipart file info = { read('classpath:data/testplanwithkey.json') , filename: 'testplanwithkey.json', contentType: 'application/json' } and multipart file result = { read('classpath:JiraReports/cucumber.json'), filename: 'cucumber.json', contentType: 'application/json ' } 当方法发布并打印响应时
我怎么是空手道响应
15:50:50.334 [打印] {“错误”:“意外字段(结果)”}
我已附上我的空手道结果文件以供参考。请让我哪里出错了。
我也尝试了与rest api相同的方法,我将使用它上传结果,但不确定空手道哪里出了问题: ResponseBody responseBody = given() .multiPart("results", new File(CUCUMBER_RESULT_FILE)) .mul .multiPart("info", "info.json", jiraExecutionJson.getBytes()) .header("Authorization", "Bearer " + jiraTokenGenerator.getXrayToken()) .post(JIRA_IMPORT_EXECUTION_MULTIPART_URL) .getBody();