AllFeatureReports { public List<Feature> getFeatures() { return features; } AllFeatureReports(String pageTitle, List<Feature> features); List<Feature> getFeatures(); Integer getScenariosTotal(); Integer getScenariosTotalPassed(); Integer getScenariosTotalFailed(); Integer getStepsTotal(); Integer getStepsTotalPassed(); Integer getStepsTotalFailed(); Integer getStepsTotalSkipped(); Integer getStepsTotalUndefined(); long getTotalDuration(); Integer getFeaturesCount(); String getPageTitle(); List<String> getAllTags();  }
@Test public void featureSizeTest() { assertEquals(4, reports.getFeatures().size()); }
@Test public void featureTagTest() { List<String> existingTags = new ArrayList<>(); for (Feature f : reports.getFeatures()) { for (Tag t : f.getTags()) { existingTags.add(t.getName() + t.getLine()); } } List<String> expectedTags = new ArrayList<String>(Arrays.asList( "@super1", "@editor1", "@formatting1", "@formattingBlocks1", "@formattingSpacer1", "@all3", "@ControleDeBens3", "@Patrimonio3")); assertEquals(expectedTags, existingTags); }
@Test public void scenariosTagTest() { List<String> existingTags = new ArrayList<>(); List<String> expectedTags = new ArrayList<>(Arrays.asList("@super1", "@fast12", "@super1", "@checkout12", "@fast12", "@super1", "@checkout12", "@super28", "@formattingBlocks1", "@editor1", "@formattingSpacer1", "@formatting1", "@formattingBlocks1", "@editor1", "@formattingSpacer1", "@formatting1", "@formattingBlocks1", "@editor1", "@formattingSpacer1", "@formatting1")); for (Feature f : reports.getFeatures()) { for (Element e : f.getElements()) { for (Tag t : e.getTags()) { existingTags.add(t.getName() + t.getLine()); } } } assertEquals(expectedTags, existingTags); }
@Test public void elementEmbeddingTest() { List<Integer> expected = Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0); List<Integer> actualEmbeddingsCount = new ArrayList<>(); for (Feature f : reports.getFeatures()) { for (Element e : f.getElements()) { actualEmbeddingsCount.add(e.getEmbeddings().size()); } } assertEquals(expected, actualEmbeddingsCount); }
@Test public void stepEmbeddingTest() { List<Integer> expected = Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); List<Integer> actualEmbeddingsCount = new ArrayList<>(); for (Feature f : reports.getFeatures()) { for (Element e : f.getElements()) { for (Step s : e.getSteps()) { actualEmbeddingsCount.add(s.getEmbeddings().length); } } } assertEquals(expected, actualEmbeddingsCount); }