简体   繁体   中英

incorrect mapping of test case XRay with Jira

@Xray(requirement = "QA", test = "TM-3553" ,ProjectName="QA")
@Test()
public void GETGradeForGuestStudent() {

}

why the execution is not getting mapped to TM-3553 Rather its getting mapped always to TM-3601 mapped to jira

my testng report.xml- pastebin.com/iHc4hJmD

In jenkins postbuild action i am calling this sh command

token=$(curl -H "Content-Type: application/json" -X POST --data @"./cloud_auth.json" https://xray.cloud.xpand-it.com/api/v2/authenticate| tr -d '"')
curl -H "Content-Type: application/xml" -X POST -H "Authorization: Bearer $token" --data @"./target/surefire-reports/testng-results.xml" https://xray.cloud.xpand-it.com/api/v2/import/execution/testng?projectKey=TM&testExecKey=TM-3563"

The TestNG XML report you shared seems to have the correct format, as detailed here . The Test issue key is being mapped to an attribute named "test" under the <attributes> element, which in turn is inside the <test-method> element. I changed your XML report, so that the first reference to TM-3553 is one of my existent Tests... and it worked fine in my scenario.

Therefore, I think your scenario needs to be analyzed by the Xray team in more depth to figure out exactly why this association is not being done in Xray side. Let me just add that the annotation you shared is not correct, as "requirement" must be an issue key and "ProjectName" doesn't exist/is supported by Xray during the import process.. Therefore, this needs to be changed:

@Xray(requirement = "QA", test = "TM-3553",ProjectName="QA")

to something like:

@Xray(requirement = "TM-1243", test = "TM-3553")

Another note about the TestNG XML report, is that it contains several references to the same test method GETGradeForGuestStudent .. which I find weird at first sight but it depends on how you're running the tests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM