public String percentageLabelsByTypeFor(String... testResultTypes) { List<String> resultLabels = new ArrayList<>(); int totalTestCount = testOutcomes.getTestCount(); for(String resultType : testResultTypes) { double percentageAutomated = automatedTests.get(TestResult.valueOf(resultType.toUpperCase())) * 100.0 / totalTestCount; double percentageManual = manualTests.get(TestResult.valueOf(resultType.toUpperCase())) * 100.0 / totalTestCount; resultLabels.add("'" + percentageLabelFor(percentageAutomated) + "'"); resultLabels.add("'" + percentageLabelFor(percentageManual) + "'"); } return Arrays.toString(resultLabels.toArray()); }
public double getOverallStability() { if (outcomes.isEmpty()) { return 0.0; } else { return sum(outcomes, on(TestOutcome.class).getOverallStability()) / getTestCount(); } }
public double getRecentStability() { if (outcomes.isEmpty()) { return 0.0; } else { return sum(outcomes, on(TestOutcome.class).getRecentStability()) / getTestCount(); } }
public double getRecentStability() { if (outcomes.isEmpty()) { return 0.0; } else { return sum(outcomes, on(TestOutcome.class).getRecentStability()) / getTestCount(); } }
public double getOverallStability() { if (outcomes.isEmpty()) { return 0.0; } else { return sum(outcomes, on(TestOutcome.class).getOverallStability()) / getTestCount(); } }
private Element buildTestSuiteElement(Document doc, String testCaseName, TestOutcomes testCaseOutcomes) { int errors = testCaseOutcomes.count(TestType.ANY).withResult(TestResult.ERROR); int failures = testCaseOutcomes.count(TestType.ANY).withResult(TestResult.FAILURE); int success = testCaseOutcomes.count(TestType.ANY).withResult(TestResult.SUCCESS); int skipped = testCaseOutcomes.getTotal() - errors - failures - success; Element testSuiteElement = doc.createElement("testsuite"); testSuiteElement.setAttribute("name", testCaseName); testSuiteElement.setAttribute("time", Double.toString(testCaseOutcomes.getDurationInSeconds())); testSuiteElement.setAttribute("tests", Integer.toString(testCaseOutcomes.getTestCount())); testSuiteElement.setAttribute("errors", Integer.toString(errors)); testSuiteElement.setAttribute("skipped", Integer.toString(skipped)); testSuiteElement.setAttribute("failures", Integer.toString(failures)); testCaseOutcomes.getStartTime().ifPresent( startTime -> testSuiteElement.setAttribute("timestamp", TIMESTAMP_FORMAT.format(startTime)) ); return testSuiteElement; } }
private Element buildTestSuiteElement(Document doc, String testCaseName, TestOutcomes testCaseOutcomes) { int errors = testCaseOutcomes.count(TestType.ANY).withResult(TestResult.ERROR); int failures = testCaseOutcomes.count(TestType.ANY).withResult(TestResult.FAILURE); int success = testCaseOutcomes.count(TestType.ANY).withResult(TestResult.SUCCESS); int skipped = testCaseOutcomes.getTotal() - errors - failures - success; Element testSuiteElement = doc.createElement("testsuite"); testSuiteElement.setAttribute("name", testCaseName); testSuiteElement.setAttribute("time", Double.toString(testCaseOutcomes.getDurationInSeconds())); testSuiteElement.setAttribute("tests", Integer.toString(testCaseOutcomes.getTestCount())); testSuiteElement.setAttribute("errors", Integer.toString(errors)); testSuiteElement.setAttribute("skipped", Integer.toString(skipped)); testSuiteElement.setAttribute("failures", Integer.toString(failures)); if (testCaseOutcomes.getStartTime() != null) { testSuiteElement.setAttribute("timestamp", testCaseOutcomes.getStartTime().toString("YYYY-MM-DD hh:mm:ss")); } return testSuiteElement; } }
public boolean isPending() { return (getTestOutcomes().getTestCount() == 0) || getTestOutcomes().getResult() == TestResult.PENDING || anyChildRequirementsArePending(); }
public boolean isPending() { return (getTestOutcomes().getTestCount() == 0) || getTestOutcomes().getResult() == TestResult.PENDING || anyChildRequirementsArePending(); }