I have my JBehave configuration as follows:
@RunWith(SpringAnnotatedPathRunner.class)
@UsingPaths(searchIn = "src/test/resources")
@Configure(storyReporterBuilder = MyReportBuilder.class, pendingStepStrategy = FailingUponPendingStep.class)
@UsingEmbedder(embedder = SameThreadEmbedder.class, ignoreFailureInStories = false, ignoreFailureInView = false)
@UsingSpring(resources = "classpath:stepsConfiguration.xml")
@UsingSteps
public class SampleIT extends JUnitStory {
public static class SameThreadEmbedder extends Embedder {
public SameThreadEmbedder() {
useExecutorService(MoreExecutors.sameThreadExecutor());
}
}
public static class MyReportBuilder extends StoryReporterBuilder {
public MyReportBuilder() {
withFailureTrace(true).withFormats(HTML, STATS);
}
}
}
And now I'd like to have something that allows taking screenshots on failed tests. I've found some samples over the web but i couldn't fit them to my config. Can anyone show me how to achieve this?