cucumber-reporting
cucumber-reporting copied to clipboard
Adding screenshots at the required steps
How to add screen shots at a gherkin step How to write extra info to a given gherkin step
Hi @gogu1988 , I'm not familiar with GittHub and issue management but open an issue may not be the best way to help you .. This is our code using Katalon Studio but you can find plenty of help more suitable to your setup
@After
public void cucumberAfter(Scenario scenario) {
if(scenario.isFailed()) {
println "teardown Tests cucumber isFailed"
try {
String filePath = WebUI.takeScreenshot()
File file = new File(filePath)
scenario.embed(Files.readAllBytes(file.toPath()), "image/png")
}
catch (Exception e) {
println "screenshot exception : "+e.message
}
}
}