gkushang/cucumber-html-reporter

Cucumber HTML Reporter cannot parse (upcoming/newer NDJSON) "message" format

x80486 opened this issue · 8 comments

Upcoming Cucumber versions (@cucumber/cucumber) will deprecate the built-in json formatter — although I'm not entirely sure when they say "the next major release" if it's the upcoming version 7.x or the next major version after that one.

If the new @cucumber/cucumber version is used with --format message:reports/cucumber-messages.ndjson, then cucumber-html-reporter (latest version 5.2.0) doesn't understand the (new) JSON output:

[x80486@uplink:~/ccmbr]$ npm run report 

> ccmbr@0.2.0 report /home/x80486/ccmbr
> ts-node html-reporter.ts


⚠️  😞 Unable to parse cucumberjs output into json: '%s' reports/cucumber-messages.ndjson SyntaxError: reports/cucumber-messages.ndjson: Unexpected token { in JSON at position 213

To be clear, I understand it's almost a completely new JSON output/format, but I'm just wondering what's the next step for this module in that regard, or if it's just going to be superseded by the new HTML report feature — the one with --publish.

I would also like to know, what is the position on this in terms of updating to use the new version of cucumber, as I am also using the module and would like to know if i have to find another

Version 7.x comes with a built-in (very decent I would say) HTML formatter. This one has plenty of more options compared to the built-in one though.

@x80486 are you saying that v7.x is working well with Cucumber HTML Reporter and all I have to do is make a few changes as it have a builtin HTML formatter?

I didn't mentioned that. I said that there was a built-in HTML reporter in Cucumber 7.x and you have the link to the issue because it wasn't working quite well initially (but now it works).

However, the built in html formatter limits the ability to collect data from parallel runs (in ndjson format) and publish them as a single report

However, the built in html formatter limits the ability to collect data from parallel runs (in ndjson format) and publish them as a single report

How about filing an issue in their repo for that? Probably it's an easy fix 😇

Would you be updating this module to work with Cucumber 7x as the builtin reporter is for single use and not parallel runs as stated above. Plus this module have more and better options with it comes to the final output.

@x80486 - I doubt it is an easy fix, as the HTML formatted is emitting the output during runtime, hence it is not relevant for aggregating data collected on different machines. This is a great benefit of this HTML formatted, that it works after the run.
I would think supporting ndjson in this HTML formatted is probably a better path.