I am trying to call "POST /rest/raven/1.0/import/execution/cucumber/multipart" for Import Execution Results - REST
As this endpoint allows you to send two JSON files, I am written the below karate test
@UploadResultMultiPartURL Scenario: To export execution result to xray Test plan Given path 'import/execution/cucumber/multipart' And header Authorization = 'Bearer ' + accessToken And 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' } When method post And print response
How ever I am karate response
15:50:50.334 [print] {
"error": "Unexpected field (result)"
}
I have attached my karate result file for the reference. Please let me where I am going wrong.
Also I have tried the same with rest api and I am to upload result with that but not sure where I am going wrong with karate: 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();