All Projects → hdorgeval → testcafe-reporter-cucumber-json

hdorgeval / testcafe-reporter-cucumber-json

Licence: MIT license
TestCafe reporter to generate json in cucumber format

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to testcafe-reporter-cucumber-json

testcafe-browser-provider-electron
This is the Electron browser provider plugin for TestCafe.
Stars: ✭ 47 (+161.11%)
Mutual labels:  e2e-tests, testcafe
Protractor Pretty Html Reporter
A jasmine reporter that produces an easy to use html report to analyze protractor test results.
Stars: ✭ 9 (-50%)
Mutual labels:  e2e-tests, html-report
testcafe-snippets
Code snippets for TestCafe
Stars: ✭ 54 (+200%)
Mutual labels:  e2e-tests, testcafe
python-appium-framework
Complete Python Appium framework in 360 degree
Stars: ✭ 43 (+138.89%)
Mutual labels:  html-report
html-reporter
Html reporter for hermione
Stars: ✭ 39 (+116.67%)
Mutual labels:  html-report
YaLafi
Yet another LaTeX filter
Stars: ✭ 50 (+177.78%)
Mutual labels:  html-report
wdio-spec-reporter
A WebdriverIO v4 plugin. Reporter that creates 'spec'-style reports
Stars: ✭ 20 (+11.11%)
Mutual labels:  reporter
k6-reporter
Output K6 test run results as formatted & easy to read HTML reports
Stars: ✭ 160 (+788.89%)
Mutual labels:  html-report
ionic-workflow-guide
Create a full and powerful worflow with Ionic (Unit Testing, Environment variables, Automatic documentation, Production App Server, Automatic deployment)
Stars: ✭ 46 (+155.56%)
Mutual labels:  e2e-tests
pytest-html-reporter
Generates a static html report based on pytest framework
Stars: ✭ 69 (+283.33%)
Mutual labels:  html-report
fastlane-plugin-xchtmlreport
fastlane plugin for XCTestHTMLReport
Stars: ✭ 17 (-5.56%)
Mutual labels:  html-report
eslint-formatter-git-log
ESLint Formatter featuring Git Author, Date, and Hash
Stars: ✭ 36 (+100%)
Mutual labels:  reporter
phantom-lord
Handy API for Headless Chromium
Stars: ✭ 24 (+33.33%)
Mutual labels:  e2e-tests
ErrorControlSystem
ErrorControlSystem is a .NET library created to automate handling .NET Windows-Base application exceptions and raise that to a sql server. This exception handler have some features as screen capturing, fetch server date time in exception occurrence time and etc.
Stars: ✭ 30 (+66.67%)
Mutual labels:  reporter
deepchecks
Test Suites for Validating ML Models & Data. Deepchecks is a Python package for comprehensively validating your machine learning models and data with minimal effort.
Stars: ✭ 1,595 (+8761.11%)
Mutual labels:  html-report
typeplate
REST API boilerplate with Typescript, Express.js, Typeorm and Mocha.
Stars: ✭ 268 (+1388.89%)
Mutual labels:  e2e-tests
software-testing-resource-pack
Various files useful for manual testing and test automation etc.
Stars: ✭ 38 (+111.11%)
Mutual labels:  e2e-tests
query2report
Query2Report is a simple open source business intelligence platform that allows users to build report/dashboard for business analytics or enterprise reporting
Stars: ✭ 43 (+138.89%)
Mutual labels:  reporter
pytest-elk-reporter
A plugin to send pytest test results to ELK stack
Stars: ✭ 17 (-5.56%)
Mutual labels:  reporter
zen knit
Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python. RMarkdown Alternative for Python
Stars: ✭ 27 (+50%)
Mutual labels:  html-report

JSON TestCafé Reporter npm version

This is the JSON reporter plugin for TestCafé.

This TestCafé reporter generates JSON files that can be merged and converted to a nice and searchable html report by using multiple-cucumber-html-reporter.

JSON 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.

report-header report-overview

To install this TestCafé Reporter

  • run the command:

    npm install --save testcafe-reporter-cucumber-json

Usage

  • add to the TestCafé command-line the following options:

    testcafe chrome ./path-to-tests/*(.js|.testcafe|.ts) --reporter cucumber-json

JSON files will be automatically created in a folder named cucumber-json-reports at the root of your project.

If you need to change this folder, add this option on the TestCafé command-line:

--reporter-json-folder='my-custom-folder'

or add/edit the args section inside the testcafe-reporter-cucumber-json.json configuration file:

  "args": {
    "reportFolder": "my-custom-folder"
  }

or set the environment variable --reporter-json-folder (in this case this variable will take precedence over the command-line option and the configuration file):

process.env['--reporter-json-folder'] = 'my-custom-folder';

At each TestCafé run, this reporter will create a separate JSON file for each browser started by TestCafé.

Each JSON file will be named : [browser name][browser platform][date and time of execution].json.

Examples:

  cucumber-json-reports
  |- Chrome_83_0_4103_116_macOS_10_15_5-2020-07-04T19-44-58-493Z.json
  |- Firefox_78_0_macOS_10_15-2020-07-04T19-44-58-493Z.json
  |- Microsoft_Edge_83_0_478_58_macOS_10_15_5-2020-07-04T19-38-05-688Z.json
  |- Microsoft_Edge_83_0_478_58_macOS_10_15_5-2020-07-04T19-44-58-493Z.json
  |- Safari_13_1_1_macOS_10_15_5-2020-07-04T19-44-58-493Z.json
  |- ...

If you would like to show in the report the App name targeted by your tests, add this option on the TestCafé command-line:

--reporter-app-name='My App'

or add/edit the args section inside the testcafe-reporter-cucumber-json.json configuration file:

  "args": {
    "appName": "My App",
  }

or set the environment variable --reporter-app-name (in this case this variable will take precedence over the command-line option and the configuration file):

process.env['--reporter-app-name'] = 'My App';

And if you need to also show the App version, add this option on the TestCafé command-line:

--reporter-app-version='x.y.z'

or add/edit the args section inside the testcafe-reporter-cucumber-json.json configuration file:

  "args": {
    "appVersion": "x.y.z",
  }

or set the environment variable --reporter-app-version (in this case this variable will take precedence over the command-line option and the configuration file):

process.env['--reporter-app-version'] = 'x.y.z';

To generate the HTML report

The HTML report will merge all the JSON files inside folder cucumber-json-reports into a single HTML file.

  • install multiple-cucumber-html-reporter:

    npm install --save-dev multiple-cucumber-html-reporter (>= v1.18.0)

  • Create a report-generator.js file at the project root:

    const report = require('multiple-cucumber-html-reporter');
    const path = require('path');
    const projectName = path.basename(__dirname);
    const projectVersion = process.env.npm_package_version;
    const reportGenerationTime = new Date().toISOString();
    report.generate({
      reportName: 'TestCafé Report',
      jsonDir: 'cucumber-json-reports',
      reportPath: 'cucumber-json-reports/html',
      openReportInBrowser: true,
      disableLog: true,
      displayDuration: true,
      displayReportTime: true,
      durationInMS: true,
      customData: {
        title: 'Run info',
        data: [
          { label: 'Project', value: `${projectName}` },
          { label: 'Release', value: `${projectVersion}` },
          { label: 'Report Generation Time', value: `${reportGenerationTime}` },
        ],
      },
    });
  • insert the following script in the package.json file:

    "report": "node report-generator.js",
  • run the command npm run report

Tagging

  • Tags enables to filter the html report;
  • Tags are generated dynamically from the:
    • fixture description
    • test description
    • fixture file name (TBD)
    • fixture folder hierarchy (TBD)
    • new t.meta() syntax (TBD)

Tags managment

  • Tags can be managed through the configuration file testcafe-reporter-cucumber-json.json
    • this json file will be created on the first reporter run
  • To discard a tag, add this tag to the noisyTags section of the json configuration file.

Error rendering

  • this reporter will report multiple code frames, one for each file reported in the stacktrace
1) The specified selector does not match any element in the DOM tree.

   Browser: Firefox 59.0.0 / Mac OS X 10.12.0
   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

      13 |
      14 |  const value = inputData.name || "";
      15 |
      16 |  await t
      17 |    .setTestSpeed(config.testcafe.testSpeed)
   --------------------------------------------
    → 18 |    .hover(selector.userNameInputBox)
   --------------------------------------------
      19 |    .expect(selector.userNameInputBox.hasAttribute("disabled")).notOk()
      20 |    .typeText(selector.userNameInputBox, value, {replace: true})
      21 |    .pressKey("tab");
      22 |};
      23 |

      at Object.(anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:18:6)
      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:7:71)
      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:3:12)
      at exports.default (/Users/HDO/VSCodeProjects/testcafe-starter/domains/testcafe-sample-page/steps/i-enter-my-name.ts:7:36)


       6 |  if (canExecute === false) {
       7 |    return;
       8 |  }
       9 |  const foundStep = stepMappings[stepName];
      10 |  if (typeof foundStep === "function" ) {
   --------------------------------------------
    → 11 |    await foundStep(stepName);
   --------------------------------------------
      12 |    return;
      13 |  }
      14 |  throw new Error(`Step "${stepName}" is not mapped to an executable code.`);
      15 |}
      16 |export async function given(stepName: GivenStep) {

      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:11:11)
      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:7:71)
      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:3:12)
      at executeStep (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:14:12)
      at Object.(anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:20:9)
      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:7:71)
      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:3:12)
      at Object.when (/Users/HDO/VSCodeProjects/testcafe-starter/step-runner.ts:34:12)


      19 |  await  then("no name should be populated");
      20 |  await   and("I cannot submit my feedback on testcafe");
      21 |});
      22 |
      23 |test("Scenario: can send feedback with my name only", async () =) {
   --------------------------------------------
    → 24 |  await  when("I enter my name");
   --------------------------------------------
      25 |  await  then("I can submit my feedback on testcafe");
      26 |});
      27 |
      28 |test("Scenario: send feedback", async () =) {
      29 |  await env.only( "devci");

      at Object.(anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:24:10)
      at (anonymous) (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:7:71)
      at __awaiter (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:3:12)
      at test (/Users/HDO/VSCodeProjects/testcafe-starter/features/testcafe-sample-page.spec.ts:23:66)

Screenshot rendering

  • this reporter embeds all screenshots as base 64 images, making the generated json file completely autonomous.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].