Add custom info to JBehave HTML report

2019-06-26 11:42发布

问题:

When generating reports, JBehave automatically puts the story contents into the report, along with possible assertion failures. So far, so good. However, I would like to add some more information, especially (but not necessarily limited to) failing steps.

In the concrete case at hand, the test generates random file names to guarantee uniqueness while running the scenario. I would like these names, that are generated in my @Given or @When annotated methods, to be included in the report.

I find the documentation a bit lacking/confusing. Am I missing something obvious?

回答1:

See:

Additional logging JBehave

In your case, you would have to store the generated filenames as attributes of the test driver, and print them out at the end.