Every Gherkin step that matches a prescribed DSL is considerd a DSL step and is readily executable by Gwen.
The following is a DSL Step:
Then the page title should contain "TodoMVC"
Since it matches:
Every step interpreted by Gwen will directly or inderectly through StepDefs result in either:
- One or many DSL steps being executed
- One or many undefined steps being reported
- Or a combination of the above
If you've got everything right, all steps will execute. It is your job as a Gwen user to define StepDefs for every non DSL step in your features (and in your meta if you introduce any there).
Use dry runs to check for syntax and binding errors and identify any missing StepDefs before committing to an automation cycle.
Step execution rules
Gwen interprets steps for execution according to the following rules:
- StepDef rule
- If the step is bound to a StepDef then apply these rules to every step in the body of that StepDef
- DSL rule
- If the step is a DSL step then execute it using built-in code
- Undefined rule
- If neither of the above rules are satisfied then report an undefined step error
To make the following feature step executable:
Step in feature
Given a new todo list
You could compose a StepDef as follows:
StepDef in meta
@Context @StepDef Scenario: a new todo list Given my todo list can be located by css ".todo-list" When I navigate to "https://todomvc.com/examples/react" Then the page title should contain "TodoMVC" And my todo list should not be displayed
Calls DSL steps:
Coming to Gwen 3
We are planning to discourage the use of DSL steps in features in the upcomming Gwen 3 release by defaulting the
gwen.feature.mode setting to
declarative instead of