Git Product home page Git Product logo

nandakishore444 / pdfngreport Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uttesh/pdfngreport

0.0 1.0 0.0 60.48 MB

This is the pdf report plugin library written for testng/selenium, this listener will generate the pdf report on testcases run, its very simple to configure no need to write any code.

Home Page: http://uttesh.github.io/pdfngreport/

License: Other

HTML 85.27% CSS 1.00% XSLT 3.76% Java 9.97%

pdfngreport's Introduction

pdfngreport (PDF report plugin for TestNG)

Bitdeli Badge Maven Central Build Status

Join our online chat at Gitter

====================================================================== This is the part of maven repository now,Directly add in pom following.

    <dependency>
        <groupId>com.uttesh</groupId>
        <artifactId>pdfngreport</artifactId>
        <version>2.0.9</version>
    </dependency>

This is the pdf report plugin written for testng, this listener will generate the pdf report on testcases run, its very simple to configure no need to write any code.

How to use pdfngreport Plugin


Download latest version of pdfreport download

Sample demo example source download sample

eclipse sample code download eclipse sample

PDF report sample report

pdf report preview snaps :

demo demo demo demo explode pie chart demo

Environment and dependent jar file


  1. Minimum JDK 1.6 or higher
  2. Jfree jar
  3. Apache fop jar

ANT users configuration


Download latest jfree and Apache fop jars from respective links and keep in lib.

ANT/MAVEN sample demo example <a href="https://github.com/uttesh/pdfngreportdemo" target"_blank">demo source

configure build.xml file with below testng tag

  <testng classpathref="test-path"
          outputdir="${test-results.dir}"
          haltonfailure="true"
          useDefaultListeners="false"
          listeners="com.uttesh.pdfngreport.PDFReportListener">
  </testng>

If linteners configured in ant build.xml then no need configure/set listener in testsuit xml, if configured both placess it will call PDFReportListener class two times.

MAVEN users configuration


Add below jfree and apache fop dependencies in pom.xml

       <dependency>
            <groupId>jfree</groupId>
            <artifactId>jfreechart</artifactId>
            <version>1.0.13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>fop</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.avalon.framework</groupId>
            <artifactId>avalon-framework-api</artifactId>
            <version>4.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.avalon.framework</groupId>
            <artifactId>avalon-framework-impl</artifactId>
            <version>4.3.1</version>
        </dependency>

To use the reporting plug-in, set the "listeners" attribute of the "testng" element in your Ant build file.The class names for the pdfreport is:

  com.uttesh.pdfngreport.PDFReportListener
  

You may also want to disable the default TestNG reporters by setting the "useDefaultListeners" attribute to "false".

POM testng configuration with pdfngreport plugin paramerters

             <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-surefire-plugin</artifactId>
                   <version>2.17</version>
                   <configuration>
                       <suiteXmlFiles>
                           <suiteXmlFile>testng.xml</suiteXmlFile>
                       </suiteXmlFiles>
                       <properties>
                           <property>
                               <name>usedefaultlisteners</name>
                               <value>false</value> <!-- disabling default listeners is optional -->
                           </property>
                       </properties>
                   </configuration>
               </plugin>

For Maven pom.xml configuration, Add this dependecy.

       <dependency>
           <groupId>com.uttesh</groupId>
           <artifactId>pdfngreport</artifactId>
           <version>2.0.8</version>
       </dependency> 

testng suit xml file


<?xml version="1.0" encoding="UTF-8"?>
<suite name="Simple Reporter Suite">

  <parameter name="pdfngreport-properties" value="D:\property_files\pdfngreport.properties" />
  
  <listeners>
    <listener class-name="com.uttesh.pdfngreport.PDFReportListener" />
  </listeners>

  <test name="Simple Reporter test">
    <classes>
      <class name="xyz" />
      <class name="abc" />
    </classes>
  </test>
</suite>

set the following in the respective properties file for globel parameter pdfngreport-properties

#Title
pdfreport.title.text=Report Title Here
pdfreport.title.align=left

# application build version
pdfreport.app.build.version=Build v2.0.8

# Build System Details manual/code/hide, hide is default
# enable below only for manual setting by setting code mode it will automactically populate the values in report
# manual only for the mobile/tab env related details
pdfreport.build.system.details.by=code
#pdfreport.additional.line1=OS : testOS (64 bit)
#pdfreport.additional.line2=SYSTEM : test@testingbox
#pdfreport.additional.line3=Lorem ipsum dolor sit amet


#TimeColumn Date Format
#"yyyy.MM.dd G 'at' HH:mm:ss z" | 2001.07.04 AD at 12:08:56 PDT
#"EEE, MMM d, ''yy" | Wed, Jul 4, '01
#"h:mm a"  |  12:08 PM
#"hh 'o''clock' a, zzzz" | 12 o'clock PM, Pacific Daylight Time
#"K:mm a, z" | 0:08 PM, PDT
#"yyyyy.MMMMM.dd GGG hh:mm aaa" | 02001.July.04 AD 12:08 PM
#"EEE, d MMM yyyy HH:mm:ss Z"  |  Wed, 4 Jul 2001 12:08:56 -0700
#"yyMMddHHmmssZ" | 010704120856-0700
#"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" |  2001-07-04T12:08:56.235-0700
#"yyyy-MM-dd'T'HH:mm:ss.SSSXXX" |  2001-07-04T12:08:56.235-07:00
#"YYYY-'W'ww-u" | 2001-W27-3

pdfngreport.time.column.format=MMMM dd YYYY hh:mm:sss

#Logo
pdfreport.logo=show
pdfreport.report.logo.file=E:/rivetsys/automation/pdfnglogo/logo.png
pdfreport.report.logo.align=right

# chat related
pdfreport.pie.chart.type=normal
#pdfreport.pie.chart.type=explode

# pdf report output location
pdfreport.outputdir=E:/rivetsys/automation/pdfngreport

# tables/page setting : show/hude
pdfreport.exception.page=hide

# Below setting only for selenium user for selenium failed screen shot link show related
#pdfreport.show.selenium.screenshot.link=show
#pdfreport.selenium.failed.test.screenshot.outputdir=E:/rivetsys/automation/loan_connector_10Sep14Nova/loan_connector/screenshots

# Custom color setting Coming soon on 3.0.0 version

Properties

property default description
pdfreport.title.text Specifies the required report title.
pdfreport.title.align left align the title left/right
pdfreport.app.build.version Specifies the required application build version.
pdfreport.build.system.details.by Build System Details manual/code/hide
pdfreport.additional.line1 by setting the system details properties, we can set this for the manual system details data entry
pdfreport.additional.line2 by setting the system details properties, we can set this for the manual system details data entry
pdfreport.additional.line3 by setting the system details properties, we can set this for the manual system details data entry
pdfngreport.time.column.format MMMM dd YYYY hh:mm:sss set date format for the test case execution time display.
pdfreport.logo hide by setting this property along with below properties we can add logo image to report
pdfreport.report.logo.file no default value set the location of the logo image
pdfreport.report.logo.align right align the logo image right/left
pdfreport.pie.chart.type normal set the values 'explode' for the ex[plode pie chart
pdfreport.outputdir set the location where generated report will be saved

contributions

All credit goes to jfree and Apache fop open source jar file which were used to generate the pdf report and pie chart statistic graph.

PDFngreport Developer : uttesh.com

License

(The Apache License)

Copyright (c) 2013 Uttesh Kumar T.H.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

pdfngreport's People

Contributors

uttesh avatar

Watchers

 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.