0

我的 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);
    }
}
} 

现在我想要一些允许对失败的测试进行截图的东西。我在网上找到了一些示例,但我无法将它们安装到我的配置中。谁能告诉我如何实现这一目标?

4

1 回答 1

0

我对这一切都很陌生,但你试过这样吗?

WebDriverScreenshotOnFailure screenshotOnFailure = new WebDriverScreenshotOnFailure(driverProvider);
于 2012-11-15T15:20:25.413 回答