From 37a3e6c58a1f9759c2ff96fbe4e3cc6595d93f5e Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Thu, 15 Jul 2021 21:57:56 -0700 Subject: [PATCH 1/5] See if nested steps query over the wire --- features/call_nested_wire_step.feature | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 features/call_nested_wire_step.feature diff --git a/features/call_nested_wire_step.feature b/features/call_nested_wire_step.feature new file mode 100644 index 0000000..3c0f97a --- /dev/null +++ b/features/call_nested_wire_step.feature @@ -0,0 +1,38 @@ +Feature: Call nested wire step + + @wip + Scenario: Call a nested step over the wire + Given a file named "features/step_definitions/remote.wire" with: + """ + host: localhost + port: 54321 + + """ + And a file named "features/nested_step.feature" with: + """ + Feature: Nested + Scenario: Nested + Given a ruby step that calls a nested step + """ + And a file named "features/step_definitions/steps.rb" with: + """ + Given "a ruby step that calls a nested step" do + step "a nested step over the wire" + end + """ + And there is a wire server running on port 54321 which understands the following protocol: + | request | response | + | ["step_matches",{"name_to_match":"a ruby step that calls a nested step"}] | ["success",[]] | + | ["step_matches",{"name_to_match":"a nested step over the wire"}] | ["success",[{"id":"1", "args":[]}]] | + | ["begin_scenario"] | ["success"] | + | ["invoke",{"id":"1","args":[]}] | ["success"] | + | ["end_scenario"] | ["success"] | + When I run `cucumber -f progress` + And it should pass with: + """ + . + + 1 scenario (1 passed) + 1 step (1 passed) + + """ From 14593cd0dc099a49009fdb495027e09600257d3c Mon Sep 17 00:00:00 2001 From: aurelien-reeves Date: Fri, 7 Jan 2022 10:15:24 +0100 Subject: [PATCH 2/5] Fix nested step feature --- features/call_nested_wire_step.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/call_nested_wire_step.feature b/features/call_nested_wire_step.feature index 3c0f97a..ed3b68c 100644 --- a/features/call_nested_wire_step.feature +++ b/features/call_nested_wire_step.feature @@ -19,6 +19,8 @@ Feature: Call nested wire step Given "a ruby step that calls a nested step" do step "a nested step over the wire" end + Given "a nested step over the wire" do + end """ And there is a wire server running on port 54321 which understands the following protocol: | request | response | From b2a9587dc59124c2ede7f31cb3604bf560894dfb Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Tue, 12 Jul 2022 16:59:46 -0700 Subject: [PATCH 3/5] Revert "Fix nested step feature" This reverts commit 14593cd0dc099a49009fdb495027e09600257d3c. This was based on a misunderstanding: this step is implemented over the wire already, so adding a step definition for it on the ruby side just masks the problem the scenario is supposed to highlight. --- features/call_nested_wire_step.feature | 2 -- 1 file changed, 2 deletions(-) diff --git a/features/call_nested_wire_step.feature b/features/call_nested_wire_step.feature index ed3b68c..3c0f97a 100644 --- a/features/call_nested_wire_step.feature +++ b/features/call_nested_wire_step.feature @@ -19,8 +19,6 @@ Feature: Call nested wire step Given "a ruby step that calls a nested step" do step "a nested step over the wire" end - Given "a nested step over the wire" do - end """ And there is a wire server running on port 54321 which understands the following protocol: | request | response | From 3ec0c9e05bc0df2fa14b20e414c499a5649dc328 Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Tue, 12 Jul 2022 17:03:32 -0700 Subject: [PATCH 4/5] Clarify example for calling a nested step over the wire --- features/call_nested_wire_step.feature | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/features/call_nested_wire_step.feature b/features/call_nested_wire_step.feature index 3c0f97a..e770240 100644 --- a/features/call_nested_wire_step.feature +++ b/features/call_nested_wire_step.feature @@ -1,5 +1,11 @@ Feature: Call nested wire step + If the user specifies a "nested" step in their Ruby step definitions, the + search for that step definition should include steps defined over the wire. + + A nested step should still match and be invoked succesfully if it's defined + over the wire. + @wip Scenario: Call a nested step over the wire Given a file named "features/step_definitions/remote.wire" with: @@ -12,18 +18,19 @@ Feature: Call nested wire step """ Feature: Nested Scenario: Nested - Given a ruby step that calls a nested step + Given a step over the wire + Given a ruby step """ And a file named "features/step_definitions/steps.rb" with: """ - Given "a ruby step that calls a nested step" do - step "a nested step over the wire" + Given "a ruby step" do + step "a step over the wire" end """ And there is a wire server running on port 54321 which understands the following protocol: | request | response | - | ["step_matches",{"name_to_match":"a ruby step that calls a nested step"}] | ["success",[]] | - | ["step_matches",{"name_to_match":"a nested step over the wire"}] | ["success",[{"id":"1", "args":[]}]] | + | ["step_matches",{"name_to_match":"a ruby step"}] | ["success",[]] | + | ["step_matches",{"name_to_match":"a step over the wire"}] | ["success",[{"id":"1", "args":[]}]] | | ["begin_scenario"] | ["success"] | | ["invoke",{"id":"1","args":[]}] | ["success"] | | ["end_scenario"] | ["success"] | From c241b30506fc0cce4a0009491090c2c92ea32541 Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Tue, 12 Jul 2022 17:14:19 -0700 Subject: [PATCH 5/5] Fix indentation --- features/call_nested_wire_step.feature | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/features/call_nested_wire_step.feature b/features/call_nested_wire_step.feature index e770240..8a38d7f 100644 --- a/features/call_nested_wire_step.feature +++ b/features/call_nested_wire_step.feature @@ -1,5 +1,4 @@ Feature: Call nested wire step - If the user specifies a "nested" step in their Ruby step definitions, the search for that step definition should include steps defined over the wire. @@ -12,14 +11,14 @@ Feature: Call nested wire step """ host: localhost port: 54321 - + """ And a file named "features/nested_step.feature" with: """ Feature: Nested Scenario: Nested - Given a step over the wire - Given a ruby step + Given a step over the wire + And a ruby step """ And a file named "features/step_definitions/steps.rb" with: """ @@ -28,18 +27,18 @@ Feature: Call nested wire step end """ And there is a wire server running on port 54321 which understands the following protocol: - | request | response | - | ["step_matches",{"name_to_match":"a ruby step"}] | ["success",[]] | - | ["step_matches",{"name_to_match":"a step over the wire"}] | ["success",[{"id":"1", "args":[]}]] | - | ["begin_scenario"] | ["success"] | - | ["invoke",{"id":"1","args":[]}] | ["success"] | - | ["end_scenario"] | ["success"] | + | request | response | + | ["step_matches",{"name_to_match":"a ruby step"}] | ["success",[]] | + | ["step_matches",{"name_to_match":"a step over the wire"}] | ["success",[{"id":"1", "args":[]}]] | + | ["begin_scenario"] | ["success"] | + | ["invoke",{"id":"1","args":[]}] | ["success"] | + | ["end_scenario"] | ["success"] | When I run `cucumber -f progress` And it should pass with: """ . - + 1 scenario (1 passed) 1 step (1 passed) - + """