use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class SpringSecurityStories method configuration.
@Override
public Configuration configuration() {
Configuration configuration = new MostUsefulConfiguration();
configuration.useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(CodeLocations.codeLocationFromClass(getClass())).withDefaultFormats().withFormats(CONSOLE, TXT, HTML, XML));
return configuration;
}
use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class EmbedderBehaviour method shouldGenerateCrossReferenceWhenAvailable.
@Test
public void shouldGenerateCrossReferenceWhenAvailable() {
Embedder embedder = new Embedder();
embedder.useConfiguration(new MostUsefulConfiguration().useStoryReporterBuilder(new StoryReporterBuilder().withCrossReference(new CrossReference())));
// When
embedder.generateCrossReference();
// Then
assertXrefExists(embedder.configuration().storyReporterBuilder(), "json");
assertXrefExists(embedder.configuration().storyReporterBuilder(), "xml");
}
use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class EmbedderBehaviour method shouldNotGenerateViewIfSkipFlagIsSet.
@Test
public void shouldNotGenerateViewIfSkipFlagIsSet() throws Throwable {
// Given
PerformableTree performableTree = mock(PerformableTree.class);
EmbedderControls embedderControls = new EmbedderControls().doSkip(true);
OutputStream out = new ByteArrayOutputStream();
EmbedderMonitor monitor = new PrintStreamEmbedderMonitor(new PrintStream(out));
ViewGenerator viewGenerator = mock(ViewGenerator.class);
Embedder embedder = embedderWith(performableTree, embedderControls, monitor);
embedder.configuration().useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats());
embedder.configuration().useViewGenerator(viewGenerator);
File outputDirectory = new File("target/output");
List<String> formats = asList("html");
Properties viewResources = new Properties();
embedder.generateReportsView(outputDirectory, formats, viewResources);
// Then
verify(viewGenerator, never()).generateReportsView(outputDirectory, formats, viewResources);
assertThat(out.toString(), not(containsString("Generating stories view")));
assertThat(out.toString(), not(containsString("Stories view generated")));
}
use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class UnpackViewResources method viewDirectory.
private File viewDirectory() {
if (viewDirectory != null) {
return viewDirectory;
}
StoryReporterBuilder storyReporterBuilder = newEmbedder().configuration().storyReporterBuilder();
String build = project.getBuild().getDirectory();
String output = storyReporterBuilder.outputDirectory().getName();
String view = storyReporterBuilder.viewResources().getProperty("viewDirectory");
return new File(build + "/" + output + "/" + view);
}
use of org.jbehave.core.reporters.StoryReporterBuilder in project jbehave-core by jbehave.
the class ConfigurationProducer method getConfiguration.
@Produces
@WeldConfiguration
Configuration getConfiguration() {
Properties viewResources = new Properties();
viewResources.setProperty("index", "my-reports-index.ftl");
viewResources.setProperty("decorateNonHtml", "true");
TableTransformers tableTransformers = new TableTransformers();
LoadFromURL resourceLoader = new LoadFromURL();
return new MostUsefulConfiguration().useStoryControls(new StoryControls().doDryRun(true).doSkipScenariosAfterFailure(true)).useFailureStrategy(new SilentlyAbsorbingFailure()).useStoryLoader(resourceLoader).useStepPatternParser(new RegexPrefixCapturingPatternParser("MyPrefix")).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(CONSOLE, HTML, TXT, XML).withKeywords(new LocalizedKeywords(Locale.ITALIAN)).withRelativeDirectory("my-output-directory").withViewResources(viewResources).withFailureTrace(true)).useParameterConverters(new ParameterConverters(resourceLoader, tableTransformers).addConverters(new CustomConverter(), new MyDateConverter())).useTableTransformers(tableTransformers);
}
Aggregations