|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jbehave.core.steps.Steps
public class Steps
Implementation of CandidateSteps which provides access to the
candidate steps that match the story you want to run.
To provide your candidate steps methods, you can either extend the
Steps class or pass it any Object instance that it can wrap.
In the former case, the instance is the extended Steps class itself.
Both "has-a" relationship and "is-a" design models are thus supported.
You can define the methods that should be run by annotating them with @Given, @When
or @Then, and providing as a value for each annotation a pattern matches the
textual step. The value is interpreted by the StepPatternParser,
which by default is a RegexPrefixCapturingPatternParser that
interprets the words starting with '$' as parameters.
For instance, you could define a method as:
| Nested Class Summary | |
|---|---|
static class |
Steps.DuplicateCandidateStepFoundException
|
| Constructor Summary | |
|---|---|
Steps()
Creates Steps with default configuration for a class extending this instance and containing the candidate step methods |
|
Steps(Configuration configuration)
Creates Steps with given custom configuration for a class extending this instance and containing the candidate step methods |
|
Steps(Configuration configuration,
java.lang.Object instance)
Creates Steps with given custom configuration wrapping an Object instance containing the candidate step methods |
|
| Method Summary | |
|---|---|
Configuration |
configuration()
Returns the configuration |
java.util.List<CandidateStep> |
listCandidates()
Returns the candidate steps that can be matched |
java.util.List<Step> |
runAfterScenario()
Returns the steps to run after each scenario |
java.util.List<Step> |
runAfterStory(boolean givenStory)
Returns the steps to run after each story, based on the given story status |
java.util.List<Step> |
runBeforeScenario()
Returns the steps to run before each scenario |
java.util.List<Step> |
runBeforeStory(boolean givenStory)
Returns the steps to run before each story, based on the given story status |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Steps()
public Steps(Configuration configuration)
configuration - the Configuration
public Steps(Configuration configuration,
java.lang.Object instance)
configuration - the Configurationinstance - the Object instance| Method Detail |
|---|
public Configuration configuration()
CandidateSteps
configuration in interface CandidateStepspublic java.util.List<CandidateStep> listCandidates()
CandidateSteps
listCandidates in interface CandidateStepspublic java.util.List<Step> runBeforeStory(boolean givenStory)
CandidateSteps
runBeforeStory in interface CandidateStepsgivenStory - the boolean flag denoting if it's a given story
public java.util.List<Step> runAfterStory(boolean givenStory)
CandidateSteps
runAfterStory in interface CandidateStepsgivenStory - the boolean flag denoting if it's a given story
public java.util.List<Step> runBeforeScenario()
CandidateSteps
runBeforeScenario in interface CandidateStepspublic java.util.List<Step> runAfterScenario()
CandidateSteps
runAfterScenario in interface CandidateStepspublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||