Skip to main content

Multi Reporters Support


With LambdaTest, you can generate multiple reporters supported by Cypress for your tests. If you want to do so, follow the steps below and download the generated reports automatically.


Step 1

Provide the path where your report artefacts will be generated by the test script in the lambdatest-config.json file. In the same file, add the path of the reporter config file that contains the configurations that your reporters require.

The example lambdatest-config.json file2 shown below uses 2 reporters, mochawesome and mocha-junit-reporter.

"run_settings":{
.....
"reporter_config_file": "reporter-config_mochawesome_junit.json",
"downloads": "./cypress/results",
.....
}

Step 2

Create a file with the name reporter-config_mochawesome_junit.json and copy the contents of the code block below.

{   
"reporterEnabled": "mochawesome,mocha-junit-reporter",
"mochawesomeReporterOptions": {
"reportDir": "cypress/results/json",
"overwrite": true,
"html": true,
"json": true
},
"mochaJunitReporterReporterOptions": {
"mochaFile": "cypress/results/my-test-output.xml",
"toConsole": true
}
}

Step 3

Run your test in sync mode by using the code lambdatest-cypress run --sync=true.

After all the tests are run, the generated reports will be automatically downloaded at the location lambdatest-artefacts.

Note

The location of lambdatest-artefacts is relative to the path from where you ran the command.

Sample Output:

Waiting for build to finish...
┌─────────┬───────────────────────────────────┬─────────────┬──────────┬──────────┬─────────┐
(index) │ Spec │ Status │ Platform │ Browser │ Version │
├─────────┼───────────────────────────────────┼─────────────┼──────────┼──────────┼─────────┤
0'cypress_env_params_test_spec.js''completed''win10''Chrome''109.0'
1'cypress_env_params_test_spec.js''completed''win10''Chrome''109.0'
└─────────┴───────────────────────────────────┴─────────────┴──────────┴──────────┴─────────┘
{ completed: 2 }
Creating directories
Directory created lambdatest-artefacts/f60aa4f9-4fca-46aa-b862-e4a0746a2eea
Extracted 14 entries for NPE6A-VMB8F-GVMDY-AG782
Extracted 14 entries for 0OETA-BPSP3-XZVX4-EAPWB

The reports are grouped on the basis of your sessionid with a designated _browser name, browser version, and a test id.

cmd