Generate test reports

Learn how to generate HTML & JSON reports for your builds.

Warning: This is a feature introduced in the v1.6.0 of the BrowserStack-Cypress CLI. If you are using an older version of the CLI, please upgrade to be able to generate the reports.

Introduction

In your local machines, you’d usually run the Cypress tests and generate the HTML or JSON reports using a reporter like mocha-awesome.

But, when you run your tests on BrowserStack, using multiple parallels and across multiple browsers & OS at the same time, the regular locally generated reports are difficult to be consumed. While you can visit our dashboard to see the test results, you may want to attach the HTML report in your CI platform.

You can generate the HTML report for your test builds using one of the two ways:

  1. Use the --sync argument while running your tests
  2. Use the generate-report command after the tests are done running

Run tests in sync mode

Starting v1.6.0, the CLI can be run in a synchronous mode using the --sync arg. The test results are saving as HTML (browserstack-cypress-report.html) and as JSON (browserstack-cypress-report.json) automatically after the build is done running in the results folder.

Command Line
browserstack-cypress run --sync

You can directly use the HTML file, or consume the generated JSON to create your own format of the test results.

Generating the reports after the builds are finished

If you haven’t run the tests in the sync mode, or want to generate the test report for an old build, you can use the generate-report command as follows:

Command Line
browserstack-cypress generate-report <build_id>

This command will save the test results to the results folder as HTML (browserstack-cypress-report.html) and as JSON (browserstack-cypress-report.json)

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert