extent-framework / extentreports-cucumber4-adapter

Cucumber4 Adapter for Extent Framework
http://extentreports.com/docs/versions/4/java/cucumber2.html
Apache License 2.0
39 stars 22 forks source link

extentreports-cucumber4-adapter screenshot not attaching #46

Closed jinkaax closed 4 years ago

jinkaax commented 4 years ago

Hi, I am using extentreports-cucumber4-adapter , version 1.0.8 with cucumber 4.8.1, It does not attach screenshots to html report. It just save screenshots in a folder that I specified in screenshot.dir. How can I attach screenshots to HTML report? I want a method which can be called anywhere in between steps to capture and attach the screenshot.

something like Reporter.addScreenCaptureFromPath(screenshotName);

Thanks

USTQE commented 4 years ago

Hi Team,

I have the same issue which @jinkaax has mentioned. Please us know the solution.

Thanks, Abhilash G

anshooarora commented 4 years ago

Please see here https://github.com/extent-framework/extentreports-cucumber4-adapter/issues/20#issuecomment-601591963

Can you try with the latest snapshot and revert back?

<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports-cucumber4-adapter</artifactId>
    <version>1.0.11-SNAPSHOT</version>
</dependency>
grasshopper7 commented 4 years ago

This fails when there is a hook method with NullPointerExcep for stepTestThreadLocal.get() in updateResult() method - https://github.com/extent-framework/extentreports-cucumber4-adapter/blob/d9135d5da4d3a13f3af19f401bd45611c071f48e/src/main/java/com/aventstack/extentreports/cucumber/adapter/ExtentCucumberAdapter.java#L180

This works when this code is added to https://github.com/extent-framework/extentreports-cucumber4-adapter/blob/d9135d5da4d3a13f3af19f401bd45611c071f48e/src/main/java/com/aventstack/extentreports/cucumber/adapter/ExtentCucumberAdapter.java#L166

ExtentTest t = scenarioThreadLocal.get().createNode(Asterisk.class, event.testStep.getCodeLocation()); stepTestThreadLocal.set(t);

This was removed in this commit - https://github.com/extent-framework/extentreports-cucumber4-adapter/commit/87feacf913bb16e777998b57754050b6cd6fff74#diff-04d65aa9b0efd1ce7c82c5515cdfdbbf

anshooarora commented 4 years ago

@jinkaax @grasshopper7 This was in response to #20. I guess this is what now causes the downstream effect.

anshooarora commented 4 years ago

@jinkaax @grasshopper7 @USTRepo

Please try with 1.0.12-SNAPSHOT.

anshooarora commented 4 years ago

Release 1.0.12 contains this fix, these hooks will now be visible on the report. There are a few additional fixes coming in the next version 1.1.0. Will update the group once available. Closing this.

Rajno1 commented 4 years ago

Thanks a lot, @anshooarora, your comments and advice helping me a lot, finally I got how to get a screenshot by using extent reports-cucumber4-adapter.And could you please advice, is there any way that we can send this extent report to the mail directly ?

anshooarora commented 4 years ago

You can email this report once execution completes, although none of these templates are tested over email clients so I am not sure of their legibility when mailed.

USTQE commented 3 years ago

@anshooarora I would like to know which version we have the feature updated. I was trying with latest version. I am getting error like different packages are missing. Please help