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

mocha-testrail-reporter-tags

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-testrail-reporter-tags

A Testrail reporter for mocha utilising TestRail API

  • 1.0.7
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

#Testrail Reporter for Mocha

Pushes test results into Testrail system.

Installation

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

Environment variables

When running the Cypress tests on CI, you need to provide the TestRail server variables through the process (OS) environment variables. The following variables should be set:

TESTRAIL_HOST=
TESTRAIL_USERNAME=
; the user password or API key for the user
; API key is preferred
TESTRAIL_PASSWORD=
; Note: the project ID is not very sensitive value
TESTRAIL_PROJECTID=
; if you use suites, add a suite ID (with S or without)
TESTRAIL_SUITEID=...

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-tags:

$ mocha test --reporter mocha-testrail-reporter-tags

or use a mocha.options file

mocha --opts mocha-testrail.opts build/test
--recursive
--reporter mocha-testrail-reporter-tags
--no-exit

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.

Build and test locally

Setup testrail test server

  • Start a new TestRail trial from https://www.gurock.com/testrail/test-management/
  • Enable API under https://XXX.testrail.io/index.php?/admin/site_settings&tab=8
  • Add a new project (Use multiple test suites to manage cases)
  • Add a new test suite (ids: 1)
  • Add at least 4 test cases (ids: C1, C2, C3, C4, etc)
  • Once setup, set your environment variables - recommend using .env file in the root folder
    • TESTRAIL_DOMAIN=XXX.testrail.io
    • TESTRAIL_USERNAME=XXX
    • TESTRAIL_PASSWORD=XXX
    • TESTRAIL_PROJECTID=1
    • TESTRAIL_SUITEID=1
    • TESTRAIL_ASSIGNEDTOID=1
  • Execute the build and test commands (unit and integration tests)
  • Execute the e2e test (requires build and .env file)

Build and test

npm run clean
npm run build
npm run test

References

Acknowledgments

Keywords

FAQs

Package last updated on 29 Dec 2022

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