Search in sources :

Example 1 with ParanamerConfiguration

use of org.jbehave.core.configuration.ParanamerConfiguration in project serenity-jbehave by serenity-bdd.

the class SerenityJBehave method defaultConfiguration.

// private static final CrossReference xref = new CrossReference();
/**
 * Returns a default JBehave configuration object suitable for ThucydidesWebdriverIntegration tests.
 */
public static Configuration defaultConfiguration(net.thucydides.core.webdriver.Configuration systemConfiguration, List<Format> formats, Embeddable embeddable) {
    Class<? extends Embeddable> embeddableClass = embeddable.getClass();
    Properties viewResources = new Properties();
    viewResources.put("decorateNonHtml", "true");
    TableTransformers tableTransformers = new TableTransformers();
    UTF8StoryLoader utf8StoryLoader = new UTF8StoryLoader();
    return new ParanamerConfiguration().useTableTransformers(tableTransformers).useParameterConverters(new ParameterConverters(utf8StoryLoader, tableTransformers).addConverters(new ParameterConverters.DateConverter(), new DateListConverter(), new DateTimeConverter(), new DateTimeListConverter(), new YearMonthConverter(), new YearMonthListConverter(), new TimeConverter(), new TimeListConverter(), new ParameterConverters.EnumConverter(), new ParameterConverters.EnumListConverter())).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(formats.toArray(new Format[0])).withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass)).withViewResources(viewResources).withPathResolver(new FilePrintStreamFactory.ResolveToPackagedName()).withFailureTrace(true).withFailureTraceCompression(true).withReporters(new SerenityReporter(systemConfiguration))).useStoryLoader(utf8StoryLoader).useFailureStrategy(new IgnoreAssumptionViolations());
}
Also used : ParanamerConfiguration(org.jbehave.core.configuration.ParanamerConfiguration) StoryReporterBuilder(org.jbehave.core.reporters.StoryReporterBuilder) Properties(java.util.Properties) TableTransformers(org.jbehave.core.model.TableTransformers) ParameterConverters(org.jbehave.core.steps.ParameterConverters) FilePrintStreamFactory(org.jbehave.core.reporters.FilePrintStreamFactory)

Aggregations

Properties (java.util.Properties)1 ParanamerConfiguration (org.jbehave.core.configuration.ParanamerConfiguration)1 TableTransformers (org.jbehave.core.model.TableTransformers)1 FilePrintStreamFactory (org.jbehave.core.reporters.FilePrintStreamFactory)1 StoryReporterBuilder (org.jbehave.core.reporters.StoryReporterBuilder)1 ParameterConverters (org.jbehave.core.steps.ParameterConverters)1