Code Monkey home page Code Monkey logo

pdfextentreporter's Introduction

This artifact creates a PDF report format for the popular ExtentReports. Refer to this article for more details.

Sample Report

BDD Sample Report

The report contains four sections โ€“ summary section with a dashboard and attribute summary, test details section, attribute details section and media section. There is a one to one mapping between the Spark and PDF reports. The summary section maps to the dashboard tab of the Spark report. The test details section maps to the test tab of the Spark report. The attribute details section maps to the category, author, device and exception tabs.

The PDF report is a single file with the medias embedded in it. This allows it to be shared easily without need of zipping and extracting contents. This convenience comes with the issue of file size, if report contains numerous medias. This report currently does not support base64 media.

The report uses MIT or Apache licensed code for PDF display which removes any licensing issues. Following are the PDF related dependencies โ€“ PDFBox, easytable and pdfbox-layout. The report uses the open source Liberation Sans font family.

The following dependency needs to be added for creating the Extent PDF report.

<dependency>
	<groupId>tech.grasshopper</groupId>
	<artifactId>pdfextentreporter</artifactId>
	<version>1.3.2</version>
</dependency>

Dashboard

sample

Attribute Summary

sample

Tests Summary

sample

Attribute Details

sample

Expanded Medias

sample

pdfextentreporter's People

Contributors

grass-hopper-moc avatar grasshopper7 avatar

Watchers

 avatar

Forkers

nirgallner

pdfextentreporter's Issues

The TrueType font null does not contain a 'cmap' table

When multiple reports are created, the first report builds normally, but the second and all subsequent reports don't build and throw an exception:

java.io.IOException: The TrueType font null does not contain a 'cmap' table at org.apache.fontbox.ttf.TrueTypeFont.getUnicodeCmapImpl(TrueTypeFont.java:561) at org.apache.fontbox.ttf.TrueTypeFont.getUnicodeCmapLookup(TrueTypeFont.java:541) at org.apache.fontbox.ttf.TrueTypeFont.getUnicodeCmapLookup(TrueTypeFont.java:527) at org.apache.fontbox.ttf.TTFSubsetter.<init>(TTFSubsetter.java:90) at org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.subset(TrueTypeEmbedder.java:347) at org.apache.pdfbox.pdmodel.font.PDType0Font.subset(PDType0Font.java:256) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1367) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1342) at tech.grasshopper.reporter.ReportGenerator.generate(ReportGenerator.java:92) at tech.grasshopper.reporter.ExtentPDFReporter.flush(ExtentPDFReporter.java:105) at tech.grasshopper.reporter.ExtentPDFReporter.access$100(ExtentPDFReporter.java:20) at tech.grasshopper.reporter.ExtentPDFReporter$1.onNext(ExtentPDFReporter.java:84) at tech.grasshopper.reporter.ExtentPDFReporter$1.onNext(ExtentPDFReporter.java:77) at io.reactivex.rxjava3.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:310) at io.reactivex.rxjava3.subjects.PublishSubject.onNext(PublishSubject.java:226) at com.aventstack.extentreports.ReactiveSubject.onFlush(ReactiveSubject.java:83) at com.aventstack.extentreports.AbstractProcessor.onFlush(AbstractProcessor.java:85) at com.aventstack.extentreports.ExtentReports.flush(ExtentReports.java:279) at Test.main(Test.java:13)

This doesn't happen if ExtentSparkReporter is used.

Code sample to reproduce the bug:
`
import com.aventstack.extentreports.ExtentReports;
import tech.grasshopper.reporter.ExtentPDFReporter;

import java.io.File;

public class Test {

public static void main(String[] args) {
    for (int i = 0; i < 3; i++) {
        System.out.println("Report " + i);
        ExtentReports testReport = new ExtentReports();
        testReport.attachReporter(new ExtentPDFReporter(new File(i + ".pdf")));
        testReport.flush();
    }
}

}
`

The TrueType font null does not contain a 'cmap' table

Hi Team,
While trying to execute Cucumber Maven TestNG Framework, via eclipse TestRunner, pdf report is generated successfully.
But when same parameters are executed via command prompt using mvn clean test, it throws and error:
tech.grasshopper.pdf.exception.PdfReportException: java.io.IOException: The TrueType font null does not contain a 'cmap' table

Attached are detail logs.
Below are the version mapped.

tech.grasshopper
extentreports-cucumber7-adapter
1.13.0

	<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
	<dependency>
		<groupId>com.aventstack</groupId>
		<artifactId>extentreports</artifactId>
		<version>5.0.9</version>
	</dependency>

error logs for pdf report.txt

Bad color log details

Hi,

Thank you for this useful library. I've been using it extensively.

However, I've encountered an issue with the log color in the detailed test table. I set the color to brown for Skip, but as you can see here, it appears yellow in the end label. Additionally, other end labels also differ from the configured colors.

image

My configuration:

{
  "displayAttributeSummary": true,
  "displayAttributeDetails": true,
  "displayTestDetails": true,
  "displayExpandedMedia": true,
  "title": "Test Automation Reports",
  "titleColor": "000000",
  "dateColor": "000000",
  "startTimesColor": "000000",
  "finishTimesColor": "000000",
  "durationColor": "000000",
  "passCountColor": "000000",
  "failCountColor": "000000",
  "passColor": "0A8C47",
  "failColor": "E57373",
  "skipColor": "B17750",
  "warnColor": "FFC100",
  "infoColor": "114444",
  "categoryTitleColor": "000000",
  "categoryNameColor": "000000",
  "authorTitleColor": "000000",
  "authorNameColor": "000000",
  "deviceTitleColor": "000000",
  "deviceNameColor": "000000",
  "systemTitleColor": "000000",
  "systemNameColor": "000000",
  "systemAttributeColor": "000000",
  "systemValueColor": "000000",
  "exceptionTitleColor": "000000",
  "attributeTestStatusColor": "660066",
  "testNameColor": "000000",
  "testDescriptionColor": "000000",
  "testTimesColor": "000000",
  "testTimeStampColor": "080808",
  "testExceptionColor": "E57373",
  "categoryAttributeColor": "A9A9A9",
  "maxTableColumnCount": 5
}

Do you have any suggestions to fix this?

Thanks in advance.

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.