use of org.jbehave.core.embedder.NullEmbedderMonitor in project allure-java by allure-framework.
the class AllureJbehaveTest method runStories.
private AllureResults runStories(final String... storyResources) {
final AllureResultsWriterStub writer = new AllureResultsWriterStub();
final AllureLifecycle lifecycle = new AllureLifecycle(writer);
final Embedder embedder = new Embedder();
embedder.useEmbedderMonitor(new NullEmbedderMonitor());
embedder.useEmbedderControls(new EmbedderControls().doGenerateViewAfterStories(false).doFailOnStoryTimeout(false).doBatch(false).doIgnoreFailureInStories(true).doIgnoreFailureInView(true).doVerboseFailures(false).doVerboseFiltering(false));
final AllureJbehave allureJbehave = new AllureJbehave(lifecycle);
embedder.useConfiguration(new MostUsefulConfiguration().useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(new ReportlessStoryReporterBuilder(temp.toFile()).withReporters(allureJbehave)).useDefaultStoryReporter(new NullStoryReporter()));
final InjectableStepsFactory stepsFactory = new InstanceStepsFactory(embedder.configuration(), new SimpleStorySteps(), new BrokenStorySteps());
embedder.useCandidateSteps(stepsFactory.createCandidateSteps());
final AllureLifecycle cached = Allure.getLifecycle();
try {
Allure.setLifecycle(lifecycle);
embedder.runStoriesAsPaths(Arrays.asList(storyResources));
} finally {
Allure.setLifecycle(cached);
}
return writer;
}
use of org.jbehave.core.embedder.NullEmbedderMonitor in project allure-java by reportportal.
the class BaseTest method run.
public static void run(@Nonnull final Class<?> clazz, @Nonnull final Format format, @Nonnull final List<String> stories, @Nonnull final StoryParser parser, @Nullable final Object... steps) {
Properties viewResources = new Properties();
Embedder embedder = new Embedder();
embedder.useEmbedderMonitor(new NullEmbedderMonitor());
embedder.useEmbedderControls(new EmbedderControls().doGenerateViewAfterStories(false).doFailOnStoryTimeout(false).doBatch(false).doIgnoreFailureInStories(true).doIgnoreFailureInView(true).doVerboseFailures(false).doVerboseFiltering(false));
embedder.useConfiguration(new MostUsefulConfiguration().useStoryLoader(new LoadFromClasspath(clazz)).useStoryPathResolver(new UnderscoredCamelCaseResolver()).useStoryParser(parser).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withPathResolver(new FilePrintStreamFactory.ResolveToPackagedName()).withViewResources(viewResources).withFormats(format).withFailureTrace(true).withFailureTraceCompression(true)));
final InjectableStepsFactory stepsFactory = new InstanceStepsFactory(embedder.configuration(), steps == null ? Collections.emptyList() : Arrays.asList(steps));
embedder.useCandidateSteps(stepsFactory.createCandidateSteps());
embedder.runStoriesAsPaths(stories);
}
Aggregations