{"id":15552325,"url":"https://github.com/bahmutov/cypress-json-results","last_synced_at":"2025-09-28T22:30:29.571Z","repository":{"id":37030049,"uuid":"444170927","full_name":"bahmutov/cypress-json-results","owner":"bahmutov","description":"Saves Cypress test results as a JSON file","archived":false,"fork":false,"pushed_at":"2024-10-02T18:20:29.000Z","size":182,"stargazers_count":9,"open_issues_count":12,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-03T14:15:59.810Z","etag":null,"topics":["cypress-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bahmutov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-03T19:05:32.000Z","updated_at":"2024-06-13T09:44:03.000Z","dependencies_parsed_at":"2023-10-12T13:08:59.075Z","dependency_job_id":"6912ac40-3c83-41b8-9573-6886d3cfda80","html_url":"https://github.com/bahmutov/cypress-json-results","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":"0.34615384615384615","last_synced_commit":"f9f94bf8cd82f84a8b33df0b3b690864a0b62b98"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fcypress-json-results","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fcypress-json-results/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fcypress-json-results/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fcypress-json-results/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/cypress-json-results/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234565113,"owners_count":18853251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress-plugin"],"created_at":"2024-10-02T14:16:03.500Z","updated_at":"2025-09-28T22:30:29.231Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cypress-json-results [![Build status][ci image]][ci url] [![renovate-app badge][renovate-badge]][renovate-app] ![cypress version](https://img.shields.io/badge/cypress-12.13.0-brightgreen)\n\n\u003e Saves Cypress test results as a JSON file\n\nRead the blog post [Cypress JSON Test Results](https://glebbahmutov.com/blog/json-test-results/).\n\n## Install\n\n```shell\n$ npm i -D cypress-json-results\n# or using Yarn\n$ yarn add -D cypress-json-results\n```\n\nRegister this plugin from your plugin file\n\n```js\n// cypress/plugins/index.js\nmodule.exports = (on, config) =\u003e {\n  // save all test results as a JSON file\n  // https://github.com/bahmutov/cypress-json-results\n  require('cypress-json-results')({\n    on,\n    filename: 'results.json', // default filename\n  })\n}\n```\n\nAfter the run the JSON file should contain results for all test specs that ran locally and the total counts. See the [Cypress Test Statuses](https://glebbahmutov.com/blog/cypress-test-statuses/) blog post for details on the possible test status values.\n\n```json\n{\n  \"cypress/integration/spec.js\": {\n    \"works\": \"passed\",\n    \"is pending\": \"pending\"\n  },\n  \"totals\": {\n    \"suites\": 0,\n    \"tests\": 2,\n    \"failed\": 0,\n    \"passed\": 1,\n    \"pending\": 1,\n    \"skipped\": 0\n  }\n}\n```\n\n## Options\n\n### filename\n\nBy default, this plugin saves the JSON result into \"results.json\" file. You can change the output filename using the `filename` option\n\n```js\n// https://github.com/bahmutov/cypress-json-results\nrequire('cypress-json-results')({\n  on,\n  filename: 'output.json',\n})\n```\n\n**Note:** the plugin assumes the output folder already exists\n\nYou can disable writing a file by using the option `filename: false`.\n\n### updateMarkdownFile\n\nYou can automatically update a Markdown table inside the given file with the test counts. See the section below [Cypress test counts](#cypress-test-counts) for an example. The table should be surrounded with HTML comments\n\n```\n\u003c!-- cypress-test-counts --\u003e\nTest status | Count\n---|---\nPassed | 8\nFailed | 0\nPending | 1\nSkipped | 0\n**Total** | 9\n\u003c!-- cypress-test-counts-end --\u003e\n```\n\nTip: prevent the Prettier from messing with the formatting by surrounding the table with ignore comments, see [How to configure Prettier and VSCode](https://glebbahmutov.com/blog/configure-prettier-in-vscode/).\n\n```\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- cypress-test-counts --\u003e\n  ... table text ...\n\u003c!-- cypress-test-counts-end --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n```\n\n## githubActionsSummary\n\nIf you are running the tests using [GitHub Actions](https://glebbahmutov.com/blog/trying-github-actions), you can output a summary table.\n\n```js\nrequire('cypress-json-results')({\n  on,\n  filename: false, // do not write JSON file\n  githubActionsSummary: 'spec',\n})\n```\n\nValue `githubActionsSummary: 'spec'` writes a single row per spec file.\n\n![Spec table](./images/spec.png)\n\nValue `githubActionsSummary: 'test'` writes a single row per test.\n\n![Tests table](./images/tests.png)\n\n## Cypress test counts\n\nThis repo has the following test numbers:\n\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- cypress-test-counts --\u003e\nTest status | Count\n---|---\nPassed | 3\nFailed | 0\nPending | 1\nSkipped | 0\n**Total** | 4\n\u003c!-- cypress-test-counts-end --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\nThe table above is automatically updated nightly, see the [GitHub Actions workflow](./.github/workflows/test-counts.yml)\n\n## Small print\n\nAuthor: Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt; \u0026copy; 2022\n\n- [@bahmutov](https://twitter.com/bahmutov)\n- [glebbahmutov.com](https://glebbahmutov.com)\n- [blog](https://glebbahmutov.com/blog)\n- [videos](https://www.youtube.com/glebbahmutov)\n- [presentations](https://slides.com/bahmutov)\n- [cypress.tips](https://cypress.tips)\n- [Cypress Advent 2021](https://cypresstips.substack.com/)\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSupport: if you find any problems with this module, email / tweet /\n[open issue](https://github.com/bahmutov/cypress-json-results/issues) on Github\n\n## MIT License\n\nCopyright (c) 2022 Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n[ci image]: https://github.com/bahmutov/cypress-json-results/workflows/ci/badge.svg?branch=main\n[ci url]: https://github.com/bahmutov/cypress-json-results/actions\n[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg\n[renovate-app]: https://renovateapp.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fcypress-json-results","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Fcypress-json-results","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fcypress-json-results/lists"}