Code Monkey home page Code Monkey logo

testng-metrics's Introduction

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

HitCount Maven Central PRs Welcome Maintenance Open Source Love png1


  • 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)
  • Generate email (.eml) with statistics
  • 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.5</version>
    </dependency>
    
  2. Perform maven install

  3. Execute test cases

  4. TestNG Metrics report metric-timestamp.html file will be created

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

ANT

 <dependency org="com.github.adiralashiva8" name="testng-metrics" rev="1.5" />

GRADLE Groovy DSL

 implementation 'com.github.adiralashiva8:testng-metrics:1.5'

GRADLE Kotlin DSL

 compile("com.github.adiralashiva8:testng-metrics:1.5")

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 metric-timestamp.html file will be created


Customize LOGO:

Want to use Custom LOGO in testng-metrics then update testng.metrics.logo JVM variable

  • From command line:

    mvn clean test -Dtestng.metrics.logo="https://mycompanylog.jpg"

  • From testng.xml: Place following lines in testng.xml

     <method-selectors>
       <method-selector>
         <script language="beanshell">
           <![CDATA[ System.setProperty("testng.metrics.logo",
             "https://mycompanylog.jpg");return true;]]>
         </script>
       </method-selector>
     </method-selectors>

Archiving Reports:

If you want to archive the entire test-output folder along with testng-metrics report, add the below parameter at suite level in your testng.xml file

<parameter name="archive.testng.metrics.report" value = "true"/>.

You can turn off this feature by either removing this parameter from testng file or by changing the value to false.

Refer the testng.xml file in the repo.

This will create a folder in your:

.current.dir/TestNg_Metrics_Reports/<Results_dd_MMM_yy_hh_mm_ss>


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


Credits:

  1. TestNG link
  2. Stackoverflow link
  3. Google charts link
  4. DataTable link
  5. Java link
  6. Jquery | JavaScript link
  7. Bootstrap link
  8. Icons8 link
  9. FontAwesome link

Note: Testng-metrics uses above mentioned open-source libraries in report.


Special Thanks To:

Contributors:

  1. Krishnan Mahadevan [Automation GURU]

    • Mavenised the project ( To consume it from Maven library )
    • Converted the utility into a TestNG listener
    • Guided to publish the library onto 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. Testng Users Community


STAR repo to appreciate us!


Inspired from robotframework-metrics


testng-metrics's People

Contributors

adiralashiva8 avatar nainappa avatar saurabhgupta94 avatar krmahadevan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.