2
Feature: Step matches message
4
When the features have been parsed, Cucumber will send a `step_matches`
5
message to ask the wire server if it can match a step name. This happens for
6
each of the steps in each of the features.
8
The wire server replies with an array of StepMatch objects.
10
When each StepMatch is returned, it contains the following data:
12
* `id` - identifier for the step definition to be used later when if it
13
needs to be invoked. The identifier can be any string value and
14
is simply used for the wire server's own reference.
15
* `args` - any argument values as captured by the wire end's own regular
16
expression (or other argument matching) process.
19
Given a file named "features/wired.feature" with:
26
And a file named "features/step_definitions/some_remote_place.wire" with:
33
Scenario: Dry run finds no step match
34
Given there is a wire server running on port 54321 which understands the following protocol:
35
| request | response |
36
| ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[]] |
37
When I run `cucumber --dry-run --no-snippets -f progress`
38
And it should pass with:
42
1 scenario (1 undefined)
47
Scenario: Dry run finds a step match
48
Given there is a wire server running on port 54321 which understands the following protocol:
49
| request | response |
50
| ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[{"id":"1", "args":[]}]] |
51
When I run `cucumber --dry-run -f progress`
52
And it should pass with:
56
1 scenario (1 skipped)
61
Scenario: Step matches returns details about the remote step definition
63
Optionally, the StepMatch can also contain a source reference, and a native
64
regexp string which will be used by some formatters.
66
Given there is a wire server running on port 54321 which understands the following protocol:
67
| request | response |
68
| ["step_matches",{"name_to_match":"we're all wired"}] | ["success",[{"id":"1", "args":[], "source":"MyApp.MyClass:123", "regexp":"we.*"}]] |
69
When I run `cucumber -f stepdefs --dry-run`
70
Then it should pass with:
74
we.* # MyApp.MyClass:123
76
1 scenario (1 skipped)
80
And the stderr should not contain anything