com.aventstack.extentreports.reporter.configuration.Theme Java Examples
The following examples show how to use
com.aventstack.extentreports.reporter.configuration.Theme.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExtentTestNGIReporterListenerOld.java From Java-API-Test-Examples with Apache License 2.0 | 6 votes |
private void init() { //文件夹不存在的话进行创建 File reportDir= new File(OUTPUT_FOLDER); if(!reportDir.exists()&& !reportDir .isDirectory()){ reportDir.mkdir(); } ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(OUTPUT_FOLDER + FILE_NAME); // 设置静态文件的DNS //解决cdn.rawqit.com css访问不了的情况 htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS); htmlReporter.config().setDocumentTitle("api自动化测试报告"); htmlReporter.config().setReportName("api自动化测试报告"); htmlReporter.config().setChartVisibilityOnOpen(true); htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP); htmlReporter.config().setTheme(Theme.STANDARD); htmlReporter.config().setCSS(".node.level-1 ul{ display:none;} .node.level-1.active ul{display:block;}"); extent = new ExtentReports(); extent.attachReporter(htmlReporter); extent.setReportUsesManualConfiguration(true); }
Example #2
Source File: ExtentTestNGIReporterListenerOld.java From Java-API-Test-Examples with Apache License 2.0 | 5 votes |
private void init() { //文件夹不存在的话进行创建 File reportDir= new File(OUTPUT_FOLDER); if(!reportDir.exists()&& !reportDir .isDirectory()){ reportDir.mkdir(); } ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(OUTPUT_FOLDER + FILE_NAME); // 设置静态文件的DNS //解决cdn.rawqit.com css访问不了的情况 // htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS); htmlReporter.config().setDocumentTitle("api自动化测试报告"); htmlReporter.config().setReportName("api自动化测试报告"); // htmlReporter.config().setChartVisibilityOnOpen(true); // htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP); htmlReporter.config().setTheme(Theme.STANDARD); htmlReporter.config().setCSS(".node.level-1 ul{ display:none;} .node.level-1.active ul{display:block;}"); // 创建一个KlovReporter对象 ExtentKlovReporter klov = new ExtentKlovReporter(); // 定义MongoDB连接 klov.initMongoDbConnection("localhost", 27017); // 设置klov服务器URL klov.initKlovServerConnection("http://localhost"); // 为我们的测试项目提供项目名称 klov.setProjectName("zuozewei-test"); klov.setReportName("1.0"); // 邮件报告名emailable-report.html File emailReportFile = new File(reportDir, "emailable-report.html"); EmailReporter emailReporter = new EmailReporter(emailReportFile); extent = new ExtentReports(); extent.attachReporter(htmlReporter,klov,emailReporter); extent.setReportUsesManualConfiguration(true); }
Example #3
Source File: ExtentTestNGIReporterListenerOld.java From Java-API-Test-Examples with Apache License 2.0 | 5 votes |
private void init() { //文件夹不存在的话进行创建 File reportDir= new File(OUTPUT_FOLDER); if(!reportDir.exists()&& !reportDir .isDirectory()){ reportDir.mkdir(); } ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(OUTPUT_FOLDER + FILE_NAME); // 设置静态文件的DNS //解决cdn.rawqit.com css访问不了的情况 // htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS); htmlReporter.config().setDocumentTitle("api自动化测试报告"); htmlReporter.config().setReportName("api自动化测试报告"); // htmlReporter.config().setChartVisibilityOnOpen(true); // htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP); htmlReporter.config().setTheme(Theme.STANDARD); htmlReporter.config().setCSS(".node.level-1 ul{ display:none;} .node.level-1.active ul{display:block;}"); // 创建一个KlovReporter对象 ExtentKlovReporter klov = new ExtentKlovReporter(); // 定义MongoDB连接 klov.initMongoDbConnection("localhost", 27017); // 设置klov服务器URL klov.initKlovServerConnection("http://localhost"); // 为我们的测试项目提供项目名称 klov.setProjectName("zuozewei-test"); klov.setReportName("1.0"); // 邮件报告名emailable-report.html File emailReportFile = new File(reportDir, "emailable-report.html"); EmailReporter emailReporter = new EmailReporter(emailReportFile); extent = new ExtentReports(); extent.attachReporter(htmlReporter,klov,emailReporter); extent.setReportUsesManualConfiguration(true); }
Example #4
Source File: JsonConfigLoaderTest.java From extentreports-java with Apache License 2.0 | 5 votes |
@Test public void jsonConfigTest() throws FileNotFoundException { ExtentSparkReporterConfig conf = ExtentSparkReporterConfig.builder().build(); JsonConfigLoader<ExtentSparkReporterConfig> loader = new JsonConfigLoader<ExtentSparkReporterConfig>(conf, new File(JSON_FILE)); loader.apply(); Assert.assertEquals(conf.getCss(), "css1"); Assert.assertEquals(conf.getDocumentTitle(), "Test1"); Assert.assertEquals(conf.getEncoding(), "utf-16"); Assert.assertEquals(conf.getReportName(), "Test2"); Assert.assertEquals(conf.getTimeStampFormat(), "MMM dd, yyyy HH:mm:ss a"); Assert.assertEquals(conf.getOfflineMode().booleanValue(), true); Assert.assertEquals(conf.getProtocol(), Protocol.HTTP); Assert.assertEquals(conf.getTheme(), Theme.DARK); }
Example #5
Source File: JsonConfigLoaderTest.java From extentreports-java with Apache License 2.0 | 5 votes |
@Test public void xmlConfigTest() throws FileNotFoundException { ExtentSparkReporterConfig conf = ExtentSparkReporterConfig.builder().build(); XmlConfigLoader<ExtentSparkReporterConfig> loader = new XmlConfigLoader<ExtentSparkReporterConfig>(conf, new File(XML_FILE)); loader.apply(); Assert.assertEquals(conf.getCss(), "css1"); Assert.assertEquals(conf.getDocumentTitle(), "Test1"); Assert.assertEquals(conf.getEncoding(), "utf-16"); Assert.assertEquals(conf.getReportName(), "Test2"); Assert.assertEquals(conf.getTimeStampFormat(), "MMM dd, yyyy HH:mm:ss a"); Assert.assertEquals(conf.getOfflineMode().booleanValue(), true); Assert.assertEquals(conf.getProtocol(), Protocol.HTTP); Assert.assertEquals(conf.getTheme(), Theme.DARK); }
Example #6
Source File: ExtentTestNGIReporterListener.java From Selenium-Framework-Design-in-Data-Driven-Testing with MIT License | 5 votes |
/** * init method to customize report * * @param suite */ private void init(ISuite suite) { File directory = new File(Global_VARS.REPORT_PATH); if ( !directory.exists() ) { directory.mkdirs(); } ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(Global_VARS.REPORT_PATH + suite.getName() + ".html"); // report attributes htmlReporter.config().setDocumentTitle(docTitle); htmlReporter.config().setReportName(suite.getName().replace("_", " ")); htmlReporter.config().setChartVisibilityOnOpen(false); htmlReporter.config().setTheme(Theme.STANDARD); htmlReporter.config().setEncoding("UTF-8"); htmlReporter.config().setProtocol(Protocol.HTTPS); htmlReporter.config().setTimeStampFormat("MMM-dd-yyyy HH:mm:ss a"); htmlReporter.loadXMLConfig(new File(Global_VARS.REPORT_CONFIG_FILE)); extent = new ExtentReports(); // report system info extent.setSystemInfo("Browser", Global_VARS.DEF_BROWSER); extent.setSystemInfo("Environment", Global_VARS.DEF_ENVIRONMENT); extent.setSystemInfo("Platform", Global_VARS.DEF_PLATFORM); extent.setSystemInfo("OS Version", System.getProperty("os.version")); extent.setSystemInfo("Java Version", System.getProperty("java.version")); extent.setSystemInfo("Selenium Version", seleniumRev); extent.attachReporter(htmlReporter); extent.setReportUsesManualConfiguration(true); }