npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cypress-xporter

v2.5.3

Published

CLI tool to sync Cypress test results with Jira, TestRail, and Confluence.

Readme

🚀 Cypress Xporter

Cypress Jira Confluence TestRail

Cypress Xporter is a CLI tool that syncs your Cypress test results with Jira, TestRail, and Confluence. It automates the process of merging test reports, creating bug tickets, updating test plans, and documenting test summaries — all from your terminal.


📑 Table of Contents


✨ Features

  • ✅ Automatically creates Jira bugs for failed tests
  • ✅ Logs test results in TestRail test runs
  • ✅ Publishes Cypress test dashboards to Confluence pages
  • ✅ Merges all mochawesome*.json reports automatically
  • ✅ Supports flexible CLI flags (--jira, --testrail, --confluence)

📦 Installation

Dependency:

  • "NODE": "^22.12.0"
  • "npm": "^11.0.0"
  • "cypress": "12.x.x,13.x.x, and 14.x.x" OR higher
  • "axios": "^1.8.4"
  • "dotenv": "^16.4.7"
  • "fast-glob": "^3.3.3"
  • "chalk": "^4.1.2"
  • "form-data": "^4.0.0"
  • "minimist": "^1.2.8"

Global installation:

npm install cypress-xporter
or 
npm install cypress-xporter --save-dev

⚙️ Environment Setup

Create a .env file in your project root:

# JIRA
JIRA_BASE_URL=https://your-domain.atlassian.net
[email protected]
JIRA_API_TOKEN=your-jira-api-token
JIRA_PROJECT_KEY=PROJECTKEY

# TESTRAIL
TESTRAIL_DOMAIN=https://yourcompany.testrail.io
[email protected]
(opt) TESTRAIL_API_KEY=your-testrail-api-key
TESTRAIL_PASSWORD=your-testrail-password
TESTRAIL_PROJECT_ID=ProjectID

# CONFLUENCE
CONFLUENCE_BASE_URL=https://your-domain.atlassian.net
[email protected]
CONFLUENCE_API_TOKEN=your-confluence-token
CONFLUENCE_SPACE_KEY=SPACEKEY
CONFLUENCE_PARENT_PAGE_ID=Folder |OR| PageID

🚀 Usage

ℹ️ Note:
When writing your Cypress tests, you can include the TestRail ProjectID or Test Case ID in the test name using the following format:

Handle ProjectID dynamically

 describe( '[P<ID>][S<ID>] Multi Project and Handle ProjectID dynamically', () =>
{
it( '<Test Name> [C<ID>]', () =>
 {
  // Your test code here
} );
 } );

To Dynamically handle ProjectID replace [P<ID>] [S<ID>]with the corresponding TestRail ProjectID and SuiteId This helps Cypress Xporter map the test results to the correct TestRail test cases. Replace <Test Name> with the name of your test and [C<ID>] with the corresponding TestRail Case ID. This helps Cypress Xporter map the test results to the correct TestRail test cases.

Handle ProjectID from .ENV

 describe( 'Make sure .env has the projectID', () =>
{
it( '<Test Name> [C<ID>]', () =>
 {
  // Your test code here
} );
 } );

Replace <Test Name> with the name of your test and [C<ID>] with the corresponding TestRail Case ID. This helps Cypress Xporter map the test results to the correct TestRail test cases.

After running Cypress tests (with Mochawesome reporter):

npx cypress-xporter --jira --testrail --confluence

Cypress Xporter will:

  1. Search for all mochawesome*.json reports across the project
  2. Merge them into a single report
  3. Create Jira tickets for failed tests (if --jira is passed)
  4. Log results to TestRail (if --testrail is passed)
  5. Generate a dashboard and upload to Confluence (if --confluence is passed)

    Note:
    To successfully publish dashboards to Confluence, ensure that the Confluence HTML Macro is enabled in your Confluence instance. Without this macro, embedded HTML dashboards may not render correctly on your Confluence pages.


📘 Example CLI Commands

# Run everything
npx cypress-xporter --jira --testrail --confluence

# Only push to Jira and TestRail
npx cypress-xporter --jira --testrail

# Only push to Confluence
npx cypress-xporter --confluence

# Only push to TestRail
npx cypress-xporter --jira --testrail

# Only push to TestRail to a specidic testrun
npx cypress-xporter --testrail --adhocRunId [id] # OR --adhoc 1339

🔧 CI/CD Integration

GitHub Actions

- name: Run Cypress Tests
  run: npm run cy:run

- name: Report with Cypress Xporter
  run: npx cypress-xporter --jira --testrail --confluence
  env:
    JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
    JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
    JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
    ...

Jenkins

In your pipeline script:

npm install
npx cypress run
npx cypress-xporter --jira --testrail --confluence

🔐 Token & ID Setup Help

  • 🔑 Get a Jira API token
  • 🔑 Get a Confluence API token
  • 🔑 Get a TestRail API key
  • 📌 JIRA_PROJECT_KEY → Can be found in the project settings (e.g., ABC)
  • 📌 TESTRAIL_PROJECT_ID → Use TestRail API or UI to identify
  • 📌 CONFLUENCE_SPACE_KEY → Space key shown in your space URL (e.g., TEST)
  • 📌 CONFLUENCE_PARENT_PAGE_ID → ID of the parent page/folder where test logs go (check Confluence URL or API)

🛠️ Version

^2.5.0

```bash
    npx cypress-xporter --testrail --adhocRunId 1339 
    
    # OR 

    npx cypress-xporter --testrail --adhoc [id] 
```

ℹ️ Note:
The CLI will NOT create a new TestRail Run. Instead, it will only update the specified existing Ad-Hoc Test Run.

Mutual exclusivity enforced

  • The --adhocRunId / --adhoc flags cannot be used together with automatic run creation logic.
  • Passing both Ad-Hoc flags and auto-run flags will result in a failure or ignored parameters (depending on configuration).
  • Case Filtering Behavior:
  • Only Cypress test cases that exist in the mochawesome report and are already associated with the specified Ad-Hoc Test Run will be updated.
  • Missing or unmatched Case IDs will be skipped (no auto-add).

^2.4.0

  1. Parses Cypress mochawesome reports.
  2. Extracts ProjectID and Case IDs from test titles.
  3. For each unique ProjectID:
    - Queries all Suites.
    - Finds the matching Suite containing all Case IDs.
  4. Creates a TestRail Run with the correct Suite and Case IDs.
  5. Posts test results to the newly created Test Run.
  6. Automatically closes the Test Run after posting results.
  7. Dynamic Run Name Based on File Path
    - Now accepts runName as a parameter.
    • If 2+ folders: Folder1-Folder2 Automated Run with <date> :: e.g. cypress/e2e/Shopping/Smoke
    • If 1 folder: Folder1 Automated Run with <date> :: e.g. cypress/e2e/Smoke
    • If none: Automated Cypress Run - <date>

📄 License

MIT © Kabir Faisal | Linkedin | Discord