Java Code Examples for com.aventstack.extentreports.ExtentReports#setReportUsesManualConfiguration()

The following examples show how to use com.aventstack.extentreports.ExtentReports#setReportUsesManualConfiguration() . 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: ExtentReportsBuilder.java    From courgette-jvm with MIT License 7 votes vote down vote up
public void buildReport() {
    final ExtentSparkReporter extentSparkReporter = new ExtentSparkReporter(extentReportsProperties.getReportFilename());

    if (extentReportsProperties.getXMLConfigFile() != null) {
        extentSparkReporter.loadXMLConfig(extentReportsProperties.getXMLConfigFile(), true);
    }

    final ExtentReports extentReports = new ExtentReports();
    extentReports.setReportUsesManualConfiguration(true);
    extentReports.attachReporter(extentSparkReporter);

    getDistinctFeatureUris().forEach(featureUri -> {
        List<Feature> features = featureList.stream().filter(f -> f.getUri().equals(featureUri)).collect(Collectors.toList());
        addFeatures(extentReports, features);
    });
    extentReports.flush();
}
 
Example 2
Source File: ExtentTestNGIReporterListenerOld.java    From Java-API-Test-Examples with Apache License 2.0 6 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;}");
    extent = new ExtentReports();
    extent.attachReporter(htmlReporter);
    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: 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 5
Source File: ExtentTestNGIReporterListener.java    From Selenium-Framework-Design-in-Data-Driven-Testing with MIT License 5 votes vote down vote up
/**
 * 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);
}
 
Example 6
Source File: ExtentReportsFactory.java    From zerocode with Apache License 2.0 3 votes vote down vote up
public static ExtentReports createReportTheme(String reportFileName) {
    ExtentHtmlReporter extentHtmlReporter = createExtentHtmlReporter(reportFileName);

    extentReports = new ExtentReports();

    attachSystemInfo();

    extentReports.attachReporter(extentHtmlReporter);
    extentReports.setReportUsesManualConfiguration(true);

    return extentReports;
}