This plugin for Cypress tests automatically saves test execution results into a JSON file, or formats them for GitHub Actions summaries or Markdown tables. Its current stable version is 1.5.0, with minor feature releases occurring somewhat frequently, as seen by the rapid succession of v1.3.0, v1.4.0, and v1.5.0 in May 2023, indicating active maintenance. Key differentiators include its simplicity in generating a structured JSON output of test statuses, its ability to automatically update Markdown tables within a project with aggregated test counts, and its direct integration with GitHub Actions to provide summary reporting, which is highly beneficial for CI/CD pipelines to quickly grasp test outcomes without needing to download artifacts. Unlike some more comprehensive test reporting solutions, `cypress-json-results` focuses specifically on machine-readable JSON and concise formatted summaries rather than rich, interactive HTML reports, making it ideal for programmatic consumption or quick glance overviews.
npm install cypress-json-resultsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to register the `cypress-json-results` plugin in `cypress/plugins/index.js` to save test results to a JSON file.
Ensure the target directory exists before running Cypress tests (e.g., create it with `mkdir -p your/output/path`).
Configure the plugin with `{ filename: false }` if you do not want a JSON output file.Verify that the Markdown file contains the exact `<!-- cypress-test-counts -->` and `<!-- cypress-test-counts-end -->` comments surrounding your table.
Create the directory manually or ensure your CI pipeline creates it before running Cypress tests. For example: `mkdir -p path/to/output`.
Ensure `require('cypress-json-results')({ on, filename: '...' })` is called exactly once within your `cypress/plugins/index.js` file and receives the `on` and `config` objects from the plugin's `module.exports` function.Check the target Markdown file (`e.g. README.md`) and ensure it contains the precise HTML comment markers `<!-- cypress-test-counts -->` and `<!-- cypress-test-counts-end -->` surrounding the table you wish to update.