Created
November 14, 2012 16:01
-
-
Save aslakhellesoy/4072962 to your computer and use it in GitHub Desktop.
How to embed text into your cucumber-jvm report with Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cucumber.api.Scenario; | |
public class MyStepdefs { | |
private Scenario scenario; | |
@Before | |
public void before(Scenario scenario) { | |
this.scenario = scenario; | |
} | |
@Given("^I have (\\d+) cukes in my belly$") | |
public void cukes_in_my_belly(int cukes) { | |
scenario.write("This goes into the report(s)\n"); | |
} | |
} |
Hi, any updates on this issue, coz even I'm facing the same problem .. !!
There is a very weird implementation of this write method (throws away my message, and prints "message".... ):
https://github.com/serenity-bdd/serenity-cucumber/blame/master/src/main/java/net/serenitybdd/cucumber/SerenityReporter.java#L717
but this seams to work:
StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(message));
StepEventBus.getEventBus().stepFinished();
Is this still applicable? I am also not able to get the output in the report. Do we have any other way to write custom message to cucumber report?
Thanks a bunch, the above code snippet worked for me. I am also able to see it in my html report.
How can i do it in ruby?
is it possible write a text in report with custom css?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, we are using Cucumber ruby, and Scenario.write is undefined. Do you know if there is anything comparable for ruby?