Reputation: 133
When i open my extent report post run, by default it opens with list of tests that are run. But what i need is, by default it should show Dashboard. Is there any way to do so? Help on this will be appreciated. Thanks
Upvotes: 0
Views: 1728
Reputation: 1
You can set your preferred order when creating the reporter. It would look something like this: (I'm using version 5 as well)
ExtentSparkReporter htmlReporter = new ExtentSparkReporter(fileName);
List<ViewName> DEFAULT_ORDER = Arrays.asList(ViewName.DASHBOARD, ViewName.CATEGORY, ViewName.TEST);
htmlReporter.viewConfigurer().viewOrder().as(DEFAULT_ORDER);
report = new ExtentReports();
report.attachReporter(htmlReporter);
In this case the Dashboard will be the default page and on the top the left menu, followed by Categories and then the list of tests.
Upvotes: 0
Reputation: 480
You can inject javascript on document load to make the dashboard view visible by default.
<scripts>
<![CDATA[
$(document).ready(function() {
$('#an_unique_identifier_of_dashboard_e.g.[id/name/xpath/css]').click();
});
]]>
</scripts>
Upvotes: 0