Forum Discussion
Thanks for the info.
So actually this is not related to cucumber, but certainly to Masterthought cucumber reporter.
You are using the json formatter from cucumber. Your output is not identified as "Output 1" by cucumber or its json formater. Masterthought cucumber-reporting do that, and I do not know that tool myself.
You'll certainly be able to get more appropriate help from the developer: https://github.com/damianszczepanik/cucumber-reporting
Hi,
Thanks for the reply.
Masterthought only interprets the info that is found in the json afaik.
I just opened up the json file, the one created by cucumber, and there is a field in it called: "output" which was created by the scenario.write function (basically the output is something like this: output: "text written in the function")
And to expand a bit, scenario.write function seems to be linked to the ScenarioImpl.class from cucumber.runtime package, and from there it goes into the Reporter class from the Gherkin Formatter classes.
Any thoughts?
Thanks
- aurelien-reeves3 years agoStaff
Yes, the json contains that "output" key. This is how data are structured within the json formatter: this is the name of a field, an internal identifier. It is up to the final renderer if built upon the json report to decide how to render that info.
Masterthought decided to render the name of that field capitalizing it and adding an index to it.
The cucumber built-in html formatter does not render the name of that field at all, just its content.
I could imagine several ways for you to override "Output N" in your HTML report:
- writing your own custom formatter which may override the cucumber-jvm json formatter to modify the behavior of "addOutputToHookMap" (cf. cucumber-jvm/JsonFormatter.java:331)
- add a step before rendering the HTML report to update the json file to replace "output" with what you want
- see with Masterthought what could be done on their side
Related Content
Recent Discussions
- 5 months agopz1502
- 5 months agoraja110199