Question

I am new to jbehave

I am trying to execute jbehave through junit. It seems jbehave loads story files only from the classpath. Will it be possible to configure it to fetch story files from a user defined path.

public class AlgebraStory extends JUnitStories {  

@Override  
public Configuration configuration() {  
 return super.configuration()  
     .useStoryReporterBuilder(  
         new StoryReporterBuilder()  
             .withDefaultFormats()  
             .withFormats(CONSOLE, TXT));  
}  

@Override  
public InjectableStepsFactory stepsFactory() {  
  return new InstanceStepsFactory(configuration(), new Calculator());  
}  

@Override  
protected List<String> storyPaths() {  
  return new  StoryFinder().findPaths((<user defined path>, "**/algebra_story.story", "");  
  }  
}  

In the same way will it be possible to save jbehave reports in user defined path.

Was it helpful?

Solution

Yes, you can locate your stories anywhere you want in the network. be them in class path, or externally, locatable via URLs. see locating stories.

And I recommend you to learn JBehave through its examples. as this one. But in my own opinion the best way to setup an execution is using Embedders.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top