本文整理汇总了Java中net.masterthought.cucumber.ReportBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ReportBuilder类的具体用法?Java ReportBuilder怎么用?Java ReportBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReportBuilder类属于net.masterthought.cucumber包,在下文中一共展示了ReportBuilder类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateReportForJsonFiles
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
private void generateReportForJsonFiles(File reportOutputDirectory,
List<String> jsonFiles) {
String jenkinsBasePath = "";
String buildNumber = "1";
String projectName = project.getName();
Configuration configuration = new Configuration(reportOutputDirectory, projectName);
configuration.setParallelTesting(false);
configuration.setJenkinsBasePath(jenkinsBasePath);
configuration.setRunWithJenkins(false);
configuration.setBuildNumber(buildNumber);
ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration);
reportBuilder.generateReports();
getLog().info(format("Cucumber HTML report has been generated at: %s/cucumber-html-reports/overview-features.html", reportOutputDirectory.getAbsolutePath()));
}
开发者ID:eu-evops,项目名称:cucumber-runner-maven-plugin,代码行数:18,代码来源:Run.java
示例2: generateReports
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
public void generateReports() throws VelocityException, IOException {
listFilesForFolder(reportOutputDirectory);
String jenkinsBasePath = "";
String buildNumber = "1";
String projectName = "cucumber-jvm";
boolean runWithJenkins = false;
boolean parallelTesting = false;
Configuration configuration = new Configuration(reportOutputDirectory, projectName);
configuration.setParallelTesting(parallelTesting);
configuration.setRunWithJenkins(runWithJenkins);
configuration.setBuildNumber(buildNumber);
ReportBuilder reportBuilder = new ReportBuilder(list, configuration);
reportBuilder.generateReports();
}
开发者ID:saikrishna321,项目名称:AppiumTestDistribution,代码行数:17,代码来源:HtmlReporter.java
示例3: generateReport
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
public static void generateReport(String basePath) {
Collection<File> jsonFiles = org.apache.commons.io.FileUtils.listFiles(new File(basePath), new String[]{"json"}, true);
List<String> jsonPaths = new ArrayList(jsonFiles.size());
jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
Configuration config = new Configuration(new File(basePath), basePath);
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
开发者ID:intuit,项目名称:karate,代码行数:9,代码来源:DemoMockUtils.java
示例4: generateReport
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
private static void generateReport(String karateOutputPath) {
Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] {"json"}, true);
List<String> jsonPaths = new ArrayList(jsonFiles.size());
jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
Configuration config = new Configuration(new File("target"), "demo");
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
开发者ID:intuit,项目名称:karate,代码行数:9,代码来源:DemoTestParallel.java
示例5: generateReport
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
private static void generateReport(String karateOutputPath) {
Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[]{"json"}, true);
List<String> jsonPaths = new ArrayList(jsonFiles.size());
for (File file : jsonFiles) {
jsonPaths.add(file.getAbsolutePath());
}
Configuration config = new Configuration(new File("target"), "demo");
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
开发者ID:intuit,项目名称:karate,代码行数:11,代码来源:FailSkippedParallelRunner.java
示例6: generateReport
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
private static void generateReport(String karateOutputPath) {
Collection<File> jsonFiles = org.apache.commons.io.FileUtils.listFiles(new File(karateOutputPath), new String[]{"json"}, true);
List<String> jsonPaths = new ArrayList(jsonFiles.size());
for (File file : jsonFiles) {
jsonPaths.add(file.getAbsolutePath());
}
Configuration config = new Configuration(new File("target"), "mock");
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
开发者ID:intuit,项目名称:karate,代码行数:11,代码来源:MockServerTest.java
示例7: GenerateMasterthoughtReport
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
public static void GenerateMasterthoughtReport(){
try{
String RootDir = System.getProperty("user.dir");
File reportOutputDirectory = new File("target/Masterthought");
List<String> list = new ArrayList<String>();
list.add("target/cucumber1.json");
list.add("target/cucumber2.json");
String pluginUrlPath = "";
String buildNumber = "1";
String buildProject = "cucumber-jvm";
boolean skippedFails = true;
boolean pendingFails = true;
boolean undefinedFails = true;
boolean missingFails = true;
boolean flashCharts = true;
boolean runWithJenkins = false;
boolean highCharts = false;
boolean parallelTesting = true;
boolean artifactsEnabled = false;
String artifactConfig = "";
ReportBuilder reportBuilder = new ReportBuilder(list, reportOutputDirectory, pluginUrlPath, buildNumber,
buildProject, skippedFails, pendingFails, undefinedFails, missingFails, flashCharts, runWithJenkins,
highCharts, parallelTesting);
reportBuilder.generateReports();
}catch(Exception e){
e.printStackTrace();
}
}
开发者ID:sahajamit,项目名称:cucumber-jvm-testng-integration,代码行数:32,代码来源:GenerateReport.java
示例8: onFinish
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
@Override
public void onFinish(ISuite suite) {
try {
File jsonfile = new File("target/");
File reportOutputDirectory = new File("target/test-classes/reports/cucumberreports/");
String[] fileNames = jsonfile.list(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if(name.endsWith(".json"))
return true;
return false;
}
});
for (int i = 0; i < fileNames.length; i++) {
fileNames[i] = jsonfile.getAbsolutePath() + "/" + fileNames[i];
}
List<String> jsonFiles = Arrays.asList(fileNames);
Configuration configuration = new Configuration(reportOutputDirectory, suite.getName());
configuration.setStatusFlags(true, true, true);
ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration);
reportBuilder.generateReports();
oLog.info("Report Generated : " + configuration.getReportDirectory());
} catch (Exception e) {
oLog.equals(e);
}
}
开发者ID:rahulrathore44,项目名称:SeleniumCucumber,代码行数:35,代码来源:CucumberReport.java
示例9: generateReport
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
/**
* @param args
* @throws Exception
* @returns Path to generated report
*/
public static String generateReport(String reportBasePath) throws Exception {
String ret = null;
File reportOutputDirectory = new File(reportBasePath);
List<String> findAllJSONFiles = findAllJSONFiles(reportOutputDirectory);
if(!findAllJSONFiles.isEmpty()) {
String pluginUrlPath = "";
String buildNumber = "1";
String buildProjectName = "super_project";
Boolean skippedFails = false;
Boolean undefinedFails = false;
Boolean flashCharts = true;
Boolean runWithJenkins = false;
Boolean artifactsEnabled = false;
String artifactConfig = "";
Boolean highChart = true;
ReportBuilder reportBuilder = new ReportBuilder(findAllJSONFiles,
reportOutputDirectory,
pluginUrlPath,
buildNumber,
buildProjectName,
skippedFails,
undefinedFails,
flashCharts,
runWithJenkins,
artifactsEnabled,
artifactConfig,
highChart);
reportBuilder.generateReports();
ret = reportOutputDirectory + "/feature-overview.html";
}
return ret;
}
开发者ID:gfk-ba,项目名称:senbot,代码行数:44,代码来源:CucumberReportGenerator.java
示例10: perform
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
@Override
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener)
throws InterruptedException, IOException {
generateReport(run, workspace, listener);
SafeArchiveServingRunAction caa = new SafeArchiveServingRunAction(new File(run.getRootDir(), ReportBuilder.BASE_DIRECTORY),
ReportBuilder.BASE_DIRECTORY, ReportBuilder.HOME_PAGE, CucumberReportBaseAction.ICON_NAME, Messages.SidePanel_DisplayName());
run.replaceAction(caa);
}
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:11,代码来源:CucumberReportPublisher.java
示例11: getUrlName
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
@Override
public String getUrlName() {
Run<?, ?> run = this.project.getLastCompletedBuild();
if (run != null) {
return extractBuildNumber(run.getUrl()) + "/" + ReportBuilder.BASE_DIRECTORY + "/" + ReportBuilder.HOME_PAGE;
}
// none build was completed, report is yet not available
return "";
}
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:11,代码来源:CucumberReportProjectAction.java
示例12: generateReport
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
private void generateReport(Run<?, ?> build, FilePath workspace, TaskListener listener) throws InterruptedException, IOException {
log(listener, "Preparing Cucumber Reports");
// create directory where trends will be stored
final File trendsDir = new File(build.getParent().getRootDir(), TRENDS_DIR);
if (!trendsDir.exists()) {
if (!trendsDir.mkdir()) {
throw new IllegalStateException("Could not create directory for trends: " + trendsDir);
}
}
// source directory (possibly on slave)
String parsedJsonReportDirectory = evaluateMacro(build, workspace, listener, jsonReportDirectory);
log(listener, String.format("JSON report directory is \"%s\"", parsedJsonReportDirectory));
FilePath inputDirectory = new FilePath(workspace, parsedJsonReportDirectory);
File directoryForReport = build.getRootDir();
File directoryJsonCache = new File(directoryForReport, ReportBuilder.BASE_DIRECTORY + File.separatorChar + ".cache");
if (!directoryJsonCache.exists() && !directoryJsonCache.mkdirs()) {
throw new IllegalStateException("Could not create directory for cache: " + directoryJsonCache);
}
//Copies Json Files To Cache...
int copiedFiles = inputDirectory.copyRecursiveTo(DEFAULT_FILE_INCLUDE_PATTERN, new FilePath(directoryJsonCache));
log(listener, String.format("Copied %d json files from workspace \"%s\" to reports directory \"%s\"",
copiedFiles, inputDirectory.getRemote(), directoryJsonCache));
//Copies Classifications Files To Cache...
int copiedFilesProperties = inputDirectory.copyRecursiveTo(DEFAULT_FILE_INCLUDE_PATTERN_CLASSIFICATIONS, new FilePath(directoryJsonCache));
log(listener, String.format("Copied %d properties files from workspace \"%s\" to reports directory \"%s\"",
copiedFilesProperties, inputDirectory.getRemote(), directoryJsonCache));
// exclude JSONs that should be skipped (as configured by the user)
String[] jsonReportFiles = findJsonFiles(directoryJsonCache, fileIncludePattern, fileExcludePattern);
List<String> jsonFilesToProcess = fullPathToJsonFiles(jsonReportFiles, directoryJsonCache);
log(listener, String.format("Processing %d json files:", jsonReportFiles.length));
for (String jsonFile : jsonFilesToProcess) {
log(listener, jsonFile);
}
String buildNumber = Integer.toString(build.getNumber());
// this works for normal and multi-config/matrix jobs
// for matrix jobs, this will include the matrix job name and the specific
// configuration/permutation name as well. this also includes the '/' so
// we don't have to modify how the cucumber plugin report generator's links
String projectName = build.getParent().getDisplayName();
Configuration configuration = new Configuration(directoryForReport, projectName);
configuration.setParallelTesting(parallelTesting);
configuration.setRunWithJenkins(true);
configuration.setBuildNumber(buildNumber);
configuration.setTrends(new File(trendsDir, TRENDS_FILE), trendsLimit);
// null checker because of the regression in 3.10.2
configuration.setSortingMethod(sortingMethod == null ? SortingMethod.NATURAL : SortingMethod.valueOf(sortingMethod));
if (CollectionUtils.isNotEmpty(classifications)) {
log(listener, String.format("Adding %d classifications", classifications.size()));
addClassificationsToBuildReport(build, workspace, listener, configuration, classifications);
}
List<String> classificationFiles = fetchPropertyFiles(directoryJsonCache, listener);
if(CollectionUtils.isNotEmpty(classificationFiles)) {
configuration.addClassificationFiles(classificationFiles);
}
ReportBuilder reportBuilder = new ReportBuilder(jsonFilesToProcess, configuration);
Reportable result = reportBuilder.generateReports();
if (hasReportFailed(result, listener)) {
// redefine build result if it was provided by plugin configuration
if (buildStatus != null) {
log(listener, "Build status is changed to " + buildStatus);
build.setResult(Result.fromString(buildStatus));
} else {
log(listener, "Build status is left unchanged");
}
}
}
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:77,代码来源:CucumberReportPublisher.java
示例13: getUrlName
import net.masterthought.cucumber.ReportBuilder; //导入依赖的package包/类
@Override
public String getUrlName() {
return ReportBuilder.HOME_PAGE;
}
开发者ID:jenkinsci,项目名称:cucumber-reports-plugin,代码行数:5,代码来源:CucumberReportBaseAction.java
注:本文中的net.masterthought.cucumber.ReportBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论