Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

xRay integration with test frameworks

Tripthi Shetty
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 30, 2024

 

Hi ,

I am currently trying to import automated test results in XML format into a test plan in Xray that contains test cases of type 'manual' (not of type 'Generic'). I am using the following curl command for the import:

curl -s -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $TOKEN" --data @"$file" ${XRAY_BASE_URL}/api/v2/import/execution/junit?projectKey=XP&testPlanKey=$XRAY_TestPlanKey

The import completes successfully and creates an execution for the test plan. However, it results in duplicate test cases being created, rather than updating the existing test cases within the test plan. I get a warning message that says “ Test associated with test execution but not with Test plan” which implies the issueKeys are not getting mapped correctly

Here is an example of the XML test result file:

Reference: https://docs.getxray.app/display/XRAYCLOUD/Taking+advantage+of+JUnit+XML+reports#TakingadvantageofJUnitXMLreports-Testissueid/keyTestissueid/key

 

<?xml version="1.0" encoding="UTF-8"?>

<testsuite name="" tests="2" failures="0" flakes="0" errors="0" skipped="0" time="168.441" hostname="localhost">

 <testcase name="a_7_articles" classname="com.wsl.noom.NWExistingUserTestSuite" time="86.107">

    <properties>

      <property name="issuekey" value="XP-749"/>

    </properties>

   </testcase>

   <testcase name="c_11_savedMealsTest" classname="com.wsl.noom.NWExistingUserTestSuite" time="82.334">

  <properties>

       <property name="issuekey" value="XP-766"/>

  </properties>

  </testcase>

 </testsuite>

Is there anything I am missing in the process, or do I need to adjust my approach to ensure that the existing test cases are updated instead of duplicated? P.S. Using Cloud Xray

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events