}
@Override
public boolean isTakingAction(Event event, TestResult result) {
if (event instanceof After) {
Screenshot screenshotAnnotation = ScreenshotAnnotationScanner.getScreenshotAnnotation(((After) event).getTestMethod());
if (screenshotAnnotation != null) {
if (screenshotAnnotation.takeAfterTest()) {
return true;
}
if (result.getStatus() == Status.FAILED && screenshotAnnotation.takeWhenTestFailed()) {
return true;
}
}
}