The article describes a method to track Cypress test health without using Cypress Cloud, which involves generating a JSON merge report. The primary goal is to gather essential analytics like flake percentage and performance data. The process starts with saving individual test results after each run using the `after:run` event in Cypress. These results are then merged into a single JSON file using a custom JavaScript script. The script analyzes the data to calculate metrics like total duration, flaky tests, and errors. This script is integrated into a CI/CD pipeline, like GitHub Actions, to run after all Cypress tests complete. The merged report is then uploaded as a pipeline artifact, providing a centralized view of test health. The report allows for easy identification of issues like flaky tests and performance bottlenecks, enhancing the troubleshooting process. This approach provides valuable insights into test suite reliability and performance, enabling teams to maintain a healthy test suite. The author suggests further enhancements like integrating alerts and creating a dashboard. Ultimately, the solution offers a practical, cost-effective alternative to commercial tools.
dev.to
dev.to
