Xray integration with jenkins pipeline

1.2k Views Asked by At

I need any sample project where they ran some test cases and generated a XML report which contains project key,status of the test case and then pushed into JIRA Xray

using TestNGXML

Kindly help me with proper example , not getting any help from google sites and official documentation

1

There are 1 best solutions below

2
On

I'm not sure whether you're using Xray on Jira server/datacenter or Jira cloud, as you've not identified and that changes a bit the links on the answer. In general terms, you need to generate the TestNG XML as usual and then you need to submit that from the Jenkins pipeline. With TestNG you may, optionally, provide some annotations on the test code, for example to link the result to an existing Test issue.. on the tutorial shared you can see how to achieve that. If you don't need this, it's simpler as you ou just need to tag the methods with @Test and generate the XML report and then publish it to Xray.

For Xray on Jira server/datacenter,

  • please checkout this tutorial
  • on the pipeline configuration, please check this; there is more info on this page that I would advise you to have a look at

For Xray on Jira cloud,

  • please checkout this tutorial
  • on the pipeline configuration, please check this; there is more info on this page that I would advise you to have a look at. You may see some sample pipeline configuration there, but I would advise to configure a jenkins job using the UI and then generate the pipeline script; more info here