private StoryReporterBuilder storyReporterBuilder() {
     return new StoryReporterBuilder()
             .withCodeLocation(CodeLocations.codeLocationFromClass(this.getClass()))
             .withPathResolver(new ResolveToPackagedName())
             .withFailureTrace(true)
             .withDefaultFormats()
             .withFormats(IDE_CONSOLE, TXT, HTML);
 }
 @Override
 public List<String> storyPaths() {
   return new StoryFinder()
       .findPaths(
           CodeLocations.codeLocationFromClass(getClass()),
           asList("**/" + testsFolder + "/**/*.story"),
           asList(""));
 }
  @Override
  public Configuration configuration() {

    final Configuration configuration = new MostUsefulConfiguration();
    configuration.useStoryReporterBuilder(
        new RichReporterBuilder()
            .withCodeLocation(CodeLocations.codeLocationFromClass(getClass())));
    configuration.useStepMonitor(new PrintStreamStepMonitor());
    configuration.usePendingStepStrategy(new FailingUponPendingStep());
    configuration.useStepdocReporter(new PrintStreamStepdocReporter());

    return configuration;
  }
  private Configuration seleniumConfiguration(
      Class<?> embeddableClass, WebDriverProvider driverProvider) {

    StoryReporterBuilder storyReporterBuilder =
        new StoryReporterBuilder()
            .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
            .withFailureTrace(true)
            .withFailureTraceCompression(true)
            .withDefaultFormats()
            .withFormats(outputFormats)
            .withCrossReference(crossReference);
    addCrossReference(storyReporterBuilder, crossReference);

    return new SeleniumConfiguration()
        .useWebDriverProvider(driverProvider)
        .useSeleniumContext(seleniumContext)
        .useFailureStrategy(new FailingUponPendingStep())
        .useStepMonitor(createStepMonitor())
        .useStoryLoader(new LoadFromClasspath(embeddableClass.getClassLoader()))
        .useStoryReporterBuilder(storyReporterBuilder);
  }
Exemplo n.º 5
0
 @Override
 public Configuration configuration() {
   Class<? extends Embeddable> embeddableClass = this.getClass();
   // Start from default ParameterConverters instance
   ParameterConverters parameterConverters = new ParameterConverters();
   // factory to allow parameter conversion and loading from external resources (used by
   // StoryParser too)
   ExamplesTableFactory examplesTableFactory =
       new ExamplesTableFactory(
           new LocalizedKeywords(), new LoadFromClasspath(embeddableClass), parameterConverters);
   // add custom converters
   parameterConverters.addConverters(
       new DateConverter(new SimpleDateFormat("yyyy-MM-dd")),
       new ExamplesTableConverter(examplesTableFactory));
   return new MostUsefulConfiguration()
       .useStoryLoader(new LoadFromClasspath(embeddableClass))
       .useStoryParser(new RegexStoryParser(examplesTableFactory))
       .useStoryReporterBuilder(
           new StoryReporterBuilder()
               .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
               .withDefaultFormats()
               .withFormats(CONSOLE, TXT, HTML, XML))
       .useParameterConverters(parameterConverters);
 }