public class Steps extends java.lang.Object implements CandidateSteps
Default implementation of CandidateSteps which provides the step
candidates that match the steps being run.
To provide your step candidate methods, you can:
Steps class, in which case the instance is the
extended Steps class itself ("is-a" relationship)Steps class implementation.
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:
| Modifier and Type | Class and Description |
|---|---|
static class |
Steps.DuplicateCandidateFound |
| Constructor and Description |
|---|
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.Class<?> type,
InjectableStepsFactory stepsFactory)
Creates Steps with given custom configuration and a steps instance type
containing the candidate step methods.
|
Steps(Configuration configuration,
java.lang.Object instance)
Creates Steps with given custom configuration and a steps instance
containing the candidate step methods
|
| Modifier and Type | Method and Description |
|---|---|
Configuration |
configuration()
Returns the configuration
|
java.lang.Object |
instance() |
java.util.List<BeforeOrAfterStep> |
listBeforeOrAfterScenario(ScenarioType type)
Returns the before or after scenario steps
|
java.util.List<BeforeOrAfterStep> |
listBeforeOrAfterStories()
Returns the before or after stories steps
|
java.util.List<BeforeOrAfterStep> |
listBeforeOrAfterStory(boolean givenStory)
Returns the before or after story steps, based on the given story status
|
java.util.List<StepCandidate> |
listCandidates()
Returns the step candidates that can be matched
|
java.lang.String |
toString() |
java.lang.Class<?> |
type() |
public Steps()
public Steps(Configuration configuration)
configuration - the Configurationpublic Steps(Configuration configuration, java.lang.Object instance)
configuration - the Configurationinstance - the steps instancepublic Steps(Configuration configuration, java.lang.Class<?> type, InjectableStepsFactory stepsFactory)
configuration - the Configurationtype - the steps instance typestepsFactory - the InjectableStepsFactorypublic java.lang.Class<?> type()
public java.lang.Object instance()
public Configuration configuration()
CandidateStepsconfiguration in interface CandidateStepspublic java.util.List<StepCandidate> listCandidates()
CandidateStepslistCandidates in interface CandidateStepspublic java.util.List<BeforeOrAfterStep> listBeforeOrAfterStories()
CandidateStepslistBeforeOrAfterStories in interface CandidateStepspublic java.util.List<BeforeOrAfterStep> listBeforeOrAfterStory(boolean givenStory)
CandidateStepslistBeforeOrAfterStory in interface CandidateStepsgivenStory - the boolean flag denoting if it's a given storypublic java.util.List<BeforeOrAfterStep> listBeforeOrAfterScenario(ScenarioType type)
CandidateStepslistBeforeOrAfterScenario in interface CandidateStepstype - the ScenarioTypepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2003-2014. All Rights Reserved.