Closed Keyur90 closed 1 year ago
That's probably not going to happen as this preprocessor relies on cucumber-json-formatter completely for json output (parsing cucumber messages to json format). That said, I'd love to hear from @badeball if there are ANY alternatives given that cucumber-json-formatter has several bugs (reported by him as well) that are stale since May.
I've been using https://github.com/Vitalizzzer/cucumber-json-report-formatter
It consumes the messages file and generates the JSON without the need for a formatter. However, they have an open issue where the step duration shows incorrectly, however, if it doesn't bother you, you can try this out.
Awesome, thanks for the tip, I'll try it out!
I've been using https://github.com/Vitalizzzer/cucumber-json-report-formatter
It consumes the messages file and generates the JSON without the need for a formatter. However, they have an open issue where the step duration shows incorrectly, however, if it doesn't bother you, you can try this out.
Hey Sagar, thanks for referring to this. Do you mind if you can show me how have you used this? What I did is I created a file formatter.js and provided the below code within the same. (don't bother about the location)
import {Formatter} from 'cucumber-json-report-formatter';
const formatter = new Formatter() const sourceFile = "./cucumber-messages.ndjson" const outputFile = "./reports/cucumber-report.json" await formatter.parseCucumberJson(sourceFile, outputFile)
You can run the js file using node after your test execution is finished, but the easiest way is to amend the configuration in .cypress-cucumber-preprocessorrc.json
or package.json
as below:
You can run the js file using node after your test execution is finished, but the easiest way is to amend the configuration in
.cypress-cucumber-preprocessorrc.json
orpackage.json
as below:
I tried this but it is expecting to run cucumber-json-formatter and looking for that exe in the after:run tag event
@Keyur90 I guess we have the same problem, as described here #851
You can run the js file using node after your test execution is finished, but the easiest way is to amend the configuration in
.cypress-cucumber-preprocessorrc.json
orpackage.json
as below:I tried this but it is expecting to run cucumber-json-formatter and looking for that exe in the after:run tag event
Do you have a after:run event in your config? If yes, you'd need to amend it. example here: https://github.com/badeball/cypress-cucumber-preprocessor/issues/805#issuecomment-1218399297
I can not check in json-formatter.exe so wanted eliminate the json-formatter.exe file usage.
I don't expect anyone to check this into VCS anymore than I expect you to check Node into it and that's fairly unheard of. I'm using it Gitlab actions myself, without any issues: https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/.github/workflows/build.yml
Despite this, I do intend to replace it in time: https://github.com/badeball/cypress-cucumber-preprocessor/issues/870
Current behavior
Unable to get the logs without using json-formatter.exe
Desired behavior
I wanted to get the logs in JSON file of my last test run so that I can generate a cucumber report running on the agent through the CI pipeline. I can not check in json-formatter.exe so wanted eliminate the json-formatter.exe file usage.
Test code to reproduce
Versions
Checklist
cypress-cucumber-preprocessor@4.3.1
(package name has changed and it is no longer the most recent version, see #689).