Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

cucumber-json-formatter (cucumber-gherkin-windows-amd64) not creating proper JSON outcomeΒ #13

@binodtcs

Description

@binodtcs

πŸ‘“ What did you see?

Cucumber-report.json created by the cucumber-json-formatter for windows is not a valid JSON and also the report looks different from the Json report created in Mac system

βœ… What did you expect to see?

Content of the json report for windows and Mac should be same and also json report should be valid

πŸ“¦ Which tool/library version are you using?

@badeball/cypress-cucumber-preprocessor": "^9.2.1",
@cypress/browserify-preprocessor": "^3.0.2",
"cypress": "latest",
"typescript": "^4.6.4"

package.json file:
"cypress-cucumber-preprocessor": {
"json": {
"enabled": true,
"formatter": "formatter/cucumber-json-formatter.exe",
"output": "reports/cucumber-report.json"
}
}

πŸ”¬ How could we reproduce it?

Steps to reproduce the behavior:

  1. Install cypress latest
  2. Install cypress-cucumber package and add index.ts with below content:
    import * as browserify from "@cypress/browserify-preprocessor";
    import { preprocessor } from "@badeball/cypress-cucumber-preprocessor/browserify";
    import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";

export default async(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> => {
await addCucumberPreprocessorPlugin(on, config);
on(
"file:preprocessor",
preprocessor(config, {
...browserify.defaultOptions,
typescript: require.resolve("typescript"),
})
);

return config;
};

  1. Create a feature & spec file

  2. Create a formatter folder at root and place the latest version of cucumber-json-formatter file from https://github.com/cucumber/common/releases for windows 64 and keep without .exe extension as mentioned in the link https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/json-report.md

  3. Added below section in package.json file:
    "cypress-cucumber-preprocessor": {
    "json": {
    "enabled": true,
    "formatter": "formatter/cucumber-json-formatter.exe",
    "output": "reports/cucumber-report.json"
    }
    }

  4. Run the npx cypress run to execute the test and create the report (cucumber-report.json)

  5. Content of the cucumber-report.json generated in Mac and Windows should be same.

Please let me know for any additional information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions