/** * Set specified throwable to event using fluent-api interface * * @param throwable the throwable to set * @return modified instance */ public StepFailureEvent withThrowable(Throwable throwable) { setThrowable(throwable); return this; }
@AfterThrowing(pointcut = "anyMethod() && withStepAnnotation()", throwing = "e") public void stepFailed(JoinPoint joinPoint, Throwable e) { ALLURE.fire(new StepFailureEvent().withThrowable(e)); ALLURE.fire(new StepFinishedEvent()); }
@Override public void result(Result result) { if (match != null) { if (FAILED.equals(result.getStatus())) { this.excuteFailureCallback(); ALLURE_LIFECYCLE.fire(new StepFailureEvent().withThrowable(getError(result))); ALLURE_LIFECYCLE.fire(new TestCaseFailureEvent().withThrowable(getError(result))); currentStatus = FAILED; } else if (SKIPPED.equals(result.getStatus())) { ALLURE_LIFECYCLE.fire(new StepCanceledEvent()); if (PASSED.equals(currentStatus)) { //not to change FAILED status to CANCELED in the report ALLURE_LIFECYCLE.fire(new TestCasePendingEvent()); currentStatus = SKIPPED; } } ALLURE_LIFECYCLE.fire(new StepFinishedEvent()); match = null; } }