Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Missing built-in junit reporter or wrong documentation? #585

Closed
saurabh-deep opened this issue Feb 9, 2021 · 6 comments · Fixed by #586
Closed

Missing built-in junit reporter or wrong documentation? #585

saurabh-deep opened this issue Feb 9, 2021 · 6 comments · Fixed by #586

Comments

@saurabh-deep
Copy link

The reporting documentation here mentions that there is a built-in junit reporter. But when I use --format junit, it doesn't work and complains that module 'junit' is missing.

I tried to look into the error and found that method getConstructorByType in builder.ts doesn' have any mention of junit. So, is it a case of wrong documentation?

We have been using a JSON to JUNIT converter previously, which works great for us. But we are now upgrading to cucumber-js 7.0 which warns us that The built-in JSON formatter is deprecated and will be removed in the next major release. To be able to use JUNIT converter, the output needs to be in JSON. We don't want to use json-formatter since it has prebuilt executables, which doesn't work for us.

Can someone please guide me on how to get the JUNIT output from cucumber-js v7.x without using the depcrecated JSON format?

Much appreciated!

@davidjgoss
Copy link
Contributor

davidjgoss commented Feb 9, 2021

@saurabh-deep thanks for raising.

Missing built-in junit reporter or wrong documentation?

It's wrong documentation. We don't have a built-in junit formatter at the moment, although some other implementations like cucumber-jvm do. I think we need to update that page of the docs to vary the list per implementation and/or slim it down and rely on the implementation's own docs for that level of detail - I'll move this issue to the docs repo in a minute and go from there.

As to your use case, you're fine to keep using json-formatter short term, it will be removed in 8.0.0 but that's probably months away. I'm looking into the junit use case now.

@davidjgoss davidjgoss transferred this issue from cucumber/cucumber-js Feb 9, 2021
@saurabh-deep
Copy link
Author

@davidjgoss - Appreciate the super quick response! And looking forward to the junit reporter implementation for cucumber-js!

@saurabh-deep
Copy link
Author

@davidjgoss - Is there a way to suppress the following warning that is displayed when using JSON reporter with v7.0?

The built-in JSON formatter is deprecated and will be removed in the next major release. Where you need a structured data representation of your test run, it's best to use the `message` formatter. For legacy tools that depend on the deprecated JSON format, a standalone formatter is available (see https://github.com/cucumber/cucumber/tree/master/json-formatter).

@aslakhellesoy
Copy link
Contributor

I think the only way to suppress the message is to stop using the json formatter. What do you need it for @saurabh-deep ?

@saurabh-deep
Copy link
Author

saurabh-deep commented Feb 10, 2021

@aslakhellesoy - In fact we need the JUNIT output, which is missing from cucumber-js. AFAIK, only option seems to be to first get the JSON output and then convert it to JUNIT. @davidjgoss also mentioned above that it is fine to use JSON formatter till the time JUNIT formatter is not available natively in cucumber-js.

Is there any other way to get the JUNIT output from cucumber-js v7.x without triggering the JSON format deprecation warning?

@davidjgoss
Copy link
Contributor

davidjgoss commented Feb 10, 2021

@saurabh-deep from the community there is https://www.npmjs.com/package/cucumber-junit-formatter which has no dependency on the JSON output. It doesn’t support v7.0.0 yet but the author is working on it per mvtm-dn/cucumber-junit-formatter#10.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants