diff --git a/core/src/main/java/org/jsmart/zerocode/core/constants/ZeroCodeReportConstants.java b/core/src/main/java/org/jsmart/zerocode/core/constants/ZeroCodeReportConstants.java index 855e4a22..c296ddc2 100644 --- a/core/src/main/java/org/jsmart/zerocode/core/constants/ZeroCodeReportConstants.java +++ b/core/src/main/java/org/jsmart/zerocode/core/constants/ZeroCodeReportConstants.java @@ -21,4 +21,9 @@ public interface ZeroCodeReportConstants { String ZEROCODE_JUNIT = "zerocode.junit"; String CHARTS_AND_CSV = "gen-smart-charts-csv-reports"; + // Custom js and css for extent report + String EXTENT_ADDITIONAL_JS = "document.querySelector('.vheader').insertAdjacentHTML('afterbegin'," + + "'
')"; + String EXTENT_ADDITIONAL_CSS = "#theme-selector{padding-right:12px;padding-left:12px;margin-right:10px}"; } diff --git a/core/src/main/java/org/jsmart/zerocode/core/domain/builders/ExtentReportsFactory.java b/core/src/main/java/org/jsmart/zerocode/core/domain/builders/ExtentReportsFactory.java index 434cf559..cad3a229 100644 --- a/core/src/main/java/org/jsmart/zerocode/core/domain/builders/ExtentReportsFactory.java +++ b/core/src/main/java/org/jsmart/zerocode/core/domain/builders/ExtentReportsFactory.java @@ -8,6 +8,8 @@ import java.util.Properties; import java.util.Set; +import static org.jsmart.zerocode.core.constants.ZeroCodeReportConstants.EXTENT_ADDITIONAL_CSS; +import static org.jsmart.zerocode.core.constants.ZeroCodeReportConstants.EXTENT_ADDITIONAL_JS; import static org.jsmart.zerocode.core.constants.ZeroCodeReportConstants.REPORT_DISPLAY_NAME_DEFAULT; import static org.jsmart.zerocode.core.constants.ZeroCodeReportConstants.REPORT_TITLE_DEFAULT; import static org.slf4j.LoggerFactory.getLogger; @@ -56,7 +58,8 @@ public static void attachSystemInfo() { public static ExtentSparkReporter createExtentHtmlReporter(String reportFileName) { extentSparkReporter = new ExtentSparkReporter(reportFileName); - + extentSparkReporter.config().setJs(EXTENT_ADDITIONAL_JS); + extentSparkReporter.config().setCss(EXTENT_ADDITIONAL_CSS); extentSparkReporter.config().setDocumentTitle(REPORT_TITLE_DEFAULT); extentSparkReporter.config().setReportName(REPORT_DISPLAY_NAME_DEFAULT);