-
-
Notifications
You must be signed in to change notification settings - Fork 7
cucumber-json-formatter (cucumber-gherkin-windows-amd64) not creating proper JSON outcomeΒ #13
Description
π 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:
- Install cypress latest
- 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;
};
-
Create a feature & spec file
-
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
-
Added below section in package.json file:
"cypress-cucumber-preprocessor": {
"json": {
"enabled": true,
"formatter": "formatter/cucumber-json-formatter.exe",
"output": "reports/cucumber-report.json"
}
} -
Run the npx cypress run to execute the test and create the report (cucumber-report.json)
-
Content of the cucumber-report.json generated in Mac and Windows should be same.
Please let me know for any additional information.