0

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?

Arek
  • 1,941
  • 4
  • 22
  • 27

1 Answers1

0

I'm new to all this but have you tried like this ?

WebDriverScreenshotOnFailure screenshotOnFailure = new WebDriverScreenshotOnFailure(driverProvider);
Dough
  • 515
  • 1
  • 6
  • 20