com.aventstack.extentreports.reporter.ExtentSparkReporter Java Examples

The following examples show how to use com.aventstack.extentreports.reporter.ExtentSparkReporter. 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: ExtentSparkReporterConfig.java    From extentreports-java with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the HTML report, saving all resources (css, js, fonts) in the
 * same location, so the report can be viewed without an internet connection
 * 
 * @param offlineMode
 *            Setting to enable an offline accessible report
 */
public void enableOfflineMode(Boolean offlineMode) {
    this.offlineMode = offlineMode;
    if (offlineMode && reporter != null) {
        File f = Offline.getTargetDirectory(((ExtentSparkReporter) reporter).getFile());
        String resPackage = ExtentReports.class.getPackage().getName().replace(".", SEP);
        resPackage += SEP + "offline" + SEP;
        String[] resx = Offline.combineAll();
        ResourceHelper.saveOfflineResources(resPackage, resx, f.getAbsolutePath());
    }
}
 
Example #3
Source File: ParallelTest.java    From extentreports-java with Apache License 2.0 4 votes vote down vote up
@Test
public void parallelTestsWithReporter() {
    ExtentReports extent = new ExtentReports();
    extent.attachReporter(new ExtentSparkReporter(""));
    IntStream.range(0, 10000).parallel().forEach(x -> extent.createTest("Test").info(String.valueOf(x)));
}
 
Example #4
Source File: ExtentService.java    From extentreports-testng-adapter with Apache License 2.0 4 votes vote down vote up
private static void initSpark(Properties properties) {
    String out = getOutputPath(properties, OUT_SPARK_KEY);
    ExtentSparkReporter spark = new ExtentSparkReporter(out);
    attach(spark, properties, CONFIG_SPARK_KEY);
}
 
Example #5
Source File: ExtentService.java    From extentreports-cucumber4-adapter with Apache License 2.0 4 votes vote down vote up
private static void initSpark(Properties properties) {
    String out = getOutputPath(properties, OUT_SPARK_KEY);
    ExtentSparkReporter spark = new ExtentSparkReporter(out);
    attach(spark, properties, CONFIG_SPARK_KEY);
}