@Test public void shouldRenderSummaryForOneFeature() { List<Feature> features = FeatureParser.parse(onePassingOneFailing); String resultDoc = new CukedoctorSummaryRenderer().renderSummary(features, CukedoctorDocumentBuilder.Factory.newInstance()); assertThat(resultDoc).isNotNull(). containsOnlyOnce("<<One-passing-scenario-one-failing-scenario>>"). containsOnlyOnce("|[red]#*failed*#"). contains("2+|010ms"); assertThat(resultDoc).isEqualTo(Expectations.SUMMARY_FOR_ONE_FEATURE); }
@Override public String renderSummary(List<Feature> features) { docBuilder.clear(); calculateTotalizations(features); docBuilder.textLine(H2(bold(i18n.getMessage("title.summary")))); docBuilder.append("[cols=\"12*^m\", options=\"header,footer\"]", newLine(), "|===", newLine() + "3+|" + i18n.getMessage("title.scenario") + "s 7+|" + i18n.getMessage("summary.steps") + " 2+|", i18n.getMessage("title.features"), ": ", features.size() + "", newLine(), newLine() + "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|Total", newLine(), "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|[purple]#*", i18n.getMessage("result.skipped"), "*#", newLine(), "|[maroon]#*", i18n.getMessage("result.pending"), "*#", newLine(), "|[yellow]#*", i18n.getMessage("result.undefined"), "*#", newLine(), "|[blue]#*", i18n.getMessage("result.missing"), "*#", newLine(), "|Total", newLine(), "|"+ i18n.getMessage("summary.duration"), newLine(), "|Status" ).newLine(); for (Feature feature : features) { docBuilder.append(newLine(), "12+^", tableCol(), "*<<", feature.getName().replaceAll(",", "").replaceAll(" ", "-"), ">>*", newLine()); StepResults stepResults = feature.getStepResults(); ScenarioResults scenarioResults = feature.getScenarioResults(); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosPassed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosFailed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenarios(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPasses(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfFailures(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSkipped(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPending(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfUndefined(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfMissing(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSteps(), newLine()); docBuilder.append(tableCol(), stepResults.getTotalDurationAsString(), newLine()); docBuilder.append(tableCol(), Status.getStatusColor(feature.getStatus()), newLine()); } renderTotalsRow(); docBuilder.textLine(table()); return docBuilder.toString(); }
CukedoctorSummaryRenderer extends AbstractBaseRenderer implements SummaryRenderer { @Override public String renderSummary(List<Feature> features) { docBuilder.clear(); calculateTotalizations(features); docBuilder.textLine(H2(bold(i18n.getMessage("title.summary")))); docBuilder.append("[cols=\"12*^m\", options=\"header,footer\"]", newLine(), "|===", newLine() + "3+|" + i18n.getMessage("title.scenario") + "s 7+|" + i18n.getMessage("summary.steps") + " 2+|", i18n.getMessage("title.features"), ": ", features.size() + "", newLine(), newLine() + "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|Total", newLine(), "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|[purple]#*", i18n.getMessage("result.skipped"), "*#", newLine(), "|[maroon]#*", i18n.getMessage("result.pending"), "*#", newLine(), "|[yellow]#*", i18n.getMessage("result.undefined"), "*#", newLine(), "|[blue]#*", i18n.getMessage("result.missing"), "*#", newLine(), "|Total", newLine(), "|"+ i18n.getMessage("summary.duration"), newLine(), "|Status" ).newLine(); for (Feature feature : features) { docBuilder.append(newLine(), "12+^", tableCol(), "*<<", feature.getName().replaceAll(",", "").replaceAll(" ", "-"), ">>*", newLine()); StepResults stepResults = feature.getStepResults(); ScenarioResults scenarioResults = feature.getScenarioResults(); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosPassed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosFailed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenarios(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPasses(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfFailures(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSkipped(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPending(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfUndefined(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfMissing(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSteps(), newLine()); docBuilder.append(tableCol(), stepResults.getTotalDurationAsString(), newLine()); docBuilder.append(tableCol(), Status.getStatusColor(feature.getStatus()), newLine()); } renderTotalsRow(); docBuilder.textLine(table()); return docBuilder.toString(); } }
CukedoctorSummaryRenderer extends AbstractBaseRenderer implements SummaryRenderer { @Override public String renderSummary(List<Feature> features) { docBuilder.clear(); calculateTotalizations(features); docBuilder.textLine(H2(bold(i18n.getMessage("title.summary")))); docBuilder.append("[cols=\"12*^m\", options=\"header,footer\"]", newLine(), "|===", newLine() + "3+|" + i18n.getMessage("title.scenario") + "s 7+|" + i18n.getMessage("summary.steps") + " 2+|", i18n.getMessage("title.features"), ": ", features.size() + "", newLine(), newLine() + "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|Total", newLine(), "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|[purple]#*", i18n.getMessage("result.skipped"), "*#", newLine(), "|[maroon]#*", i18n.getMessage("result.pending"), "*#", newLine(), "|[yellow]#*", i18n.getMessage("result.undefined"), "*#", newLine(), "|[blue]#*", i18n.getMessage("result.missing"), "*#", newLine(), "|Total", newLine(), "|"+ i18n.getMessage("summary.duration"), newLine(), "|Status" ).newLine(); for (Feature feature : features) { docBuilder.append(newLine(), "12+^", tableCol(), "*<<", feature.getName().replaceAll(",", "").replaceAll(" ", "-"), ">>*", newLine()); StepResults stepResults = feature.getStepResults(); ScenarioResults scenarioResults = feature.getScenarioResults(); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosPassed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosFailed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenarios(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPasses(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfFailures(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSkipped(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPending(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfUndefined(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfMissing(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSteps(), newLine()); docBuilder.append(tableCol(), stepResults.getTotalDurationAsString(), newLine()); docBuilder.append(tableCol(), Status.getStatusColor(feature.getStatus()), newLine()); } renderTotalsRow(); docBuilder.textLine(table()); return docBuilder.toString(); } CukedoctorSummaryRenderer();  CukedoctorSummaryRenderer(CukedoctorConfig cukedoctorConfig); }
CukedoctorSummaryRenderer extends AbstractBaseRenderer implements SummaryRenderer { @Override public String renderSummary(List<Feature> features) { docBuilder.clear(); calculateTotalizations(features); docBuilder.textLine(H2(bold(i18n.getMessage("title.summary")))); docBuilder.append("[cols=\"12*^m\", options=\"header,footer\"]", newLine(), "|===", newLine() + "3+|" + i18n.getMessage("title.scenario") + "s 7+|" + i18n.getMessage("summary.steps") + " 2+|", i18n.getMessage("title.features"), ": ", features.size() + "", newLine(), newLine() + "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|Total", newLine(), "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|[purple]#*", i18n.getMessage("result.skipped"), "*#", newLine(), "|[maroon]#*", i18n.getMessage("result.pending"), "*#", newLine(), "|[yellow]#*", i18n.getMessage("result.undefined"), "*#", newLine(), "|[blue]#*", i18n.getMessage("result.missing"), "*#", newLine(), "|Total", newLine(), "|"+ i18n.getMessage("summary.duration"), newLine(), "|Status" ).newLine(); for (Feature feature : features) { docBuilder.append(newLine(), "12+^", tableCol(), "*<<", feature.getName().replaceAll(",", "").replaceAll(" ", "-"), ">>*", newLine()); StepResults stepResults = feature.getStepResults(); ScenarioResults scenarioResults = feature.getScenarioResults(); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosPassed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosFailed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenarios(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPasses(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfFailures(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSkipped(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPending(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfUndefined(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfMissing(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSteps(), newLine()); docBuilder.append(tableCol(), stepResults.getTotalDurationAsString(), newLine()); docBuilder.append(tableCol(), Status.getStatusColor(feature.getStatus()), newLine()); } renderTotalsRow(); docBuilder.textLine(table()); return docBuilder.toString(); } CukedoctorSummaryRenderer();  CukedoctorSummaryRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderSummary(List<Feature> features); }
CukedoctorSummaryRenderer extends AbstractBaseRenderer implements SummaryRenderer { @Override public String renderSummary(List<Feature> features) { docBuilder.clear(); calculateTotalizations(features); docBuilder.textLine(H2(bold(i18n.getMessage("title.summary")))); docBuilder.append("[cols=\"12*^m\", options=\"header,footer\"]", newLine(), "|===", newLine() + "3+|" + i18n.getMessage("title.scenario") + "s 7+|" + i18n.getMessage("summary.steps") + " 2+|", i18n.getMessage("title.features"), ": ", features.size() + "", newLine(), newLine() + "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|Total", newLine(), "|[green]#*", i18n.getMessage("result.passed"), "*#", newLine(), "|[red]#*", i18n.getMessage("result.failed"), "*#", newLine(), "|[purple]#*", i18n.getMessage("result.skipped"), "*#", newLine(), "|[maroon]#*", i18n.getMessage("result.pending"), "*#", newLine(), "|[yellow]#*", i18n.getMessage("result.undefined"), "*#", newLine(), "|[blue]#*", i18n.getMessage("result.missing"), "*#", newLine(), "|Total", newLine(), "|"+ i18n.getMessage("summary.duration"), newLine(), "|Status" ).newLine(); for (Feature feature : features) { docBuilder.append(newLine(), "12+^", tableCol(), "*<<", feature.getName().replaceAll(",", "").replaceAll(" ", "-"), ">>*", newLine()); StepResults stepResults = feature.getStepResults(); ScenarioResults scenarioResults = feature.getScenarioResults(); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosPassed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenariosFailed(), newLine()); docBuilder.append(tableCol(), scenarioResults.getNumberOfScenarios(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPasses(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfFailures(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSkipped(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfPending(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfUndefined(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfMissing(), newLine()); docBuilder.append(tableCol(), stepResults.getNumberOfSteps(), newLine()); docBuilder.append(tableCol(), stepResults.getTotalDurationAsString(), newLine()); docBuilder.append(tableCol(), Status.getStatusColor(feature.getStatus()), newLine()); } renderTotalsRow(); docBuilder.textLine(table()); return docBuilder.toString(); } CukedoctorSummaryRenderer();  CukedoctorSummaryRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderSummary(List<Feature> features);  }