I'm trying to use the GivenStories feature of jbehave-core-3.5.1 but the
story using it always shows as pending. My story runs fine when not using
GivenStories and including the steps directly in the story. Any help would
be greatly appreciated.

My story:

In order to try out the magnum product,
As a potential customer,
I want to be able to register for a test drive account.

Scenario: successfully registers for test drive

GivenStory: register_for_test_drive.task

Meta:
@type positive
@component test-drive
@suite acceptance
@level 1


My story has no steps as I just want to call the GivenStory steps, in the
same directory I have register_for_test_drive.task with a simple step as
follows:

Given the user opens the testdrive-registration web page


Here is how my stories are configured: TestDriveStories.java

package com.symantec.automation.testdrive.stories;

public class TestDriveStories extends JUnitStories {
 
private WebDriverProvider driverProvider = new PropertyWebDriverProvider();
  private WebDriverSteps lifecycleSteps = new
PerStoryWebDriverSteps(driverProvider);
  private Pages pages = new Pages(driverProvider);
  private SeleniumContext context = new SeleniumContext();
  private ContextView contextView = new LocalFrameContextView().sized(500,
100);

  public TestDriveStories() {
    
configuredEmbedder().useExecutorService(MoreExecutors.sameThreadExecutor())
;
    configuredEmbedder().useMetaFilters(asList("-ignore"));
    configuredEmbedder().embedderControls()
        .doIgnoreFailureInStories(true)
        .doIgnoreFailureInView(false)
        .doGenerateViewAfterStories(true);
  }

  public Configuration configuration() {
    Class<? extends Embeddable> embeddableClass = this.getClass();
    return new SeleniumConfiguration()
        .useSeleniumContext(context)
        .useWebDriverProvider(driverProvider)
        .useStepMonitor(new SeleniumStepMonitor(contextView, context, new
SilentStepMonitor()))
        .useStoryLoader(new LoadFromClasspath(embeddableClass))
        .useStoryReporterBuilder(new StoryReporterBuilder()
            .withRelativeDirectory("reports/tests/functional/jbehave")
            .withCodeLocation(codeLocationFromClass(embeddableClass))
            .withDefaultFormats()
.withFormats(CONSOLE, WebDriverHtmlOutput.WEB_DRIVER_HTML));
  }

  public InjectableStepsFactory stepsFactory() {
    Configuration configuration = configuration();
    return new InstanceStepsFactory(configuration,
        new TestDriveSteps(pages),
        lifecycleSteps,
        new WebDriverScreenshotOnFailure(driverProvider,
configuration.storyReporterBuilder()));
  }

  protected List<String> storyPaths() {
    return new StoryFinder()
        .findPaths(codeLocationFromClass(this.getClass()).getFile(),
asList("**/*.story"), null);
  }

  // This Embedder is used by Maven or Ant and it will override anything
set in the constructor
  public static class SameThreadEmbedder extends Embedder {
    public SameThreadEmbedder() {
      useExecutorService(MoreExecutors.sameThreadExecutor());
    }
  }

}




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to