public class Steps extends AbstractCandidateSteps
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:
AbstractCandidateSteps.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,
Class<?> type,
InjectableStepsFactory stepsFactory)
Creates Steps with given custom configuration and a steps instance type
containing the candidate step methods.
|
Steps(Configuration configuration,
Object instance)
Creates Steps with given custom configuration and a steps instance
containing the candidate step methods
|
| Modifier and Type | Method and Description |
|---|---|
Object |
instance() |
List<BeforeOrAfterStep> |
listBeforeOrAfterScenario(ScenarioType type)
Returns the before or after scenario steps
|
List<BeforeOrAfterStep> |
listBeforeOrAfterStories()
Returns the before or after stories steps
|
List<BeforeOrAfterStep> |
listBeforeOrAfterStory(boolean givenStory)
Returns the before or after story steps, based on the given story status
|
List<StepCandidate> |
listCandidates()
Returns the step candidates that can be matched
|
String |
toString() |
Class<?> |
type() |
checkForDuplicateCandidates, configuration, createCandidatepublic Steps()
public Steps(Configuration configuration)
configuration - the Configurationpublic Steps(Configuration configuration, Object instance)
configuration - the Configurationinstance - the steps instancepublic Steps(Configuration configuration, Class<?> type, InjectableStepsFactory stepsFactory)
configuration - the Configurationtype - the steps instance typestepsFactory - the InjectableStepsFactorypublic Class<?> type()
public Object instance()
public List<StepCandidate> listCandidates()
CandidateStepspublic List<BeforeOrAfterStep> listBeforeOrAfterStories()
CandidateStepspublic List<BeforeOrAfterStep> listBeforeOrAfterStory(boolean givenStory)
CandidateStepsgivenStory - the boolean flag denoting if it's a given storypublic List<BeforeOrAfterStep> listBeforeOrAfterScenario(ScenarioType type)
CandidateStepstype - the ScenarioTypeCopyright © 2003–2019. All rights reserved.