AllScenariosPageCollection extends PageCollection implements Visitable { public boolean hasFailedScenarios() { return getTotalNumberOfFailedScenarios() > 0; } AllScenariosPageCollection(final String pageTitle); List<Report> getReports(); void clearReports(); void addReports(final Report[] reportList); int getTotalNumberOfScenarios(); boolean hasFailedScenarios(); boolean hasPassedScenarios(); boolean hasSkippedScenarios(); int getTotalNumberOfPassedScenarios(); int getTotalNumberOfFailedScenarios(); int getTotalNumberOfSkippedScenarios(); String getTotalDurationString(); String returnStartDateTimeString(); String returnEndDateTimeString(); List<CustomParameter> getCustomParameters(); void setCustomParameters(final List<CustomParameter> customParameters); boolean hasCustomParameters(); Tag getTagFilter(); void setTagFilter(final Tag tagFilter); Feature getFeatureFilter(); void setFeatureFilter(final Feature featureFilter); Step getStepFilter(); void setStepFilter(final Step stepFilter); @Override Object clone(); @Override void accept(final PageVisitor visitor);  }
@Test public void hasFailedScenariosTest() { assertThat(allScenariosPageCollection.hasFailedScenarios(), is(false)); assertThat(allScenariosPageCollection.hasPassedScenarios(), is(false)); assertThat(allScenariosPageCollection.hasSkippedScenarios(), is(false)); Report[] reportList = new Report[1]; Report report = new Report(); List<Element> elements = new ArrayList<>(); Element element = new Element(); List<Step> steps = new ArrayList<>(); Step step = new Step(); Result result = new Result(); result.setStatus("failed"); step.setResult(result); steps.add(step); element.setSteps(steps); elements.add(element); report.setElements(elements); reportList[0] = report; allScenariosPageCollection.addReports(reportList); assertThat(allScenariosPageCollection.hasFailedScenarios(), is(true)); assertThat(allScenariosPageCollection.hasPassedScenarios(), is(false)); assertThat(allScenariosPageCollection.hasSkippedScenarios(), is(false)); }