@Test public void shouldRenderFeatureStepsWithOnePassingAndOneFailingStep() { final Feature feature = FeatureBuilder.instance().aFeatureWithOneScenarioWithOnePassingAndOneFailingStep(); List<Feature> features = new ArrayList<>(); features.add(feature); List<Step> steps = feature.getScenarios().get(0).getSteps(); StepsRenderer stepsRenderer = new CukedoctorStepsRenderer(); String resultDoc = stepsRenderer.renderSteps(steps, feature.getScenarios().get(0), feature, CukedoctorDocumentBuilder.Factory.newInstance()); assertThat(resultDoc).isEqualTo("==========" + newLine() + "Given::" + newLine() + "passing step icon:thumbs-up[role=\"green\",title=\"Passed\"] [small right]#(000ms)#" + newLine() + "When::" + newLine() + "failing step icon:thumbs-down[role=\"red\",title=\"Failed\"] [small right]#(000ms)#" + newLine() + "==========" + newLine() + newLine()); }
@Override public String renderSteps(List<Step> steps, Scenario scenario, Feature feature) { docBuilder.clear(); docBuilder.textLine("=========="); for (Step step : steps) { docBuilder.append(step.getKeyword(), "::", newLine()); docBuilder.append(step.getName() + " ", Status.getStatusIcon(step.getStatus())); if(!cukedoctorConfig.isHideStepTime()){ docBuilder.append(renderStepTime(step.getResult())); } docBuilder.append(renderStepTable(step)); if (notNull(step.getDocString()) && hasText(step.getDocString().getValue())) { if(step.getDocString().isDiscrete() || step.hasDiscreteComment() || isDiscrete(scenario) || isDiscrete(feature)) { renderDiscreteSidebarBlock(step.getDocString()); } else{ renderListingBlock(step.getDocString()); } } if (step.getResult() != null && !Status.passed.equals(step.getStatus())) { if (step.getResult().getErrorMessage() != null) { docBuilder.append(newLine(), "IMPORTANT: ", step.getResult().getErrorMessage(), newLine()); } } renderOutput(step); renderAttachments(step); enrichStep(step); } docBuilder.textLine("==========").newLine(); return docBuilder.toString(); }
CukedoctorStepsRenderer extends AbstractBaseRenderer implements StepsRenderer { @Override public String renderSteps(List<Step> steps, Scenario scenario, Feature feature) { docBuilder.clear(); docBuilder.textLine("=========="); for (Step step : steps) { docBuilder.append(step.getKeyword(), "::", newLine()); docBuilder.append(step.getName() + " ", Status.getStatusIcon(step.getStatus())); if(!cukedoctorConfig.isHideStepTime()){ docBuilder.append(renderStepTime(step.getResult())); } docBuilder.append(renderStepTable(step)); if (notNull(step.getDocString()) && hasText(step.getDocString().getValue())) { if(step.getDocString().isDiscrete() || step.hasDiscreteComment() || isDiscrete(scenario) || isDiscrete(feature)) { renderDiscreteSidebarBlock(step.getDocString()); } else{ renderListingBlock(step.getDocString()); } } if (step.getResult() != null && !Status.passed.equals(step.getStatus())) { if (step.getResult().getErrorMessage() != null) { docBuilder.append(newLine(), "IMPORTANT: ", step.getResult().getErrorMessage(), newLine()); } } renderOutput(step); renderAttachments(step); enrichStep(step); } docBuilder.textLine("==========").newLine(); return docBuilder.toString(); } }
CukedoctorStepsRenderer extends AbstractBaseRenderer implements StepsRenderer { @Override public String renderSteps(List<Step> steps, Scenario scenario, Feature feature) { docBuilder.clear(); docBuilder.textLine("=========="); for (Step step : steps) { docBuilder.append(step.getKeyword(), "::", newLine()); docBuilder.append(step.getName() + " ", Status.getStatusIcon(step.getStatus())); if(!cukedoctorConfig.isHideStepTime()){ docBuilder.append(renderStepTime(step.getResult())); } docBuilder.append(renderStepTable(step)); if (notNull(step.getDocString()) && hasText(step.getDocString().getValue())) { if(step.getDocString().isDiscrete() || step.hasDiscreteComment() || isDiscrete(scenario) || isDiscrete(feature)) { renderDiscreteSidebarBlock(step.getDocString()); } else{ renderListingBlock(step.getDocString()); } } if (step.getResult() != null && !Status.passed.equals(step.getStatus())) { if (step.getResult().getErrorMessage() != null) { docBuilder.append(newLine(), "IMPORTANT: ", step.getResult().getErrorMessage(), newLine()); } } renderOutput(step); renderAttachments(step); enrichStep(step); } docBuilder.textLine("==========").newLine(); return docBuilder.toString(); } CukedoctorStepsRenderer();  CukedoctorStepsRenderer(CukedoctorConfig cukedoctorConfig); }
CukedoctorStepsRenderer extends AbstractBaseRenderer implements StepsRenderer { @Override public String renderSteps(List<Step> steps, Scenario scenario, Feature feature) { docBuilder.clear(); docBuilder.textLine("=========="); for (Step step : steps) { docBuilder.append(step.getKeyword(), "::", newLine()); docBuilder.append(step.getName() + " ", Status.getStatusIcon(step.getStatus())); if(!cukedoctorConfig.isHideStepTime()){ docBuilder.append(renderStepTime(step.getResult())); } docBuilder.append(renderStepTable(step)); if (notNull(step.getDocString()) && hasText(step.getDocString().getValue())) { if(step.getDocString().isDiscrete() || step.hasDiscreteComment() || isDiscrete(scenario) || isDiscrete(feature)) { renderDiscreteSidebarBlock(step.getDocString()); } else{ renderListingBlock(step.getDocString()); } } if (step.getResult() != null && !Status.passed.equals(step.getStatus())) { if (step.getResult().getErrorMessage() != null) { docBuilder.append(newLine(), "IMPORTANT: ", step.getResult().getErrorMessage(), newLine()); } } renderOutput(step); renderAttachments(step); enrichStep(step); } docBuilder.textLine("==========").newLine(); return docBuilder.toString(); } CukedoctorStepsRenderer();  CukedoctorStepsRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderSteps(List<Step> steps, Scenario scenario, Feature feature); }
CukedoctorStepsRenderer extends AbstractBaseRenderer implements StepsRenderer { @Override public String renderSteps(List<Step> steps, Scenario scenario, Feature feature) { docBuilder.clear(); docBuilder.textLine("=========="); for (Step step : steps) { docBuilder.append(step.getKeyword(), "::", newLine()); docBuilder.append(step.getName() + " ", Status.getStatusIcon(step.getStatus())); if(!cukedoctorConfig.isHideStepTime()){ docBuilder.append(renderStepTime(step.getResult())); } docBuilder.append(renderStepTable(step)); if (notNull(step.getDocString()) && hasText(step.getDocString().getValue())) { if(step.getDocString().isDiscrete() || step.hasDiscreteComment() || isDiscrete(scenario) || isDiscrete(feature)) { renderDiscreteSidebarBlock(step.getDocString()); } else{ renderListingBlock(step.getDocString()); } } if (step.getResult() != null && !Status.passed.equals(step.getStatus())) { if (step.getResult().getErrorMessage() != null) { docBuilder.append(newLine(), "IMPORTANT: ", step.getResult().getErrorMessage(), newLine()); } } renderOutput(step); renderAttachments(step); enrichStep(step); } docBuilder.textLine("==========").newLine(); return docBuilder.toString(); } CukedoctorStepsRenderer();  CukedoctorStepsRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderSteps(List<Step> steps, Scenario scenario, Feature feature);  }