Ejemplo n.º 1
0
 @Before
 public void setUpJsonReports() throws IOException {
   List<String> jsonReports = new ArrayList<String>();
   jsonReports.add(getAbsolutePathFromResource("net/masterthought/cucumber/project1.json"));
   ReportParser reportParser = new ReportParser(jsonReports);
   Feature passingFeature =
       reportParser.getFeatures().entrySet().iterator().next().getValue().get(0);
   Feature failingFeature =
       reportParser.getFeatures().entrySet().iterator().next().getValue().get(1);
   passingFeature.processSteps();
   failingFeature.processSteps();
   passingStep = passingFeature.getElements().first().getSteps().first();
   failingStep = failingFeature.getElements().first().getSteps().get(5);
   skippedStep = failingFeature.getElements().first().getSteps().get(6);
   withOutput = passingFeature.getElements().get(1).getSteps().first();
 }
Ejemplo n.º 2
0
 private Step failingStepWithEmbeddedScreenshot() throws IOException {
   List<String> jsonReports = new ArrayList<String>();
   jsonReports.add(getAbsolutePathFromResource("net/masterthought/cucumber/embedded_image.json"));
   Feature failingFeatureWithEmbeddedScreenshot =
       new ReportParser(jsonReports).getFeatures().entrySet().iterator().next().getValue().get(0);
   failingFeatureWithEmbeddedScreenshot.processSteps();
   return failingFeatureWithEmbeddedScreenshot.getElements().get(0).getSteps().get(2);
 }
Ejemplo n.º 3
0
 @Test
 public void shouldReturnRows() throws IOException {
   List<String> jsonReports = new ArrayList<String>();
   jsonReports.add(getAbsolutePathFromResource("net/masterthought/cucumber/cells.json"));
   ReportParser reportParser = new ReportParser(jsonReports);
   Feature feature = reportParser.getFeatures().entrySet().iterator().next().getValue().get(0);
   Step step = feature.getElements().get(0).getSteps().get(0);
   feature.processSteps();
   assertThat(step.getRows()[0], is(Row.class));
 }
Ejemplo n.º 4
0
 @Test
 public void shouldReturnRowsWhenNoResultsForStep() throws IOException {
   List<String> jsonReports = new ArrayList<String>();
   jsonReports.add(
       getAbsolutePathFromResource("net/masterthought/cucumber/with_no_step_results.json"));
   ReportParser reportParser = new ReportParser(jsonReports);
   Feature feature = reportParser.getFeatures().entrySet().iterator().next().getValue().get(0);
   Step step = feature.getElements().get(0).getSteps().get(0);
   feature.processSteps();
   assertThat(
       step.getName(),
       is(
           "<div class=\"missing\"><span class=\"step-keyword\">Given  </span><span class=\"step-name\">a &quot;Big&quot; customer</span><span class=\"step-duration\"></span><div class=\"step-error-message\"><pre class=\"step-error-message-content\"><span class=\"missing\">Result was missing for this step</span></pre></div></div>"));
 }