I\'ve created a .story file with a Given When Then (GWT).
Contact_List.story Scenario: Discover Contact Given I\'ve a contact list of friends When one of them is online
This is organized by the Configuration. In JBehave parlance, the Configuration is the class that tells the JBehave framework how to associate *.stories with *Steps.java. In the questioniers example, this is RunBDDTests.java. One option that will associate two steps with a single GWT scenario is to create two Configurations, one for the Service steps and one for the UI steps:
ServiceConfiguration.java
public class ServiceConfiguration extends JUnitStories
{
@Override
public InjectableStepsFactory stepsFactory() {
return new InstanceStepsFactory(configuration(), new ServiceSteps()); // <- note steps class
}
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(CodeLocations.codeLocationFromClass(this.getClass()), "**/Contact_List.story", ""); //<- note story file name
}
}
UIConfiguration.java
public class UIConfiguration extends JUnitStories
{
@Override
public InjectableStepsFactory stepsFactory() {
return new InstanceStepsFactory(configuration(), new UISteps()); // <- note steps class
}
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(CodeLocations.codeLocationFromClass(this.getClass()), "**/Contact_List.story", ""); //<- note story file name
}
}
The above two configurations will run two different step files against one .story.