Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support hierarchy of Steps in the JSON output #1111

Closed
Kausam opened this issue Apr 21, 2020 · 5 comments
Closed

Feature Request: Support hierarchy of Steps in the JSON output #1111

Kausam opened this issue Apr 21, 2020 · 5 comments
Labels

Comments

@Kausam
Copy link

Kausam commented Apr 21, 2020

Summary

karate allows us to call a Scenario from a Step but the json output shows all the steps at the same level. It would be awesome if the json output supports having multiple Steps inside a Step. This would enable reporting tools to create more readable reports.

Expected Behavior

If we allow a single Step to contain all the nested Steps it calls,
Reporting tools can then leverage this and display the result in a much more readable format. A short json snippet highlighting the proposed change.
ProposedReport
The above report can be generated by using this json and a slightly modified version of the cucumber-reporting tool.

Current Behavior

Currently, all the steps (including the steps from nested features) are put at the same level in the json output. This means that the generated report can potentially show thousands of steps all at once.
Current json file plugged into the existing reporting tool generates the following report:
CurrentReport

Context & Motivation

I found it hard to understand/go through a 4000 line html report. The few important(top level) steps were getting lost among a myriad of irrelevant steps. Having an option to hide nested steps would make the report easier to deal with. I wish to know if we can have this feature in karate.

@ptrthomas
Copy link
Member

@Kausam the JSON output is actually a "standard" - this is what Cucumber outputs, and we can't change it. for details, read this: #1035 and https://relishapp.com/cucumber/cucumber/docs/formatters/json-output-formatter

that said, you may be happy to know that we are nearly done writing our own "native" built-in HTML report, which will be the "default" going forward, and it will retain the step "nesting" you are looking for: https://twitter.com/KarateDSL/status/1237797240686522369

you can help by trying this out from the develop branch (see wiki for developer guide) and contributing there if needed. open new specific tickets if needed

@ptrthomas
Copy link
Member

and @Kausam you really should have mentioned that you submitted this issue on the other project: damianszczepanik/cucumber-reporting#926 - looks like you got a clear response there as well :)

@Kausam
Copy link
Author

Kausam commented Apr 23, 2020

Yeah, I figured that this would require change in other projects too. I had raised a similar issue on the Cucumber repository too. They said that they are anyway phasing out the JSON report. That's another dead end.
But knowing that we're going to have a native reporting tool is really cool. I would love to contribute and am looking forward to using it. :D

@ptrthomas
Copy link
Member

They said that they are anyway phasing out the JSON report

@Kausam can you provide a link or source, it will be good to have in this ticket for reference

@Kausam
Copy link
Author

Kausam commented Apr 23, 2020

@ptrthomas, sure! Here is the cucumber issue: cucumber/common#979

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

No branches or pull requests

2 participants