com.aventstack.extentreports.reporter.ExtentKlovReporter Java Examples

The following examples show how to use com.aventstack.extentreports.reporter.ExtentKlovReporter. 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: ExtentService.java    From extentreports-cucumber4-adapter with Apache License 2.0 6 votes vote down vote up
private static void initKlov(Properties properties) {
        ExtentKlovReporter klov = new ExtentKlovReporter("Default");
        String configPath = properties == null 
                ? System.getProperty(CONFIG_KLOV_KEY)
                : String.valueOf(properties.get(CONFIG_KLOV_KEY));
        File f = new File(configPath);
        if (configPath != null && !configPath.isEmpty() && f.exists()) {
        	Object prop = ExtentService.getProperty("screenshot.dir");
        	String screenshotDir = prop == null ? "test-output/" : String.valueOf(prop);
String url = Paths.get(screenshotDir).toString();
ExtentService.getInstance().tryResolveMediaPath(new String[] { url });
            try {
            	InputStream is = new FileInputStream(f);
            	klov.loadInitializationParams(is);
                INSTANCE.attachReporter(klov);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
 
Example #2
Source File: ExtentTestNGIReporterListenerOld.java    From Java-API-Test-Examples with Apache License 2.0 5 votes vote down vote up
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 vote down vote up
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: ExtentService.java    From extentreports-testng-adapter with Apache License 2.0 5 votes vote down vote up
private static void initKlov(Properties properties) {
	ExtentKlovReporter klov = new ExtentKlovReporter("Default");
    String configPath = properties == null ? System.getProperty(CONFIG_KLOV_KEY)
            : String.valueOf(properties.get(CONFIG_KLOV_KEY));
    if (configPath != null && !configPath.isEmpty()) {
        try {
            klov.loadInitializationParams(configPath);
            INSTANCE.attachReporter(klov);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}