'Integrating Cypress within TestRail

I've been trying to have my Cypress tests uploaded to their matching TestRail testcases, but so far it's not working.


Here's my current setup:

I have installed:

  • cypress
  • cypress-testrail-reporter

In my cypress.json file I have:

{
    "baseUrl": "my website URL",
    "projectId": "my project ID",
    "reporter": "cypress-testrail-reporter",
    "reporterOptions": {
        "domain": "https://customName.testrail.io",
        "username": "[email protected]",
        "password": "My API key",
        "projectId": 2,
        "suiteId": 12
    }
}

In Cypress, I have a it() block named it.only("C170 Using wrong credentials", ...)

In TestRail I have the following settings:

  • API is enabled
  • I have a custom API key (used in config.json)
  • I am an admin user
  • There's a testcase with the number C170

Then, when I run cypress run --record --key my-record-key-from-cypress:

  • The tests appear in the Cypress Dashboard
  • The tests DO NOT appear in the TestRail Dashboard

Any idea what could be missing?



Solution 1:[1]

SOLVED

Do not include http(s):// within your reporterOptions in the cypress.json file

BAD:   "domain": "https://customName.testrail.io"
GOOD:  "domain": "customName.testrail.io"

In all fairness, it's called domain, not URL, so I removing https makes sense

Solution 2:[2]

You should also run the test from the CLI instead of the Cypress test runner.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jordan Kowal
Solution 2 Rodyb