More generally, you could extend JUnitStories to provide a common configuration and steps context to different set of stories.
> On 5 Feb 2014, at 11:29, Hans Schwäbli <[email protected]> wrote: > > Great idea, thank you! > > As it seems the JBehave editor uses the input from the JUnitStory class. > > We will try your solution. > > > 2014-02-05 Bernardo Pinto <[email protected]>: >> Yes, it is. >> Each one of your class that represents a story can extend JUnitStory. >> If you override the candidateSteps() method in the JUnitStory, you can add >> the step classes that you want. Something like this: >> >> abstract class StoryGroupOne extends JUnitStory { >> @Override >> public List<CandidateSteps> candidateSteps() { >> return new InstanceStepsFactory(new StepsClassOne(), new >> StepsClassTwo()).createCandidateSteps(); >> } >> } >> >> abstract class StoryGroupTwo extends JUnitStory { >> @Override >> public List<CandidateSteps> candidateSteps() { >> return new InstanceStepsFactory(new StepsClassThree(), new >> StepsClassFour()).createCandidateSteps(); >> } >> } >> >> public class StoryOne extends StoryGroupOne {} >> public class StoryTwo extends StoryGroupTwo {} >> >> This way, StoryOne only has access to the steps in StepsClassOne and >> StesClassTwo and StoryTwo only has access to steps in StepsClassThree and >> StepsClassFour. >> >> >> Bernardo Oliveira Pinto >> Byclosure, Lda. >> Mail: [email protected] >> Web: http://byclosure.com >> >> >>> On Wed, Feb 5, 2014 at 10:55 AM, Hans Schwäbli >>> <[email protected]> wrote: >>> The application under test contains several different functional modules to >>> test. >>> >>> These modules are tested by different testers. >>> >>> Currently, if a tester writes a JBehave story, the story editor proposes >>> all steps which exist for all modules. >>> >>> Is it possible to restrict which steps are proposed in JBehave so that only >>> steps for a specific module are valid to be used in a story for that module? >>> >>> Of course we could create several Eclipse projects, each one for a specific >>> module of the application under test. But that seems to be over engineered >>> to me. If there is no other solution, we might have to go that way. >>> >>> I am currently looking for a solution inside JBehave to limit the steps >>> which are accessible in the JBehave editor. For example, can steps be >>> categorized and be imported in the story, so that only imported steps are >>> valid? That would be one solution if that is possible. >>> >>> Any ideas which might help us to solve this? >
