{"id":15434179,"url":"https://github.com/hdorgeval/testcafe-reporter-cucumber-json","last_synced_at":"2025-08-20T23:32:57.481Z","repository":{"id":32065551,"uuid":"128985898","full_name":"hdorgeval/testcafe-reporter-cucumber-json","owner":"hdorgeval","description":"TestCafe reporter to generate json in cucumber format","archived":false,"fork":false,"pushed_at":"2024-05-31T14:40:05.000Z","size":1165,"stargazers_count":19,"open_issues_count":23,"forks_count":24,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T08:37:06.811Z","etag":null,"topics":["cucumber-json","e2e-monitoring","e2e-tests","html-report","json","reporter","testcafe","testcafe-reporter"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hdorgeval.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-04-10T19:37:47.000Z","updated_at":"2023-03-09T01:12:27.000Z","dependencies_parsed_at":"2024-10-20T20:32:48.040Z","dependency_job_id":null,"html_url":"https://github.com/hdorgeval/testcafe-reporter-cucumber-json","commit_stats":{"total_commits":175,"total_committers":9,"mean_commits":"19.444444444444443","dds":"0.14857142857142858","last_synced_commit":"4380ddf6ff1fe308612a4af157bc940318cedb66"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdorgeval%2Ftestcafe-reporter-cucumber-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdorgeval%2Ftestcafe-reporter-cucumber-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdorgeval%2Ftestcafe-reporter-cucumber-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdorgeval%2Ftestcafe-reporter-cucumber-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hdorgeval","download_url":"https://codeload.github.com/hdorgeval/testcafe-reporter-cucumber-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230471175,"owners_count":18231193,"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":["cucumber-json","e2e-monitoring","e2e-tests","html-report","json","reporter","testcafe","testcafe-reporter"],"created_at":"2024-10-01T18:37:44.360Z","updated_at":"2024-12-19T17:08:41.199Z","avatar_url":"https://github.com/hdorgeval.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON TestCafé Reporter [![npm version](https://img.shields.io/npm/v/testcafe-reporter-cucumber-json.svg)](https://www.npmjs.com/package/testcafe-reporter-cucumber-json)\n\nThis is the **JSON** reporter plugin for [TestCafé](http://devexpress.github.io/testcafe).\n\nThis TestCafé reporter generates JSON files that can be merged and converted to a nice and searchable html report by using [multiple-cucumber-html-reporter](https://github.com/wswebcreation/multiple-cucumber-html-reporter).\n\nJSON files generated by this reporter have the same schema than those generated by the Cucumber JSON reporter: this is why `fixture` is translated to `Feature` and `test` to `Scenario` in the final HTML report.\n\n![report-header](media/report03.png)\n![report-overview](media/report04.png)\n\n## To install this TestCafé Reporter\n\n- run the command:\n\n  ```sh\n  npm install --save testcafe-reporter-cucumber-json\n  ```\n\n## Usage\n\n- add to the TestCafé command-line the following options:\n\n  ```sh\n  testcafe chrome ./path-to-tests/*(.js|.testcafe|.ts) --reporter cucumber-json\n  ```\n\nJSON files will be automatically created in a folder named `cucumber-json-reports` at the root of your project.\n\nIf you need to change this folder, add this option on the TestCafé command-line:\n\n```sh\n--reporter-json-folder='my-custom-folder'\n```\n\nor add/edit the `args` section inside the `testcafe-reporter-cucumber-json.json` configuration file:\n\n```json\n  \"args\": {\n    \"reportFolder\": \"my-custom-folder\"\n  }\n```\n\nor set the environment variable `--reporter-json-folder` (in this case this variable will take precedence over the command-line option and the configuration file):\n\n```js\nprocess.env['--reporter-json-folder'] = 'my-custom-folder';\n```\n\nAt each TestCafé run, this reporter will create a separate JSON file for each browser started by TestCafé.\n\nEach JSON file will be named : `[browser name][browser platform][date and time of execution].json`.\n\nExamples:\n\n```sh\n  cucumber-json-reports\n  |- Chrome_83_0_4103_116_macOS_10_15_5-2020-07-04T19-44-58-493Z.json\n  |- Firefox_78_0_macOS_10_15-2020-07-04T19-44-58-493Z.json\n  |- Microsoft_Edge_83_0_478_58_macOS_10_15_5-2020-07-04T19-38-05-688Z.json\n  |- Microsoft_Edge_83_0_478_58_macOS_10_15_5-2020-07-04T19-44-58-493Z.json\n  |- Safari_13_1_1_macOS_10_15_5-2020-07-04T19-44-58-493Z.json\n  |- ...\n```\n\nIf you would like to show in the report the App name targeted by your tests, add this option on the TestCafé command-line:\n\n```sh\n--reporter-app-name='My App'\n```\n\nor add/edit the `args` section inside the `testcafe-reporter-cucumber-json.json` configuration file:\n\n```json\n  \"args\": {\n    \"appName\": \"My App\",\n  }\n```\n\nor set the environment variable `--reporter-app-name` (in this case this variable will take precedence over the command-line option and the configuration file):\n\n```js\nprocess.env['--reporter-app-name'] = 'My App';\n```\n\nAnd if you need to also show the App version, add this option on the TestCafé command-line:\n\n```sh\n--reporter-app-version='x.y.z'\n```\n\nor add/edit the `args` section inside the `testcafe-reporter-cucumber-json.json` configuration file:\n\n```json\n  \"args\": {\n    \"appVersion\": \"x.y.z\",\n  }\n```\n\nor set the environment variable `--reporter-app-version` (in this case this variable will take precedence over the command-line option and the configuration file):\n\n```js\nprocess.env['--reporter-app-version'] = 'x.y.z';\n```\n\n## To generate the HTML report\n\nThe HTML report will merge all the JSON files inside folder `cucumber-json-reports` into a single HTML file.\n\n- install [multiple-cucumber-html-reporter](https://github.com/wswebcreation/multiple-cucumber-html-reporter):\n\n  `npm install --save-dev multiple-cucumber-html-reporter` (\u003e= v1.18.0)\n\n- Create a `report-generator.js` file at the project root:\n\n  ```javascript\n  const report = require('multiple-cucumber-html-reporter');\n  const path = require('path');\n  const projectName = path.basename(__dirname);\n  const projectVersion = process.env.npm_package_version;\n  const reportGenerationTime = new Date().toISOString();\n  report.generate({\n    reportName: 'TestCafé Report',\n    jsonDir: 'cucumber-json-reports',\n    reportPath: 'cucumber-json-reports/html',\n    openReportInBrowser: true,\n    disableLog: true,\n    displayDuration: true,\n    displayReportTime: true,\n    durationInMS: true,\n    customData: {\n      title: 'Run info',\n      data: [\n        { label: 'Project', value: `${projectName}` },\n        { label: 'Release', value: `${projectVersion}` },\n        { label: 'Report Generation Time', value: `${reportGenerationTime}` },\n      ],\n    },\n  });\n  ```\n\n- insert the following script in the `package.json` file:\n\n  ```javascript\n  \"report\": \"node report-generator.js\",\n  ```\n\n- run the command `npm run report`\n\n## Tagging\n\n- Tags enables to filter the html report;\n- Tags are generated dynamically from the:\n  - fixture description\n  - test description\n  - fixture file name (TBD)\n  - fixture folder hierarchy (TBD)\n  - new t.meta() syntax (TBD)\n\n## Tags managment\n\n- Tags can be managed through the configuration file `testcafe-reporter-cucumber-json.json`\n  - this json file will be created on the first reporter run\n- To discard a tag, add this tag to the `noisyTags` section of the json configuration file.\n\n## Error rendering\n\n- this reporter will report multiple code frames, one for each file reported in the stacktrace\n\n```text\n1) The specified selector does not match any element in the DOM tree.\n\n   Browser: Firefox 59.0.0 / Mac OS X 10.12.0\n   Screenshot: /Users/HDO/VSCodeProjects/testcafe-starter/screenshots/2018-05-07_10-39-08/test-2/Firefox_59.0.0_Mac_OS_X_10.12.0/errors/1.png\n\n      13 |\n      14 |  const value = inputData.name || \"\";\n      15 |\n      16 |  await t\n      17 |    .setTestSpeed(config.testcafe.testSpeed)\n   --------------------------------------------\n    → 18 |    .hover(selector.userNameInputBox)\n   --------------------------------------------\n      19 |    .expect(selector.userNameInputBox.hasAttribute(\"disabled\")).notOk()\n      20 |    .typeText(selector.userNameInputBox, value, {replace: true})\n      21 |    .pressKey(\"tab\");\n      22 |};\n      23 |\n\n      at Object.(anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:18:6)\n      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:7:71)\n      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:3:12)\n      at exports.default (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:7:36)\n\n\n       6 |  if (canExecute === false) {\n       7 |    return;\n       8 |  }\n       9 |  const foundStep = stepMappings[stepName];\n      10 |  if (typeof foundStep === \"function\" ) {\n   --------------------------------------------\n    → 11 |    await foundStep(stepName);\n   --------------------------------------------\n      12 |    return;\n      13 |  }\n      14 |  throw new Error(`Step \"${stepName}\" is not mapped to an executable code.`);\n      15 |}\n      16 |export async function given(stepName: GivenStep) {\n\n      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:11:11)\n      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:7:71)\n      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:3:12)\n      at executeStep (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:14:12)\n      at Object.(anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:20:9)\n      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:7:71)\n      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:3:12)\n      at Object.when (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:34:12)\n\n\n      19 |  await  then(\"no name should be populated\");\n      20 |  await   and(\"I cannot submit my feedback on testcafe\");\n      21 |});\n      22 |\n      23 |test(\"Scenario: can send feedback with my name only\", async () =) {\n   --------------------------------------------\n    → 24 |  await  when(\"I enter my name\");\n   --------------------------------------------\n      25 |  await  then(\"I can submit my feedback on testcafe\");\n      26 |});\n      27 |\n      28 |test(\"Scenario: send feedback\", async () =) {\n      29 |  await env.only( \"devci\");\n\n      at Object.(anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:24:10)\n      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:7:71)\n      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:3:12)\n      at test (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:23:66)\n\n```\n\n## Screenshot rendering\n\n- this reporter embeds all screenshots as base 64 images, making the generated json file completely autonomous.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdorgeval%2Ftestcafe-reporter-cucumber-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdorgeval%2Ftestcafe-reporter-cucumber-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdorgeval%2Ftestcafe-reporter-cucumber-json/lists"}