Multiple Test Reports | Bondar Academy
Course: Cypress UI Testing with JavaScript
Module: Advanced Features
Instructor: Artem Bondar
Lesson Summary
In this lesson, we discussed configuring Cypress reporters to improve test failure visibility. Running tests in open mode allows easy debugging, but using run mode limits visibility into failures. By default, Cypress provides minimal output in the terminal, making it challenging to diagnose issues. Key Reporters Covered JUnit Reporter : Highly compatible with CI/CD pipelines (e.g., Azure DevOps, GitHub Actions). It generates XML files for each spec file. Cypress Mocha Awesome Reporter : An HTML reporter that provides a user-friendly interface to review test results. We opted for an optimized version that automatically attaches screenshots. Configuration Steps Install necessary packages: Cypress multiple reporter and Mocha JUnit reporter . Update the cypress.config.js file to include the reporters. Create a reporter-config.json file to configure the reporters and specify where to save results. Add scripts to manage report cleanup and merging. We also created a custom script, cy run all , to automate the process of deleting old reports, running tests, and merging results. It is crucial to ensure that the reports folder is included in .gitignore to prevent accidental commits. In summary, we successfully set up a robust reporting system in Cypress, enhancing our ability to diagnose test failures efficiently.