adiralashiva8 / testng-metrics

A HTML Report of test executions via TestNG (No code changes required, Export results)

Home Page:https://testng-metrics.netlify.com/#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TestNg Metrics Report

TestNg Metrics is a custom report generated using TestNG Listener. Which generate awesome html report without making any changes in your existing automation code

Maven Central PRs Welcome Maintenance Open Source Love png1 HitCount


  • Sample Report link

Best viewed in desktop!


Key Features

  • Dashboard View of execution results
  • Top 10 Test Performances
  • Sort and Search Results
  • Export Results (pdf, excel, csv, print)
  • No Code changes required
  • Metrics of After* and Before*
  • Display dataprovider info for tests

Pre-requisite

  • JDK 8+
  • TestNG 6+

How to use in Project:

Maven:

  1. Add testng-metrics dependency in pom.xml

    <dependency>
      <groupId>com.github.adiralashiva8</groupId>
      <artifactId>testng-metrics</artifactId>
      <version>1.6</version>
    </dependency>
    
  2. Perform maven install

  3. Execute test cases

  4. TestNg Metrics report file will be created

    By default report will be generated at TestNG's output directory. i.e., test-output/metric.html


Not a Maven Project?

  1. Download testng-metrics.jar from here

  2. 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
  3. Execute test cases

  4. TestNg Metrics report will be generated


Customize Report:

  • Custom Logo: Logo can be modified by modifying:

    testng.metrics.report.logo parameter value in testng.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 in testng.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 in testng.xml

    Example:

    <parameter name="testng.metrics.report.appendTimestamp" value = "True"/>
    

Thanks for using testng-metrics!

  • What is your opinion of this report?
  • What’s the feature I should add?

If you have any questions / suggestions / comments on the report, please feel free to reach me at


Special Thanks To:

Contributors:

  1. Krishnan Mahadevan

    • Mavenised the project ( To consume it from Maven library )
    • Converted the utility into a TestNg listener
    • Guided to publish the library into Maven Central
  2. Saurabh Gupta

    • Contributed source to display data-provider info in Test Metrics
    • Added brand LOGO for TestNG Metrics
  3. Nainappa Illi

    • Contributed source to archive test-output folder and display execution time

Feedback:

  1. Venkateswara Reddy G

  2. Shyam

  3. Testng Users Community


⭐ repo if you like it


Inspired from robotframework-metrics


About

A HTML Report of test executions via TestNG (No code changes required, Export results)

https://testng-metrics.netlify.com/#

License:MIT License


Languages

Language:HTML 75.5%Language:Java 20.3%Language:CSS 2.5%Language:JavaScript 1.7%