com.appium.cucumber.report.HtmlReporter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AppiumTestDistribution Show documentation
Show all versions of AppiumTestDistribution Show documentation
A tool run Android and iOS test in parallel across devices
package com.appium.cucumber.report;
import com.appium.filelocations.FileLocations;
import net.masterthought.cucumber.Configuration;
import net.masterthought.cucumber.ReportBuilder;
import org.apache.velocity.exception.VelocityException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class HtmlReporter {
public File reportOutputDirectory = new File(System.getProperty("user.dir")
+ FileLocations.OUTPUT_DIRECTORY);
public List list = new ArrayList();
public void listFilesForFolder(final File folder) {
for (final File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
listFilesForFolder(fileEntry);
} else if (fileEntry.getName().endsWith(".json")) {
System.out.println("*******" + fileEntry.getName());
list.add(reportOutputDirectory + "/" + fileEntry.getName());
}
}
}
public void generateReports() throws VelocityException, IOException {
listFilesForFolder(reportOutputDirectory);
String jenkinsBasePath = "";
String buildNumber = "1";
String projectName = "cucumber-jvm";
Configuration configuration = new Configuration(reportOutputDirectory, projectName);
configuration.setBuildNumber(buildNumber);
ReportBuilder reportBuilder = new ReportBuilder(list, configuration);
reportBuilder.generateReports();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy