Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mocha-testrail-reporter-plus

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-testrail-reporter-plus

A Testrail reporter for mocha utilising TestRail API

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

#Testrail Reporter for Mocha

Pushes test results into Testrail system.

Installation

$ npm i mocha-testrail-reporter-plus --save-dev

Usage

Ensure that your testrail installation API is enabled and generate your API keys. See http://docs.gurock.com/

Run mocha with mocha-testrail-reporter-plus:

Configure the mocharc.cjs to look like this:


const { createGrep, parseArgs } = require("mocha-testrail-reporter-plus/modules");
const args = parseArgs(process.argv);
const spec = "src/**/*.spec.ts";

module.exports = {
  extension: ["ts"],
  loader: "ts-node/esm",
  spec: spec,
  timeout: 100000,
  grep: createGrep(args),
  ...(args["--testrail"] && {
    reporter: "mocha-testrail-reporter-plus",
    reporterOptions: { includeLastCommit: true, spec: spec, ...args },
  }),
};
  • It is necessary to include --testrail in order to report

Mark your mocha test names with ID of Testrail test cases. Ensure that your case ids are well distinct from test descriptions.

it("C123 C124 Authenticate with invalid user", () => {})
it("Authenticate a valid user C321", () => {})

Only passed or failed tests will be published. Skipped or pending tests will not be published resulting in a "Pending" status in testrail test run.

Tags

It is possible to use tags for positive or negative matching of tests with the --tags and --excludeTags parameters

Examples

it("C321 Authenticate a valid user -@ Smoke,Login", () => {})

--tags Smoke,Development

--excludeTags Production,Bug

For more information about tags refer to Tags system

Options in .env

TESTRAIL_HOST: string domain name of your Testrail instance (e.g. for a hosted instance instance.testrail.net)

TESTRAIL_USERNAME: string user under which the test run will be created (e.g. jenkins or ci)

TESTRAIL_PASSWORD: string password or API token for user

TESTRAIL_PROJECTID: number projet number with which the tests are associated

TESTRAIL_SUITEID: number suite number with which the tests are associated

TESTRAIL_RUNNAME: string run name

References

Acknowledgments

Pierre Awaragi, owner of the mocha-testrail-reporter.

Keywords

FAQs

Package last updated on 03 Mar 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc