1.0.3 • Published 2 years ago

@nextiva-cypress/nextiva-cypress-testrail-reporter v1.0.3

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Nextiva TestRail Reporter for Cypress

Publishes Cypress runs on TestRail.

Features:

  • Test results are aggregated under the same test run if you are executing more spec(test) files
  • Results are reported immediately after the test execution
  • Test run would be closed only if all test pass if test are failing untested/skipped the test run will remain open
  • Reporting retest status of a test cases - handy in terms of marking tests as flaky (test is reported with retest status for the first try and after second try it passes) Note: cypress retry logic must be enabled for this feature.

Usage

On your project find the {env}-reporter-config.json file and set the parameters as follows

...
{
  "reporterEnabled": "mochawesome, nextiva-cypress-testrail-reporter",
  "reporterOptions": {
    "overwrite": false,
    "html": false,
    "json": true,
    "host": "https://testrail.nextiva.xyz/testrail",
    "username": "username",
    "password": "password",
    "projectId": projectIdNumber,
    "suiteId": suiteIdNumber,
    "runName": "ProjectName E2E env"
  }
}

Your Cypress tests should include the ID of your TestRail test case.

// Good:
it("C123 C124 Can authenticate a valid user", ...

// Bad:
it("C123Can authenticate a valid user", ...
it("Can authenticate a valid userC123", ...

The reporter will use the projectId suiteId and the npm run command to determine which test will be included on the testrail test run: Example: If npm run e2e:test:dev its executed it will pick all the test avaialable on the suiteId for the given projectId, If npm run for smoke test it's executed instead it will filter the test cases that has Type=Smoke & Sanity configured on testrails

Reporter Options

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

suiteId: number suite with which the tests are associated.

runName: string (optional) name of the Testrail run.

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.