File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
core/src/main/java/org/jsmart/zerocode/core Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,9 @@ public interface ZeroCodeReportConstants {
2121 String ZEROCODE_JUNIT = "zerocode.junit" ;
2222 String CHARTS_AND_CSV = "gen-smart-charts-csv-reports" ;
2323
24+ // Custom js and css for extent report
25+ String EXTENT_ADDITIONAL_JS = "document.querySelector('.vheader').insertAdjacentHTML('afterbegin'," +
26+ "'<div id=\" theme-selector\" class=\" nav-right\" onClick=$(\" body\" ).toggleClass(\" dark\" )>" +
27+ "<span class=\" badge badge-primary\" ><i class=\" fa fa-desktop\" ></i></span></div>')" ;
28+ String EXTENT_ADDITIONAL_CSS = "#theme-selector{padding-right:12px;padding-left:12px;margin-right:10px}" ;
2429}
Original file line number Diff line number Diff line change 88import java .util .Properties ;
99import java .util .Set ;
1010
11+ import static org .jsmart .zerocode .core .constants .ZeroCodeReportConstants .EXTENT_ADDITIONAL_CSS ;
12+ import static org .jsmart .zerocode .core .constants .ZeroCodeReportConstants .EXTENT_ADDITIONAL_JS ;
1113import static org .jsmart .zerocode .core .constants .ZeroCodeReportConstants .REPORT_DISPLAY_NAME_DEFAULT ;
1214import static org .jsmart .zerocode .core .constants .ZeroCodeReportConstants .REPORT_TITLE_DEFAULT ;
1315import static org .slf4j .LoggerFactory .getLogger ;
@@ -56,7 +58,8 @@ public static void attachSystemInfo() {
5658 public static ExtentSparkReporter createExtentHtmlReporter (String reportFileName ) {
5759 extentSparkReporter = new ExtentSparkReporter (reportFileName );
5860
59-
61+ extentSparkReporter .config ().setJs (EXTENT_ADDITIONAL_JS );
62+ extentSparkReporter .config ().setCss (EXTENT_ADDITIONAL_CSS );
6063 extentSparkReporter .config ().setDocumentTitle (REPORT_TITLE_DEFAULT );
6164 extentSparkReporter .config ().setReportName (REPORT_DISPLAY_NAME_DEFAULT );
6265
You can’t perform that action at this time.
0 commit comments