@Override public void assumptionViolated(String message) { if (loggingLevelIsAtLeast(LoggingLevel.QUIET)) { getLogger().error(red("ASSUMPTION VIOLATED: " + message)); } }
private void logFailureCause(TestOutcome result) { if (result.getNestedTestFailureCause() != null) { if (result.getFailingStep().isPresent()) { String failingStep = result.getFailingStep().get().unrendered().getDescription(); getLogger().error(red("TEST FAILED AT STEP " + failingStep)); } getLogger().error(result.getNestedTestFailureCause().getShortenedMessage()); } }
private void logFailure(TestOutcome result) { if (loggingLevelIsAtLeast(LoggingLevel.QUIET)) { getLogger().error(red(testFailureHeading() + "\nTEST FAILED: {}"), result.getTitle() + underline(TEST_FAILED_HEADINGS.get(headingStyle))); logRelatedIssues(result); logFailureCause(result); underline(FAILURE_HEADINGS.get(headingStyle)); } }
private void logError(TestOutcome result) { if (loggingLevelIsAtLeast(LoggingLevel.QUIET)) { getLogger().error(red(testFailureHeading() + "\nTEST FAILED WITH ERROR: {}"), result.getTitle() + underline(TEST_ERROR_HEADINGS.get(headingStyle))); logRelatedIssues(result); logFailureCause(result); underline(ERROR_HEADINGS.get(headingStyle)); } }
public void stepFailed(StepFailure failure) { if (loggingLevelIsAtLeast(LoggingLevel.VERBOSE)) { String errorMessage = (failure.getException() != null) ? failure.getException().toString() : failure.getMessage(); String failureType = analysis.resultFor(failure.getException()).name(); getLogger().info(red("STEP {}: {}"), failureType, errorMessage); } }