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 🙏

© 2024 – Pkg Stats / Ryan Hefner

testrail-mocha-reporter

v0.5.4

Published

Testrail reporter for Mocha.js

Downloads

2,600

Readme

GitHub package.json version npm version NPM Downloads

GitHub issues

testrail-mocha-reporter

This is custom mocha reporter for use with javascript framework, mocha.

Inspired by mochawesome project.

Installation

npm

npm install --save-dev testrail-mocha-reporter

yarn

yarn add -D testrail-mocha-reporter

Usage

Mocha

mocha test --reporter testrail-mocha-reporter --reporter-options domain=domain.testrail.com,[email protected],password=12345678,...

Possible options

You can choose between three options.

  1. send planId - then it will fetch all the suites and cases associated with that plan

  2. send runId - then the results are send to that run with defined ID and the run is not closed

    1. suiteId required
  3. send createRun - then it will create a new run with defined suite (suiteId) and close it after end of the suite.

    1. runName required
    2. suiteId required

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

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

password: string password or API token for user

projectId: number project number with which the tests are associated

milestoneId: number (optional) milestone number with which the tests are associated

planId: number (optional) planId - if the planId is set then the results are posted to this run. Ii will fetch all the runId's and cases within that plan.

runId: number (optional) runId number which tests are associated.

createRun: boolean (required) if runId is NOT set. It will creates a new run with defined runName.

suiteId: number (required) with the set runId or createRun. Suite number with which the tests are associated

runName: string (required) with the createRun set to true.

ci: string (optional) add to run (createNew must be true) ci build number. Possible options are ("circle" | "travis | jenkins)

Cypress integration

Reporter working well with Cypress.io.

To integrate reporter please read the Cypress documentation for adding custom reporters.

Add reporter to jsou cypress.json

{
  ...,
  "reporter": "testrail-mocha-reporter",
  "reporterOptions": {
    "domain": "domain.testrail.com",
    "username": "[email protected]",
    "password": "your password",
    "projectId": 1,  
    "planId": 1,
    "milestoneId": 1
  },
  ...
}

If you are using a multi-custom-reporter then you will need to add it like this:

{
  ...,
  "reporterOptions": {
    "reporterEnabled": "testrail-mocha-reporter,html",
    "testrailMochaReporterReporterOptions": {
      "domain": "domain.testrail.com",
      "username": "[email protected]",
      "password": "your password",
      "projectId": 1,  
      "planId": 1,
      "milestoneId": 1
    }
  },
  ...
}

TestRail Settings

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

Petr Heřmanský - github

License

This project is licensed under the MIT license.

Acknowledgments

References