1

I am trying to integrate XRAY with webdriver IO , mocha using the guide below

https://docs.getxray.app/display/XRAYCLOUD/Testing+web+applications+using+Mocha+and+WebdriverIO#tab-API

The below -

curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "CLIENTID","client_secret": "CLIENTSECRET" }' https://xray.cloud.xpand-it.com/api/v1/authenticate

needs client Id and client secret which is not available for our JIRA implementation.

so , I only have username and password , how do i use it to achieve above ?

Thanks,

Mahima.

Mahima
  • 43
  • 5

1 Answers1

1

If you have a Jira username and password is what you have available, then you're most probably using Xray on Jira server/datacenter and not Xray on Jira Cloud. Therefore, the tutorial you should look at it is this one: https://docs.getxray.app/display/XRAY/Testing+using+WebDriverIO+and+Cucumber+in+JavaScript

In terms of request, it is simpler as you don't need to perform that initial authentication request.

Sérgio
  • 1,777
  • 2
  • 10
  • 12
  • @Mahima, was my answer able to clarify your question? If so, can you please mark my answer as correct? Otherwise, please let me know, so I can see I can help you further – Sérgio Nov 04 '21 at 11:17
  • Yes , webdriver mocha test successfully sent to X-ray using the above approach , thanks Sergio. – Mahima Nov 12 '21 at 02:45
  • I have a query though. I followed following URL: to resolve my issue: https://docs.getxray.app/display/XRAY/Testing+using+WebDriverIO+and+Cucumber+in+JavaScript# Couldn't find a way to tag/map a motcha/webdriverio testcase to respective xray test case. Its creating a new test case everytime. Would be helpful if you can help...Thanks in advance – Mahima Nov 12 '21 at 04:43
  • 1
    Well, importing test results should just create tests the first time and then will reuse them if you import results once again. If this is not the case, then there is a bug and pls report it to Xray support. Tagging mocha tests is not officially supported. However pls check this PR I have made and try to use it. https://github.com/michaelleeallen/mocha-junit-reporter/pull/153 . This is unofficial though and there is no documentation on it – Sérgio Nov 12 '21 at 09:31
  • 1
    thanks @sergio. This helps to an extent. In my scenario, we already have a huge test set and part of which is automated. I will try the workaround you have suggested. Thanks. – Mahima Nov 14 '21 at 22:09
  • @Mahima, Can you please post the working curl command here. Thanks – Vijay Nag Feb 27 '23 at 05:40
  • curl -H "Content-Type: multipart/form-data" -u "username":"${PASSWORD_XRAY}" -F "file=@results.xml" "${URL}?projectKey=${projectKey}&testPlanKey=${testPlanKey}" --ssl-no-revoke --insecure Update the parameters as required. – Mahima Jun 29 '23 at 23:50