1

I'm using Cypress to run my e2e testing on Browserstack. I'm using junit reporter which is configured in the cypress.json. When I'm running tests locally test results are generated according to the format (i.e junit). However, when I'm running testing in Browserstack and fetch the results, they are not following the cypress config and are returned as mocha files.

Have anyone managed to make Browserstack return test results in junit format? Configs:

 cypress.json

{
  "reporter": "junit",
  "reporterOptions": {
    "mochaFile": "results/test-output-[hash].xml",
    "toConsole": true,
    "attachments": true
  }
}


  browserstack.json

{
    "auth": {...},
    "browsers": [...],

    "run_settings": {
      "cypress_config_file": "./cypress.json",
      "cypress_version": "6",
      "project_name": "FancyProjectName",
      "build_name": "Build no. 42",
      "parallels": "2",
      "npm_dependencies": {
        "typescript": "^4.2.4"
      }
    }
  }
syntax-punk
  • 3,736
  • 3
  • 25
  • 33
  • Do you need to add [mocha-junit-reporter](https://github.com/michaelleeallen/mocha-junit-reporter) to `npm_dependencies` in browserstack.json? –  Apr 26 '21 at 03:29
  • I didn't give it a go, since cypress have a support for junit reporter out of the box, based on: https://docs.cypress.io/guides/tooling/reporters#Custom-reporter – syntax-punk Apr 26 '21 at 07:23
  • That's why I suggested it - there's no sign of `mocha-junit-reporter` in the local install, yet they say it is included. –  Apr 26 '21 at 09:29
  • Good point, but it didn't work – syntax-punk Apr 26 '21 at 12:12

0 Answers0