如何解决Extent report 无法加载CSS样式 的问题


how to fix the ExtentReport.html without css styple

See the highlight, add htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS);

private void init(List<XmlSuite> xmlSuites) {
String suiteName = xmlSuites.get(0).getName();
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(OUTPUT_FOLDER + FILE_NAME);
htmlReporter.config().setDocumentTitle("ExtentReports: " + suiteName);
htmlReporter.config().setReportName(suiteName);
htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
htmlReporter.config().setTheme(Theme.STANDARD);
htmlReporter.config().setChartVisibilityOnOpen(true);
htmlReporter.config().setEncoding("utf-8");
//Fix the report with css stype
htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS);

extent = new ExtentReports();
extent.attachReporter(htmlReporter);
extent.setReportUsesManualConfiguration(true);
}

After that, rerun the test, and open the report, it shows the css style as below.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM