https://github.com/siddharth23/cucumber_reporter_sync
A tool to merge Cucumber JSON reports, post cucumber reports to Slack channels and many more
https://github.com/siddharth23/cucumber_reporter_sync
automation cucumber cucumber-reports library merge merge-and-notify-slack node npm npm-package report slack slack-webhook slacknotify test testing
Last synced: 4 months ago
JSON representation
A tool to merge Cucumber JSON reports, post cucumber reports to Slack channels and many more
- Host: GitHub
- URL: https://github.com/siddharth23/cucumber_reporter_sync
- Owner: siddharth23
- License: apache-2.0
- Created: 2025-02-08T17:41:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-22T07:51:15.000Z (over 1 year ago)
- Last Synced: 2025-10-26T06:48:43.424Z (8 months ago)
- Topics: automation, cucumber, cucumber-reports, library, merge, merge-and-notify-slack, node, npm, npm-package, report, slack, slack-webhook, slacknotify, test, testing
- Language: JavaScript
- Homepage: https://siddharth23.github.io/cucumber_reporter_sync/
- Size: 275 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Cucumber Reporter Sync
`cucumber_reporter_sync` is an npm library designed to merge multiple Cucumber JSON reports and optionally post the results to a Slack channel. It helps streamline the process of aggregating Cucumber test results and sharing them in a team communication platform like Slack.
## Features
- Merge multiple Cucumber JSON reports into a single report.
- Recursively search for reports in subdirectories.
- Generate a merged report in a specified output file.
- Optionally post the merged report to a Slack channel using a Slack webhook.
## Installation
To install the `cucumber_reporter_sync` package, run the following command:
```bash
npm install cucumber_reporter_sync --save-dev
```
## Usage
## Merging and posting test report to Slack
You can also configure the library to post the merged report to a Slack channel. To do this, add the --slack option with your Slack Incoming Webhook URL:
```bash
npx cucumber_reporter_sync merge --recursive --dir reports --slack https://hooks.slack.com/{YOUR WEBHOOK URL}
```
### Parameters:
- --recursive (optional)
Recursively search for report files in subdirectories.
- --dir (required)
The directory where the Cucumber JSON reports are located. You can specify the root directory and the program will find all relevant files.
- -o (required)
The file path where the merged report should be saved. It will save the merged JSON to the specified file.
- --slack (optional)
The Slack webhook URL where the merged report will be posted. You'll need to create an Incoming Webhook in your Slack workspace to get this URL.
#### Example:
```bash
npx cucumber_reporter_sync merge --dir ./reports -o ./reports/merged-report.json --slack https://hooks.slack.com/services/XXX/YYY/ZZZ
```
## Change The Username and Environment
In order to change the username and environment, you can use set the following environment variables:
### Username
```bash
export TEST_USERNAME={YOUR USERNAME}
```
#### Example:
```bash
export TEST_USERNAME=siddharth23
```
### Environment
```bash
export TEST_ENV={YOUR ENVIRONMENT}
```
#### Example:
```bash
export TEST_ENV=staging
```
### Slack Formatting
The merged Cucumber report will be posted to Slack with key information, such as:
Total number of tests
Passed and failed tests scenarios side by side view

# Collaborators
This project is currently maintained by:
- [@siddharth23](https://github.com/siddharth23)
- 
Feel free to contribute if you'd like to help improve this project!