Java Code Examples for io.qameta.allure.entity.Status#FAILED
The following examples show how to use
io.qameta.allure.entity.Status#FAILED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CucumberJsonResultsReader.java From allure2 with Apache License 2.0 | 6 votes |
@SuppressWarnings("PMD.UnnecessaryFullyQualifiedName") private Status getStatus(final net.masterthought.cucumber.json.support.Status status) { if (status.isPassed()) { return Status.PASSED; } if (status == FAILED) { return Status.FAILED; } if (status == PENDING) { return Status.SKIPPED; } if (status == SKIPPED) { return Status.SKIPPED; } return Status.UNKNOWN; }
Example 2
Source File: JunitXmlPlugin.java From allure2 with Apache License 2.0 | 6 votes |
private Status getStatus(final XmlElement testCaseElement) { if (testCaseElement.contains(FAILURE_ELEMENT_NAME)) { return Status.FAILED; } if (testCaseElement.contains(ERROR_ELEMENT_NAME)) { return Status.BROKEN; } if (testCaseElement.contains(SKIPPED_ELEMENT_NAME)) { return Status.SKIPPED; } if ((testCaseElement.containsAttribute(STATUS_ATTRIBUTE_NAME)) && (testCaseElement.getAttribute(STATUS_ATTRIBUTE_NAME).equals(SKIPPED_ATTRIBUTE_VALUE))) { return Status.SKIPPED; } return Status.PASSED; }
Example 3
Source File: HistoryPlugin.java From allure2 with Apache License 2.0 | 5 votes |
private boolean isNewFailed(final List<HistoryItem> histories) { final List<Status> statuses = histories.stream() .sorted(comparingByTime()) .map(HistoryItem::getStatus) .collect(Collectors.toList()); return statuses.size() > 1 && statuses.get(0) == Status.FAILED && statuses.get(1) == Status.PASSED; }
Example 4
Source File: HistoryPlugin.java From allure2 with Apache License 2.0 | 5 votes |
private boolean isFlaky(final List<HistoryItem> histories) { if (histories.size() > 1 && histories.get(0).status == Status.FAILED) { final List<Status> statuses = histories.subList(1, histories.size()) .stream() .sorted(comparingByTime()) .map(HistoryItem::getStatus) .collect(Collectors.toList()); return statuses.indexOf(Status.PASSED) < statuses.lastIndexOf(Status.FAILED) && statuses.indexOf(Status.PASSED) != -1; } return false; }
Example 5
Source File: ResultsUtils.java From allure2 with Apache License 2.0 | 5 votes |
private static Status getTestStatus(final Map<String, Object> props) { final Object status = props.get(TEST_STATUS); if (Objects.isNull(status)) { return Status.UNKNOWN; } if ("Success".equals(status)) { return Status.PASSED; } if ("Failure".equals(status)) { return Status.FAILED; } return Status.UNKNOWN; }
Example 6
Source File: XunitXmlPlugin.java From allure2 with Apache License 2.0 | 5 votes |
private Status getStatus(final XmlElement testElement) { final String status = testElement.getAttribute(RESULT_ATTRIBUTE_NAME); if ("Pass".equalsIgnoreCase(status)) { return Status.PASSED; } if ("Fail".equalsIgnoreCase(status)) { return Status.FAILED; } if ("Skip".equalsIgnoreCase(status)) { return Status.SKIPPED; } return Status.UNKNOWN; }
Example 7
Source File: TrxPlugin.java From allure2 with Apache License 2.0 | 5 votes |
protected Status parseStatus(final String outcome) { if (Objects.isNull(outcome)) { return Status.UNKNOWN; } switch (outcome.toLowerCase()) { case "passed": return Status.PASSED; case "failed": return Status.FAILED; default: return Status.UNKNOWN; } }