AventReporter
ExtentAventReporter is a rich-HTML reporter available from the professional ExtentReports library. This section outlines a few unique features present.
ExtentReports extent = new ExtentReports();
ExtentAventReporter avent = new ExtentAventReporter("target/Avent.html");
extent.attachReporter(avent);
Configuration
You can apply custom configuration to each reporter using XML, JSON or Java.
Java
avent.config(
ExtentAventReporterConfig.builder()
.theme(Theme.DARK)
.documentTitle("MyReport")
.build()
);
// or:
ExtentAventReporter avent = new ExtentAventReporter("avent.html");
avent.config().setTheme(Theme.DARK);
avent.config().setDocumentTitle("MyReport");
XML
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme -->
<!-- STANDARD, DARK -->
<theme>STANDARD</theme>
<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>
<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<!-- HTTP, HTTPS -->
<protocol>HTTPS</protocol>
<!-- offline report -->
<timelineEnabled>true</timelineEnabled>
<!-- offline report -->
<enableOfflineMode>false</enableOfflineMode>
<!-- title of the document -->
<documentTitle>Extent Framework</documentTitle>
<!-- report name - displayed at top-nav -->
<reportName>Build 1</reportName>
<!-- timestamp format -->
<timeStampFormat>MMM dd, yyyy HH:mm:ss</timeStampFormat>
<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>
<!-- custom styles -->
<styles>
<![CDATA[
]]>
</styles>
</configuration>
</extentreports>
final File CONF = new File("config/avent-config.xml");
ExtentAventReporter avent = new ExtentAventReporter("target/avent/avent.html");
avent.loadXMLConfig(CONF);
JSON
Version 4 and earlier had the ability to consume configuration-XML files, a functionality that remained unchanged in v5.0. External configuration can now be loaded via JSON also, as demonstrated below:
{
"theme": "STANDARD",
"encoding": "utf-8",
"protocol": "HTTPS",
"timelineEnabled": false,
"offlineMode": true,
"documentTitle": "ExtentReports",
"reportName": "ExtentReports",
"timeStampFormat": "MMM dd, yyyy HH:mm:ss a",
"js": "",
"css": ""
}
final File CONF = new File("config/avent-config.json");
ExtentAventReporter avent = new ExtentAventReporter("target/avent/avent.html");
avent.loadJSONConfig(CONF);
Anchors
Test anchors can be used to quickly navigate to any given test from a uri component. An anchor will be generated for each test by default and will appear to the right of the test's timestamp.
To navigate to the test using the anchor, simply add the uri component at the end of the report path:
http://path/to/index.html#test-id=2
Shortcuts
Navigation
t - test
c - tag
d - dashboard
x - exception/bug
Filters
p - show passed tests
f - show failed tests
s - show skipped tests
w - show warning tests
esc - clear filters
Scroll
down-arrow - scroll down
up-arrow - scroll up
Misc
l - switch theme