TestNg Metrics is a custom report generated using TestNG Listener. Which generate awesome html report without making any changes in your existing automation code
Best viewed in desktop!
After*
and Before*
Add testng-metrics dependency in pom.xml
<dependency>
<groupId>com.github.adiralashiva8</groupId>
<artifactId>testng-metrics</artifactId>
<version>1.6</version>
</dependency>
Perform maven install
Execute test cases
TestNg Metrics report file will be created
By default report will be generated at TestNG's output directory. i.e.,
test-output/metric.html
Download testng-metrics.jar
from here
Add testng-metrics.jar
in your project
- Open Eclipse → Right click on the project
- Go to Property → Build Path → Configure Build Path
- Add the
testng-metrics.jar
in the libraries using Add External Jar button
Execute test cases
TestNg Metrics report will be generated
Custom Logo: Logo can be modified by modifying:
testng.metrics.report.logo
parameter value intestng.xml
Example:
<suite name="Suite">
<parameter name="testng.metrics.report.logo" value = "https://i.ibb.co/FqtQyC5/rfh.png"/>
<test name="Test">
<classes>
<class name="com.github.functional.FunctionalSample"/>
</classes>
</test>
</suite>
Custom Report Name: Similar to Custom Logo user can be modify report name by modifying:
testng.metrics.report.name
parameter value intestng.xml
Example:
<parameter name="testng.metrics.report.name" value = "regression.html"/>
This helps in create different reports for different cases
Report With Timestamp: Helps to create new file by appending timestamp to report every time
testng.metrics.report.appendTimestamp
parameter value intestng.xml
Example:
<parameter name="testng.metrics.report.appendTimestamp" value = "True"/>
Thanks for using testng-metrics!
If you have any questions / suggestions / comments on the report, please feel free to reach me at
adiralashiva8@gmail.com
shivaprasadadirala
@ShivaAdirala
testng-metrics
Special Thanks To:
Contributors:
- Mavenised the project ( To consume it from Maven library )
- Converted the utility into a TestNg listener
- Guided to publish the library into Maven Central
- Contributed source to display data-provider info in Test Metrics
- Added brand LOGO for TestNG Metrics
- Contributed source to archive test-output folder and display execution time
Feedback:
[Shyam]()
:star: repo if you like it
Inspired from robotframework-metrics