-1

We are using Selenium and JMeter for functional automation and performance testing resp. We are thinking of using JIRA and Zephyr and integrate it with selenium.

I have read some documentation about zephyr integration with selenium using ZAPI. As part of the POC I have installed zephyr for Jira server and ZAPI on my work machine and selenium as well.

We were able to run our selenium scripts (test cases) using ANT build (build.xml) file and generate a HTML file with the test results, now we would like to reflect the same in zephyr.

Could you please help us in integrating selenium with zephyr successfully so we can make a decision on buying zephyr for our project purposes.

What is the Custom script that needs to be written to trigger/collect selenium results and post it to Zephyr for Jira using ZAPI?

maddy
  • 1
  • 2
  • Have you taken a look at their documentation? What efforts have you made? – DejaVuSansMono Dec 09 '16 at 21:17
  • I have gone thru the documentation they have provided (see link below).https://support.getzephyr.com/hc/en-us/articles/204713195-Integrate-Selenium-JUnit-and-ANT-with-Zephyr-for-JIRA-and-ZAPI was successful in generating a HTML report of the selenium test results which is step 4 but i don't get the step 5 on how to show those test results in zephyr via zapi – maddy Dec 09 '16 at 21:20
  • You need to use ZAPI RestApi to update Zephyr Testcases. – Umesh Kumar Dec 23 '16 at 07:07
  • https://getzephyr.docs.apiary.io/#reference/stepresultresource/create-new-stepresult/create-new-execution?console=1 will provide you more insights on zephyr – salsinga Jan 07 '19 at 05:50

1 Answers1

1
First you need to get all Zephyr Test from from JIRA using ZAPi Rest Api.
Once you got all the test id then you update Test Status.
below are few queries you can use to get test information.
By using GET : "http://jira.hk.hsbc/rest/api/latest/project";
get you project id,
then you need to get Version Id GET : http://jira.hk.hsbc/rest/api/latest/project/" + projectId + "/versions";
then you need to get Cycle Id
GET : "http://jira.hk.hsbc/rest/zapi/latest/cycle?projectId=" + projectId + "&versionId=" + versionId;
From here you can get all your Issue Ids : 
GET : "http://jira.hk.hsbc/rest/zapi/latest/execution?projectId=" + projectId + "&versionId=" + versionId
            + "&cycleId=" + cycleId;
After you get your issue IDs you can then set execution status pass fail based on your results:
PUT : https://jira.hk.hsbc/rest/zapi/latest/execution/" + issueId + "/execute

Try this and it will solve you issue, I hope you know how to do HttpGet and Put using java if not follow this: http://stackoverflow.com/questions/1485708/how-do-i-do-a-http-get-in-java
Umesh Kumar
  • 1,387
  • 2
  • 16
  • 34