extentreports-java
extentreports-java copied to clipboard
unable to add logo in extent spark report.
this is my extent.xml file
<!-- standard, dark -->
<theme>standard</theme>
<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>
<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>http</protocol>
<!-- title of the document -->
<documentTitle>Extent</documentTitle>
<!-- report name - displayed at top-nav -->
<reportName> Employee Care Automation Report
<![CDATA[
<img src='src/test/resources/screenshots/SFlogo.jpg' />
]]>
</reportName>
<!-- location of charts in the test view -->
<!-- top, bottom -->
<testViewChartLocation>top</testViewChartLocation>
<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
img { float: left;height: 90%;margin-left: 30px;margin-top: 2px;width: auto; }]]>
this is my extent.properties file
extent.reporter.spark.start=true extent.reporter.spark.out=test-output/HtmlReport/ExtentHtml.html #extent.reporter.pdf.start=true #extent.reporter.pdf.out=test output/PdfReport/ExtentPdf.pdf #basefolder.name=reports #basefolder.datetimepattern=d-MMM-YY HH-mm-ss extent.reporter.spark.vieworder=dashboard,test,category,exception,author,device,log systeminfo.os=windows systeminfo.user=saikrishna systeminfo.build=1.1 systeminfo.AppName=Employee Care systeminfo.reportName=Employee Care extent.reporter.spark.config=src/test/resources/extent-config.xml
extent.reporter.avent.start=false extent.reporter.bdd.start=false extent.reporter.cards.start=false extent.reporter.email.start=false extent.reporter.html.start=true extent.reporter.klov.start=false extent.reporter.logger.start=true extent.reporter.tabular.start=false
extent.reporter.avent.config= extent.reporter.bdd.config= extent.reporter.cards.config= extent.reporter.email.config= extent.reporter.klov.config= extent.reporter.logger.config= extent.reporter.tabular.config=
extent.reporter.avent.out=test-output/AventReport/ extent.reporter.bdd.out=test-output/BddReport/ extent.reporter.cards.out=test-output/CardsReport/ extent.reporter.email.out=test-output/EmailReport/ExtentEmail.html #extent.reporter.html.out=test-output/HtmlReport/ExtentHtml.html extent.reporter.logger.out=test-output/LoggerReport/ extent.reporter.tabular.out=test-output/TabularReport/
screenshot.dir=test-output/ screenshot.rel.path=../
@anshooarora need your help for adding logo to reports
@anshooarora could u please help us this issue
in extent version 5, the custom javascript has to be written in xml 'js' tags and stylesheet in 'css' tags. U should have a look at cleaning up the extent properties, many of the entries are no longer required.
Have you tried changing the default logo, at the left, with your image using custom javascript?
Could you please paste the sample code using JavaScript in config.xml file. Even my requirement is to Rename the chart from Test to Feature, Steps to Scenario and Log events to Steps for extent report 5.0.5. Please not that i am not using config.properties file and directly creating extent report object in class itself.