Closed qamadhu closed 5 years ago
@qamadhu This was resolved in extentreports-4.0.2
. Let me bump the version here, but you can test by adding the latest extentreports
version in your pom.xml and check once.
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports-testng-adapter</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>4.0.5</version>
</dependency>
@qamadhu are you adding the code you've shared with me in your project? With this adapter, you only need to add the relevant listener to your base class; no extra settings required. See here.
Once you've done this, simply add a extent.properties
file under src/test/resources
with the required configuration paths and the service will automatically pick it so you do not need to add any extra code in your project besides the @Listener
.
I have created a few examples here
Configuration for above: https://github.com/extent-framework/examples/tree/master/extentreports-testng-adapter-example/src/test/resources
Refer readme: https://github.com/extent-framework/extentreports-testng-adapter/blob/master/Readme.md
Hi Anshooarora, Thank you for the update. I used ExtentIReporterSuiteListenerAdapter at suite level and it was working fine but I couldn't able to solve below points in that
Thank you for helping
Well, the IReporter runs after suite completion so having access to realtime events is not possible. You need ITestListener. See here for options:
http://extentreports.com/docs/versions/4/java/testng.html#listeners
Thank you, Anshooarora, still issue exists for time updating I have update the latest latest version in pom.xml PFA
Is this a regression?
@foursyth yeah, but also a bug in the IReporter
listeners.
@qamadhu Please check with extentreports-testng-adapter:1.0.3-SNAPSHOT
.
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports-testng-adapter</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
@anshooarora I'm not able to add the maven dependency with above version. It's giving me missing me error "Missing artifact com.aventstack:extentreports-testng-adapter:jar:1.0.3-SNAPSHOT" in pom.xml
I tried deleting the files in .m2 and updated the maven project, But it's not updating with new version Could you please let me know anything need to be updated
Thanks,
You need to enable SNAPSHOTS, see here https://stackoverflow.com/questions/7713996/is-there-a-way-to-make-maven-download-snapshot-versions-automatically
Thank you
Hi Anshoo Arora, If you notice, the duration for individual test cases is updated correctly whereas the overall duration of whole test suite is not updating I tried with extentreports-testng-adapter- ExtentIReporterSuiteListenerAdapter listener as well as below code and it's giving me same result. Please guide me if anything mistake I did.
public class ExtentIReporterSuiteListenerAdapter implements IReporter { private static final Calendar CALENDAR = Calendar.getInstance(); private ExtentReports extent; public void generateReport(List xmlSuites, List suites, String outputDirectory) {