
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
xray-cucumber-plugin
Advanced tools
Automate XRAY integration for Cucumber Test Cases in your projects with ease. Seamlessly interact with XRAY and Jira APIs to streamline test management.
The Xray Cucumber Plugin is a robust tool that seamlessly integrates your Xray Tests and Xray Test Sets with your source code. It offers a comprehensive range of features to simplify your testing process and effortlessly update test results back to the Xray Test Executions.
You can install the Xray Cucumber Plugin using npm:
npm i xray-cucumber-plugin
Before using the plugin, optimize feature files containing "Scenario Outline." Append example parameters to scenario descriptions to improve test result accuracy. For example:
Feature: Test
Scenario Outline: PreRequisite Document
Given ......
......
......
Examples:
| title1 | title2 |
| value0 | value1 |
| value2 | value3 |
Feature: Test
Scenario Outline: PreRequisite Document (Example - title1: <title1>, title2: <title2>)
Given ......
......
......
Examples:
| title1 | title2 |
| value0 | value1 |
| value2 | value3 |
This adjustment ensures accurate Cucumber JSON reports for updating test results in XRAY.
Configure the Xray Cucumber Plugin to streamline your testing workflow with Xray. Import the XrayCucumberPlugin module and specify your options:
import XrayCucumberPlugin from 'xray-cucumber-plugin'
const options = {
featureFolderPath: './features',
featureFolderFilter: 'OptimizedE2EPack',
featureTagFilter: '',
scenarioDescriptionRegex: /TC_\d\d /gm,
scenarioDescriptionRegexReplaceValue: 'XCP ',
jiraHost: 'jira.********.com',
jiraProject: 'JIRA',
jiraUsername: 'demo.jira',
jiraPassword: 'StrongPassword#1',
jiraToken: 'StrongToken#1',
updateTestSetMappings: true,
testSetMappingDetails: {
testSet1: {
tags: '@sanity and @manual',
testSetId: ['JIRA-1'],
tests: []
}
}
}
XrayCucumberPlugin.init(options);
featureFolderPath: Root folder path for feature files.featureFolderFilter: Filter feature files by folder (Default: '/')featureTagFilter: Filter scenarios using tag expressions (Default: '')scenarioDescriptionRegex: Regular expression for specific scenario description content.scenarioDescriptionRegexReplaceValue: Value to replace matched content in scenario descriptions.jiraHost: JIRA endpoint.jiraProject: JIRA project key.jiraUsername: Authorized JIRA username (Default: process.env.JIRA_USERNAME).jiraPassword: JIRA password for the specified username (Default: process.env.JIRA_PASSWORD).jiraToken: JIRA token for authentication and authorization (Default: process.env.JIRA_TOKEN).updateTestSetMappings: Enable mapping Xray Tests to Xray Test Sets (Default: false).testSetMappingDetails: Mapping details for tests and test sets based on Cucumber tag expressions.Note:
init override default values.jiraUsername & jiraPassword or jiraToken is required.testSetMappingDetails{
testSet1: {
tags: '@sanity and @manual',
testSetId: ['JIRA-1']
},
testSet2: {
tags: '@sanity and not @manual',
testSetId: ['JIRA-2', 'JIRA-3']
}
}
testSet1 / testSet2: Unique identifiers for test sets.tags: Filter Xray Tests based on tag expressions.testSetId: Xray Test Set IDs for mapping tests.Note: The testSetMappingDetails object can contain multiple nested objects.
Ensure your test execution results are accurately updated in Xray. Import the XrayCucumberPlugin module and provide your options:
import XrayCucumberPlugin from 'xray-cucumber-plugin'
const options = {
jiraHost: 'jira.********.com',
jiraProject: 'JIRA',
jiraUsername: 'demo.jira',
jiraPassword: 'StrongPassword#1',
jiraToken: 'StrongToken#1',
testExecutionIds: ['JIRA-6'],
cucumberJsonReportFolderPath: './json_report'
}
XrayCucumberPlugin.updateTestExecutionResults(options);
jiraProtocol: Protocol for JIRA connection (HTTP/HTTPS) (Default: HTTPS).jiraHost: JIRA endpoint.jiraProject: JIRA project key.jiraUsername: Authorized JIRA username (Default: process.env.JIRA_USERNAME).jiraPassword: JIRA password for the specified username (Default: process.env.JIRA_PASSWORD).jiraToken: JIRA token for authentication and authorization (Default: process.env.JIRA_TOKEN).testExecutionIds: List of Xray Test Execution IDs for result updates.cucumberJsonReportFolderPath: Root folder path for Cucumber JSON reports.parsedTestResultDetails: Optional custom-formed result list for updating test execution results.skipUpdatingFailedCase: Skip updating failed test cases in corresponding test execution tickets (Default: false).Note:
updateTestExecutionResults override default values.jiraUsername & jiraPassword or jiraToken is required.parsedTestResultDetails[
{
'Test Scenario One': 'PASS',
'Test Scenario Two': 'PASS',
'Test Scenario Outline One': 'PASS',
'Test Scenario Outline Two': 'Fail',
}
]
Note:
parsedTestResultDetails is an array of objects where each object should have a key-value pair of scenarioName and scenarioStatus.With these streamlined configurations, you can effectively manage Xray Tests, Test Sets, and ensure accurate test execution result updates. Remember to replace placeholder values with your specific project details. Modify the configurations as needed to suit your requirements. The Xray Cucumber Plugin simplifies your testing workflow and keeps Xray in sync with your source code.
You can independently lint feature files for proper formatting and adherence to standards.
import XrayCucumberPlugin from 'xray-cucumber-plugin'
const options = {
featureFolderPath: './features',
featureFolderFilter: 'OptimizedE2EPack',
scenarioDescriptionRegex: /TC_\d\d /gm,
scenarioDescriptionRegexReplaceValue: '',
}
void XrayCucumberPlugin.lintFeatureFiles(options);
featureFolderPath: Root folder path for feature files.featureFolderFilter: Filter feature files by folder (Default: '/')scenarioDescriptionRegex: Regular expression for specific scenario description content.scenarioDescriptionRegexReplaceValue: Value to replace matched content in scenario descriptions.FAQs
Automate XRAY integration for Cucumber Test Cases in your projects with ease. Seamlessly interact with XRAY and Jira APIs to streamline test management.
We found that xray-cucumber-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.