codeceptjs-xray-helper is a CodeceptJS helper which can publish tests results on XRAY api after tests execution.
npm install codeceptjs-xray-helper --save
This plugin should be added in codecept.json/codecept.conf.js
Example:
{
...
plugins: {
xrayReport: {
require: "codeceptjs-xray-helper",
enabled: true,
debug:false,
jira_url: 'https://localhost-jira',
jira_user: 'root',
jira_password: 'root',
test_revison: '001',
testEnvironments: '["browser:chrome", "linux"]',
testsExportedFromTestExecution:false
}
...
}
Your JIRA host url for exemple: http://localhost:8080
Your JIRA user keys, only for jira server
if you are in jira cloud you have to set theses options
to get your cloud clientId see: https://docs.getxray.app/display/ProductKB/%5BXray+Cloud%5D+How+to+use+REST+API+with+Xray+for+Jira+Cloud
You can send your test revision (it could be your feature name for example).
If this config is empty 001
will be sent to xray instead
Test environnement that will be set on Test Environnements
field in Test Execution
issue
to turn on the debug mode for the helper
not mandatory, set to true
if you have exported your cumcumber files from Test Plan
or Test Set
:
New Test Execution
will be generated
not mandatory, set the timeOut in MS of the request to jira api default 1200
not mandatory, set the proxy if you need a proxy to reach your jira instance example: proxy:"http://xxx.xx.xx.00:3128"
when debug is true
OK | 1 passed // 57s
SEND TO XRAY=>{ "testExecutionKey": "PCR-6","info" : {"startDate" : "2020-07-08T15:41:10+02:00", "finishDate" :"2020-07-08T15:41:10+02:00","revision": "001","description" : "Results of test execution ", "testEnvironments": ["browser:chrome", "linux"]},"tests" : [{"testKey":"PCR-1","status":"PASS","comment" : "Successful execution" }]}
XRAY RESPONSE=>{"testExecIssue":{"id":"134806","key":"PCR-6","self":"https://localhost:8080/rest/api/2/issue/134806"},"testIssues":{"success":[{"id":"134801","key":"PCR-1","self":"https://localhost:8080/rest/api/2/issue/134801"}]}}
Tests results sended to XRAY on TestExecution: PCR-6
mtoure@E5450:~/workspace/demo-xray-bdd(master)$
Feature files have to be exported from an Test Execution
issue.