1

I currently have 2 test files that get ran on every build. It seems that for each test file, it creates its own test run in TestRail. So it reports a test run with 4 test cases and another test run with 7 test cases.

What I need and what used to happen before is to have only 1 test run with all 11 cases reported to TestRail.

Here is my cypress.json

  "reporterOptions": {
    "host": "https://yourdomain.testrail.com/",
    "username": "email",
    "password": "CYPRESS_TESTRAIL_REPORTER_PASSWORD",
    "projectId": 32,
    "suiteId": 103769,
    "runName":"Cypress Automated Test Run"

During the build, I can see that after each test file it prints out - Test run closed successfully

This did not happen before. Is there anything that changed, or what do I need to do to get only 1 test run.

therock_21
  • 71
  • 4

2 Answers2

1

There's an option includeAllInTestRun: true, or make sure that the case codes in the test title are actually in the same project/suite.

it("C123 C124 Can authenticate a valid user", ...
it("Can authenticate a valid user C321", ...

Case IDs are extracted as any separate word starting "T" or "C" followed by digits,

let testCaseIdRegExp: RegExp = /\bT?C(\d+)\b/g;
Fody
  • 23,754
  • 3
  • 20
  • 37
  • I'm looking at some documentation and this is set by default `includeAllInTestRun: true`. I still ended up adding and setting it to true and did not work. I am still getting multiple test runs in TestRail. – therock_21 Oct 05 '21 at 04:43
0

You can use

npm install cypress-testrail-accumulative-reporter

It will create a test run that contains all of your test cases

JJ21
  • 1