我的 JBehave 配置如下:
@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);
}
}
}
现在我想要一些允许对失败的测试进行截图的东西。我在网上找到了一些示例,但我无法将它们安装到我的配置中。谁能告诉我如何实现这一目标?