@bicarbon8/cypress-testrail-reporter

3.0.0 • Public • Published

TestRail Reporter for Cypress

Publishes Cypress runs on TestRail.

Install

$ npm install @bicarbon8/cypress-testrail-reporter --save-dev

Usage

Add reporter to your cypress.json:

Ex: using a TestRail Plan containing multiple Suites

...
"reporter": "cypress-testrail-reporter",
"reporterOptions": {
  "url": "https://yourdomain.testrail.io",
  "username": "username",
  "password": "password",
  "usePlan": true,
  "projectId": 1,
  "suiteIds": [1, 2, 3],
}

Ex: using a TestRail Run containing only one Suite

...
"reporter": "cypress-testrail-reporter",
"reporterOptions": {
  "url": "https://yourdomain.testrail.io",
  "username": "username",
  "password": "password",
  "projectId": 1,
  "suiteId": 1,
}

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

  • url: string full URL to your TestRail instance (e.g. for a hosted instance https://instance.testrail.io).
  • username: string containing the email of the user under which the test run will be created.
  • password: string containing the password or API key for the aforementioned user.
  • projectId: number representing a project with which the tests are associated.
  • usePlan: boolean representing if a TestRail Plan containing one or more runs should be created based on the values specified for suiteIds or if only a TestRail Run should be used (defaults to false).
  • suiteIds: number[] containing the suites with which the tests are associated (required only when usePlan is true).
  • suiteId: number containing the suite with which the tests are associated (required when usePlan is false or not included).

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.

Authors

License

This project is licensed under the MIT license.

Acknowledgments

Package Sidebar

Install

npm i @bicarbon8/cypress-testrail-reporter

Weekly Downloads

6

Version

3.0.0

License

MIT

Unpacked Size

22.6 kB

Total Files

12

Last publish

Collaborators

  • bicarbon8