Registry / testing / codeceptjs-xray-cloud-helper

codeceptjs-xray-cloud-helper

JSON →
library2.1.0-beta.0jsnpmunverified

The `codeceptjs-xray-cloud-helper` is a CodeceptJS plugin designed to automate the process of reporting test results from CodeceptJS executions to Jira's XRAY Cloud via its REST API v2. It currently stands at stable version `2.0.1`, with a `2.1.0-beta.0` pre-release indicating ongoing development. This plugin is specifically engineered for XRAY/JIRA Cloud instances, and explicitly does not support on-premise or server versions. Its key differentiators include comprehensive support for various Xray test types (Generic, Manual, Manual with iterations, Cucumber scenario, Cucumber scenario outline), the ability to automatically create new Jira tests or link to existing ones, attach failure screenshots as evidence, link test executions to test plans, and populate custom fields for both Test Executions and Test Runs. Release cadence appears demand-driven, with updates addressing bug fixes and minor enhancements.

npm install codeceptjs-xray-cloud-helper
INSTALL
IMPORT
SIG · CODECEPTJS-XRAY-CL
C
codeceptjs-xray-cloud-helper
testingjavascriptv2.1.0-beta.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin configuration
plugins: { xrayImport: { require: "codeceptjs-xray-cloud-helper", enabled: true, // ... other config } }
import { XrayCloudHelper } from 'codeceptjs-xray-cloud-helper';
This package is a CodeceptJS plugin, and its primary consumption method is via the `plugins` configuration section in `codecept.conf.js`. It is not intended for direct programmatic imports into test files or other modules.
CLI initializer
npx xray-import init
node node_modules/codeceptjs-xray-cloud-helper/cli.js init
The package provides a convenient CLI tool via `npx` for interactive configuration setup, which simplifies initial manual configuration.

This configuration snippet for `codecept.conf.js` demonstrates how to enable and configure the `codeceptjs-xray-cloud-helper` plugin. It sets up automatic reporting to XRAY Cloud, creating new Jira tests if needed, and handling authentication with environment variables for sensitive credentials.

const { set</td> exports.config = { tests: './*_test.js', output: './output', helpers: { WebDriver: { url: 'http://localhost', browser: 'chrome' } }, include: { I: './steps_file.js' }, plugins: { xrayImport: { require: "codeceptjs-xray-cloud-helper", enabled: true, debug: false, projectKey: process.env.JIRA_PROJECT_KEY ?? 'JIRAKEY', testExecutionAssigneeUserId: process.env.JIRA_ASSIGNEE_ID ?? '604ba41b020eb0068634', importToExistingTestExecution: false, existingTestExecutionKey: '', testExecutionPlanKey: process.env.JIRA_TEST_PLAN_KEY ?? '', testExecutionVersion: '1.0', testExecutionRevision: '1', testExecutionEnvironments: ['QA'], testExecutionSummary: 'Automated CodeceptJS Test Execution', testExecutionDescription: 'Results from CI/CD pipeline run.', testExecutionSendEvidenceOnFail: true, testExecutionCustomFields: [{ id: '63c5731047c0ed24ee469f5b', value: 'local' }], createNewJiraTest: true, timeout: 120000, xrayClientId: process.env.XRAY_CLIENT_ID ?? '74122128E033FD4efef42341E2B1DF70A6027BD799', xraySecret: process.env.XRAY_CLIENT_SECRET ?? '28e15830390194549bazzea0ce461274eabb71119113096ba3d746' } } }
Debug
Known issues
gotchaThis helper is explicitly designed and tested for XRAY/JIRA Cloud versions only. It will not work with self-hosted Jira or XRAY Server instances.
fix
Ensure your Jira and XRAY instances are cloud-based. For self-hosted solutions, seek alternative reporting tools.
affects: >=2.0.0
gotchaSensitive API credentials (xrayClientId, xraySecret) should never be hardcoded directly in `codecept.conf.js` or any source code. Exposing these credentials can lead to unauthorized access to your Jira/XRAY instance.
fix
Use environment variables (e.g., `process.env.XRAY_CLIENT_ID`) for all API keys and secrets. Store these variables securely in your CI/CD pipeline or local environment.
affects: >=2.0.0
gotchaThe `projectKey` and `testExecutionKey` configurations are critical. Incorrect values will lead to API errors, preventing test results from being imported.
fix
Double-check `projectKey` against your Jira project ID. If `importToExistingTestExecution` is true, verify `existingTestExecutionKey` points to a valid, existing Test Execution in XRAY.
affects: >=2.0.0
gotchaThe default `timeout` of 120 seconds (120000 ms) might be insufficient for large test suites or during periods of high XRAY API latency, leading to 'Request Timed Out' errors.
fix
Increase the `timeout` value in the plugin configuration if you experience frequent timeouts during report submission. Monitor XRAY API performance and network conditions.
affects: >=2.0.0
Errors
Common errors & fixes
XRAY API Error: Invalid client id or secret (401 Unauthorized)
The provided `xrayClientId` or `xraySecret` are incorrect, expired, or lack the necessary permissions to authenticate with the XRAY Cloud API.
fix
Verify that your `xrayClientId` and `xraySecret` are correct and active in your Jira's XRAY Cloud integration settings. Ensure the associated API key has 'Create Test Execution' and 'Update Test Run' permissions for the target project.
Jira Project not found for key: JIRAKEY (404 Not Found)
The `projectKey` configured in `codecept.conf.js` does not correspond to an existing Jira project, or the XRAY API key does not have access to it.
fix
Confirm the `projectKey` exactly matches an active Jira project key. Check that the XRAY API key has 'Browse Projects' permission for this project.
Test Execution JIRAKEY-1118 not found (404 Not Found)
When `importToExistingTestExecution` is true, the `existingTestExecutionKey` points to a Test Execution that does not exist or has been deleted.
fix
Verify that the `existingTestExecutionKey` is correct and refers to an active Test Execution in XRAY. Alternatively, set `importToExistingTestExecution` to `false` to allow the plugin to create a new Test Execution.
Error: Request timed out after 120000ms
The XRAY Cloud API did not respond within the configured `timeout` period, possibly due to network latency, large payload size, or API rate limiting.
fix
Increase the `timeout` value in the plugin configuration (e.g., to `300000` for 5 minutes). Consider reducing the number of tests in a single execution or optimizing network conditions.
Upgrade
Version history
2.1.0-beta.0latest on npm
Audit
Dependencies
codeceptjsrequiredThis is a CodeceptJS plugin and requires CodeceptJS as a peer dependency for its core functionality.
axiosrequiredUsed internally for making HTTP requests to the XRAY Cloud API, as indicated by v2.0.1 release notes improving error handling.
Agent activity
35 hits · last 30 days
node
32
OpenAI (training)
1
Resources
codeceptjs-xray-cloud-helper — npm install codeceptjs-xray-cloud-helper · libregistry