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

testrail-reporter-with-flag-for-cypress

v2.3.3

Published

A test reporter for posting results from Cypress Automation Scripts to Test Rail

Downloads

15

Readme

TestRail Reporter for posting TestRun for Cypress based on Post true OR False flag

![version] ![downloads] ![MIT License]

Publishes Cypress runs on TestRail if the Flag "postToTestrail" is set to "true"

Cloned from the original package cypress-testrail-reporter by Milutin Savovic

Core features:

  • Allows you to set statuses for test cases in a specific TestRun.
  • Multi project support (provide testrail-projects.json config file in path cypress/fixtures/ following format explained below) and generate test reports coverage for each project during time execution.

Important note: Keep your tests under the one of the following folder structure:

  • cypress/e2e - default path for Cypress v10 and above
  • cypress/integration - default path for Cypress v9 and bellow
  • cypress/tests

Install

$ npm i testrail-reporter-with-flag-for-cypress
$ yarn add testrail-reporter-with-flag-for-cypress

Usage

Add reporter to your cypress.json:

...
{
 "reporter": "testrail-reporter-with-flag-for-cypress",
  "reporterOptions": {
    "host": "https://yourdomain.testrail.io",
    "username": "username",
    "password": "password / API token",
    "postToTestrail": true OR false,
    "projectId": idNumber,
    "runId": testRunNumber,
    "jsonConfig": true OR false,
}

Your Cypress tests should include the ID of your TestRail test case. Make sure your test case IDs are distinct from your test titles:

// Good:
it("C123 C124 Can authenticate a valid user", ...
it("Can authenticate a valid user C321", ...

// Bad:
it("C123Can authenticate a valid user", ...
it("Can authenticate a valid userC123", ...

Reporter Options

  • host: string domain name of your TestRail instance (e.g. for a hosted instance https://instance.testrail.com).

  • username: string email of the user under which the test run will be created.

  • password: string password or the API key for the aforementioned user.

  • postToTestrail: boolean true to post results to sepcified run or false to not post any resluts

  • projectId: number project with which the tests are associated.

  • runId: number a specific test run id number.

  • jsonConfig: boolean true to run with multiple projects and you must provide testrail-projects.json in path /cypress/fixtures/ or false to skip this functionality.

Your testrail-projects.json file should look like this format:

{
"data": [{
	"projects": [{
		"projectName": "App Lifecycle (Contact : Bumblebee)",
		"projectId": projectIdNumber,
		"runId": runIdNumber,
		"milestoneId": milestoneIdNumber OR null,
		"reportIds": [ 
                  reportIdNumber01,
                  reportIdNumber02,
                  reportIdNumber03 
               	],
                "reportCoverage": true OR false,
                "postToTestrail": true OR false,
		"specs_name": [
		   "cypress/e2e/app-life-cycle/**/*"
		]
	      },
	      {
		"projectName": "Course Builder",
                "projectId": projectIdNumber,
		"runId": runIdNumber,
		"milestoneId": milestoneIdNumber OR null,
		"reportIds": [
      		  reportIdNumber01
                ],
     		"reportCoverage": true OR false,
     		"postToTestrail": true OR false,
		"specs_name": [
		    "cypress/e2e/course-builder/tenant-experience/**/*",
      		    "cypress/e2e/thinkific/student-experience/student-certificates/**/*",
      	   	    "cypress/e2e/site-scripts/**/*"
		]
	      },
	      {
		"projectName": "Open ID Connect SSO into Thinkific (Contact: Reboot)",
		"projectId": projectIdNumber,
		"runId": runIdNumber,
		"milestoneId": milestoneIdNumber OR null,
		"reportIds": [],
     		"reportCoverage": true OR false,
     		"postToTestrail": true OR false,
		"specs_name": [
		    "cypress/e2e/oidc/**/*",
      		    "cypress/e2e/thinkific/tenant-experience/general/create-tenant.spec.js"
		]
	      }
	]}
    ]
}

Note: if you set jsonConfig: true the package will ignore postToTestrail, projectId and runId options as these values should be provided in testrail-projects.json

TestRail Settings

To generate test coverage reports, the testrail community recommends 3 report types:

  1. Coverage for References (Cases) report. Follow these instructions to set up this report and set the report id(s) value(s) in testrail-projects.json.
  2. Summary for References (Defects) report. Follow these instructions to set up this report and and set the report id(s) value(s) in testrail-projects.json.
  3. Comparison for References (Results) report. Follow these instructions to set up this report and set the report id(s) value(s) in testrail-projects.json.

Remember to mark On demand via the API and Everyone (with project access) on section Access and Scheduling when creating the reports, so they can be created during run execution. image

Also, reportId can be found at the url of the report after being created: image

Note: if you set "reportCoverage": true for each specific project in your testrail-projects.json the package will pick up the values inside reportIds to generate those reports automatically in TestRail, otherwise if you set "reportCoverage": false those reports generations will be skipped.

To increase security, the TestRail team suggests using an API key instead of a password. You can see how to generate an API key here.

If you maintain your own TestRail instance on your own server, it is recommended to enable HTTPS for your TestRail installation.

For TestRail hosted accounts maintained by Gurock, all accounts will automatically use HTTPS.

You can read the whole TestRail documentation here.

Author

Author: Shruti Rathee - github

License

This project is licensed under the MIT license.

Acknowledgments