3

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": "myemail@address.com",
        "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?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Jordan Kowal
  • 101
  • 1
  • 5

2 Answers2

4

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

Jordan Kowal
  • 101
  • 1
  • 5
2

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

Rodyb
  • 61
  • 3
  • 10