use of cucumber.api.event.TestCaseFinished in project page-factory-2 by sbtqa.
the class CriticalStepCheckAspect method sendCaseFinished.
@Around("sendCaseFinished(event)")
public void sendCaseFinished(ProceedingJoinPoint joinPoint, TestCaseFinished event) throws Throwable {
boolean hasFailedNonCriticalStep = hasFailedNonCriticalStep(event.testCase);
if (hasFailedNonCriticalStep) {
final Result result = new Result(Result.Type.PASSED, event.result.getDuration(), new AutotestError(NON_CRITICAL_CATEGORY_MESSAGE));
event = new TestCaseFinished(event.getTimeStamp(), event.getTimeStampMillis(), event.testCase, result);
Allure.getLifecycle().updateTestCase(getCurrentTestCaseUid(event.testCase), testResult -> testResult.setStatus(Status.PASSED));
joinPoint.proceed(new Object[] { event });
} else {
joinPoint.proceed();
}
}
Aggregations