1.3.10 • Published 3 years ago

str-cypress-testrail-reporter v1.3.10

Weekly downloads
72
License
MIT
Repository
github
Last release
3 years ago

Single TestRun (STR) TestRail Reporter for Cypress

version downloads MIT License

Publishes Cypress runs on TestRail.

Cloned from the original package salty-cypress-testrail-reporter by Spencer Skekauoha

The original package by Spencer is awesome!

This plugin fixes the issue regarding the last spec not being reported to TestRail (Many people found a not so elegant workaround by adding an empty spec at the end of the suite). In order to accomplish this some code was changed and a dependency was added to the deasync npm package

Install

$ npm install str-cypress-testrail-reporter --D

Usage

Add reporter to your cypress.json:

...
{
  "reporter": "str-cypress-testrail-reporter",
  "reporterOptions": {
    "domain": "yourdomain.testrail.com",
    "username": "username",
    "password": "password" or "api key",
    "projectId": projectIdNumber,
    "runId": runId
  }
}

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

domain: string domain name of your TestRail instance (e.g. for a hosted instance 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.

projectId: number project with which the tests are associated.

runId: number test run with which the tests are associated.

Passing the reporter options as params

You can pass the reporter options from the "cypress run" command line options, like this:

npx cypress run --reporter str-cypress-testrail-reporter --reporter-options domain="domain",username="username",password="password or api key",projectId=0,runId=0

Functionality Update 03/01/2021 - Juan P. Realini

This modified version of the salty-cypress-testrail-reporter doesn't include the option to create a test run from Cypress. This implies that the TestRun must already exist.

Also, the issue regarding the last spec test not being reported to TestRail has been fixed.

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

Author: Juan Pablo Realini - github

License

This project is licensed under the MIT license.

Acknowledgments

1.3.10

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago