I have created a git repo with the code which was inspired from
https://www.youtube.com/watch?v=0ZKmMVqW-b0&t=1400s
https://www.youtube.com/watch?v=j1mHtrgVcIM&list=PL5fOKT7XR42Om0spD8QtxuQ4Y9ONra6dq&index=13
Git repo: https://github.com/avighub/ExtentReport4-testNG-java
This extent report has below Features:
it can be easily plugged in to any Java – testNG framework for a beautiful Dashboard report.
It has separate Listener configuration : TestListeners.java, which has default setting for all Test() based on pass, skip, fail and it will capture package name, method name into report, no need to explictly write it in Test() method. Only Test related info can be added.
For Failed cases, stack trace error log and screenshot is added automatically by TestListeners.java, no need to add any extra steps.
Steps to add this report in existing project:
- Add ExtentReportManager.java and TestListerns.java in your config package or anywhere in your project
- Add listner @Listeners({TestListeners.class}) in Test base as shown in Testbase.java.
or else add listener in testng.xml file:
<listeners>
<listener class-name=”packagename.TestListeners”></listener>
</listeners> - Make sure to extend TestBase class in TestListeners class

