use of org.jbehave.core.steps.MarkUnmatchedStepsAsPending in project jbehave-core by jbehave.
the class CustomCoreStories method configuration.
@Override
public Configuration configuration() {
Configuration configuration = super.configuration();
Properties viewResources = new Properties();
viewResources.put("reports", "ftl/custom-reports.ftl");
configuration.useViewGenerator(new FreemarkerViewGenerator(this.getClass()));
Keywords keywords = new LocalizedKeywords(new Locale("en"), "i18n/custom", "i18n/keywords", this.getClass().getClassLoader());
StoryReporterBuilder reporterBuilder = configuration.storyReporterBuilder().withKeywords(keywords).withViewResources(viewResources).withFormats(CustomHtmlOutput.FORMAT);
return configuration.useKeywords(keywords).useStepCollector(new MarkUnmatchedStepsAsPending(keywords)).useStoryParser(new RegexStoryParser(keywords)).useStoryReporterBuilder(reporterBuilder);
}
use of org.jbehave.core.steps.MarkUnmatchedStepsAsPending in project jbehave-core by jbehave.
the class ReportTransformBehaviour method runStories.
private void runStories(String... storyPaths) {
StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withDefaultFormats().withCodeLocation(CodeLocations.codeLocationFromClass(ReportTransformBehaviour.class)).withFormats(Format.XML);
Configuration configuration = new MostUsefulConfiguration().useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(storyReporterBuilder).useFailureStrategy(new SilentlyAbsorbingFailure()).useStepCollector(new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance())));
Embedder embedder = new Embedder();
embedder.useEmbedderControls(new EmbedderControls().doGenerateViewAfterStories(false));
embedder.useConfiguration(configuration);
embedder.useCandidateSteps(new InstanceStepsFactory(configuration, new MySteps()).createCandidateSteps());
embedder.useMetaFilters(asList("-skip true"));
try {
embedder.runStoriesAsPaths(asList(storyPaths));
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.jbehave.core.steps.MarkUnmatchedStepsAsPending in project jbehave-core by jbehave.
the class ReportTransformBehaviour method runStories.
private void runStories(String... storyPaths) {
StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withDefaultFormats().withCodeLocation(CodeLocations.codeLocationFromClass(ReportTransformBehaviour.class)).withFormats(Format.XML);
Configuration configuration = new MostUsefulConfiguration().useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(storyReporterBuilder).useFailureStrategy(new SilentlyAbsorbingFailure()).useStepCollector(new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance())));
Embedder embedder = new Embedder();
embedder.useEmbedderControls(new EmbedderControls().doGenerateViewAfterStories(false));
embedder.useConfiguration(configuration);
embedder.useCandidateSteps(new InstanceStepsFactory(configuration, new MySteps()).createCandidateSteps());
embedder.useMetaFilters(asList("-skip true"));
try {
embedder.runStoriesAsPaths(asList(storyPaths));
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.jbehave.core.steps.MarkUnmatchedStepsAsPending in project jbehave-core by jbehave.
the class LocalizedStories method configuration.
@Override
public Configuration configuration() {
ClassLoader classLoader = this.getClass().getClassLoader();
URL codeLocation = CodeLocations.codeLocationFromClass(this.getClass());
Keywords keywords = new LocalizedKeywords(locale());
Properties properties = new Properties();
properties.setProperty("reports", "ftl/jbehave-reports.ftl");
properties.setProperty("encoding", "UTF-8");
LoadFromClasspath resourceLoader = new LoadFromClasspath(classLoader);
TableTransformers tableTransformers = new TableTransformers();
ParameterControls parameterControls = new ParameterControls();
ParameterConverters parameterConverters = new ParameterConverters(resourceLoader, parameterControls, tableTransformers, true).addConverters(customConverters(keywords, resourceLoader, tableTransformers));
return new MostUsefulConfiguration().useKeywords(keywords).useStepCollector(new MarkUnmatchedStepsAsPending(keywords)).useStoryParser(new RegexStoryParser(keywords, resourceLoader, tableTransformers)).useStoryLoader(resourceLoader).useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(codeLocation).withPathResolver(new ResolveToSimpleName()).withDefaultFormats().withFormats(CONSOLE, TXT, HTML, XML).withFailureTrace(false).withViewResources(properties).withKeywords(keywords)).useParameterConverters(parameterConverters).useParameterControls(parameterControls).useTableTransformers(tableTransformers);
}
Aggregations