How is the EmbedEvent being called in the reporters?
What needs to happen on the feature or in the stepdefs to invoke this? Can we still using the @After annotation to embed screenshots manually, even when in parallel?
Ubuntu, Win10
@After
public void afterScenario(Scenario scenario) {
scenario.write("some text");
scenario.embed(new byte[]{12, 13, 14}, "text/plain");
}
Which then emits a write or embed event to the bus.
edit: And yes it works in parallel too.
Thank you again!
Hi @foursyth @mpkorstanje
I still couldn't understand how to attach screenshot for each step of cucumber scenario of the extent report? Please help me on this as this is our project requirement.
Try using @AfterStep hook instead of the @After hook instead. I don't know Extent supports it though.
For future reference, this is not the best place to ask questions about using Cucumber. You may have more luck with the mailing list or slack https://cucumber.io/support
One last question, can I embed screenshot to the steps?
Usage:
@BeforeStep
public void beforeStep() {
}
@AfterStep
public void afterStep() {
}
In regarding to Extent, I believe the adapter will have to expose the current step so the screenshot can be attached to it. Similar to what I see for the testng adapter. Shouldn't be too much work though.
PS. So the documentation states @AfterStep currently not implemented.
https://docs.cucumber.io/cucumber/api/#afterstep
Cucumber-JVM does not support AfterStep hooks.
Is this section not up to date? Changelog states this feature was included as of version 3.0.0: https://github.com/cucumber/cucumber-jvm/blob/master/CHANGELOG.md, #1323
Way ahead of you:
Thank you! :)
Can someone guide on how to capture screeshots of failed steps?
@kavyamurthy1209 - You are commenting on a closed issue, which is not the best way for people to see your question. Please use the support forums for questions.
That said, I can probably add an example to the docs, and have created an issue for it here. I hope to be able to do so tomorrow; if it takes to long please try the support options.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Way ahead of you:
https://github.com/cucumber/docs.cucumber.io/pull/267