gkushang / cucumber-html-reporter

Generates Cucumber HTML reports in three different themes
MIT License
234 stars 156 forks source link

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

Open x80486 opened 4 years ago

x80486 commented 4 years ago

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.

larryg01 commented 3 years ago

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

x80486 commented 3 years ago

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.

larryg01 commented 3 years ago

@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?

x80486 commented 3 years ago

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

Tallyb commented 3 years ago

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

x80486 commented 3 years ago

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 😇

larryg01 commented 3 years ago

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.

Tallyb commented 3 years ago

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