private Trends updateAndSaveTrends(Reportable reportable) { Trends trends = loadOrCreateTrends(); appendToTrends(trends, reportable); // display only last n items - don't skip items if limit is not defined if (configuration.getTrendsLimit() > 0) { trends.limitItems(configuration.getTrendsLimit()); } // save updated trends so it contains history only for the last builds saveTrends(trends, configuration.getTrendsStatsFile()); return trends; }
/** * Calls {@link #setTrends(File, int)} with zero limit. * @param trendsFile file with trends */ public void setTrendsStatsFile(File trendsFile) { setTrends(trendsFile, 0); }
private void appendToTrends(Trends trends, Reportable result) { trends.addBuild(configuration.getBuildNumber(), result); }
private Trends loadOrCreateTrends() { File trendsFile = configuration.getTrendsStatsFile(); if (trendsFile != null && trendsFile.exists()) { return loadTrends(trendsFile); } else { return new Trends(); } }
@Override public void prepareReport() { context.put("all_features", reportResult.getAllFeatures()); context.put("report_summary", reportResult.getFeatureReport()); context.put("classifications", configuration.getClassifications()); } }
/** * Checks if the trends page should be generated and displayed. * @return <code>true</code> if the page with trends should be displayed */ public boolean isTrendsAvailable() { return getTrendsLimit() > -1 && isTrendsStatsFile(); }
public ReportBuilder(List<String> jsonFiles, Configuration configuration) { this.jsonFiles = jsonFiles; this.configuration = configuration; reportParser = new ReportParser(configuration); }
private void copyStaticResources() { copyResources("css", "cucumber.css", "bootstrap.min.css", "font-awesome.min.css"); copyResources("js", "jquery.min.js", "jquery.tablesorter.min.js", "bootstrap.min.js", "Chart.min.js", "moment.min.js"); copyResources("fonts", "FontAwesome.otf", "fontawesome-webfont.svg", "fontawesome-webfont.woff", "fontawesome-webfont.eot", "fontawesome-webfont.ttf", "fontawesome-webfont.woff2", "glyphicons-halflings-regular.eot", "glyphicons-halflings-regular.eot", "glyphicons-halflings-regular.woff2", "glyphicons-halflings-regular.woff", "glyphicons-halflings-regular.ttf", "glyphicons-halflings-regular.svg"); copyResources("images", "favicon.png"); }
/** * Since pending and undefined steps were added later * there is need to fill missing data for those statuses. */ private void fillMissingSteps() { // correct only pending and undefined steps passedFeatures = fillMissingArray(passedFeatures); passedScenarios = fillMissingArray(passedScenarios); passedSteps = fillMissingArray(passedSteps); skippedSteps = fillMissingArray(skippedSteps); pendingSteps = fillMissingArray(pendingSteps); undefinedSteps = fillMissingArray(undefinedSteps); }
/** * Due to the error with old implementation where total features * were passed instead of failures (and vice versa) following correction must be applied for trends generated * between release 3.0.0 and 3.1.0. */ private void applyPatchForFeatures() { for (int i = 0; i < totalFeatures.length; i++) { int total = totalFeatures[i]; int failures = getFailedFeatures()[i]; if (total < failures) { // this data must be changed since it was generated by invalid code int tmp = total; totalFeatures[i] = failures; failedFeatures[i] = tmp; } } }
public StepObject(String location) { if (StringUtils.isEmpty(location)) { throw new ValidationException("Location cannnot be null!"); } this.location = location; }
private Trends updateAndSaveTrends(Reportable reportable) { Trends trends = loadOrCreateTrends(); appendToTrends(trends, reportable); // display only last n items - don't skip items if limit is not defined if (configuration.getTrendsLimit() > 0) { trends.limitItems(configuration.getTrendsLimit()); } // save updated trends so it contains history only for the last builds saveTrends(trends, configuration.getTrendsStatsFile()); return trends; }
private Trends loadOrCreateTrends() { File trendsFile = configuration.getTrendsStatsFile(); if (trendsFile != null && trendsFile.exists()) { return loadTrends(trendsFile); } else { return new Trends(); } }
@Override public void prepareReport() { context.put("all_features", reportResult.getAllFeatures()); context.put("report_summary", reportResult.getFeatureReport()); context.put("classifications", configuration.getClassifications()); } }
/** * Calls {@link #setTrends(File, int)} with zero limit. * @param trendsFile file with trends */ public void setTrendsStatsFile(File trendsFile) { setTrends(trendsFile, 0); }
private void appendToTrends(Trends trends, Reportable result) { trends.addBuild(configuration.getBuildNumber(), result); }
/** * Checks if the trends page should be generated and displayed. * @return <code>true</code> if the page with trends should be displayed */ public boolean isTrendsAvailable() { return getTrendsLimit() > -1 && isTrendsStatsFile(); }
public ReportBuilder(List<String> jsonFiles, Configuration configuration) { this.jsonFiles = jsonFiles; this.configuration = configuration; reportParser = new ReportParser(configuration); }
private void copyStaticResources() { copyResources("css", "cucumber.css", "bootstrap.min.css", "font-awesome.min.css"); copyResources("js", "jquery.min.js", "jquery.tablesorter.min.js", "bootstrap.min.js", "Chart.min.js", "moment.min.js"); copyResources("fonts", "FontAwesome.otf", "fontawesome-webfont.svg", "fontawesome-webfont.woff", "fontawesome-webfont.eot", "fontawesome-webfont.ttf", "fontawesome-webfont.woff2", "glyphicons-halflings-regular.eot", "glyphicons-halflings-regular.eot", "glyphicons-halflings-regular.woff2", "glyphicons-halflings-regular.woff", "glyphicons-halflings-regular.ttf", "glyphicons-halflings-regular.svg"); copyResources("images", "favicon.png"); }
/** * Since pending and undefined steps were added later * there is need to fill missing data for those statuses. */ private void fillMissingSteps() { // correct only pending and undefined steps passedFeatures = fillMissingArray(passedFeatures); passedScenarios = fillMissingArray(passedScenarios); passedSteps = fillMissingArray(passedSteps); skippedSteps = fillMissingArray(skippedSteps); pendingSteps = fillMissingArray(pendingSteps); undefinedSteps = fillMissingArray(undefinedSteps); }