diff --git a/features/docs/cli/retry_failing_tests.feature b/features/docs/cli/retry_failing_tests.feature index 1d9c07188c..204caa4e90 100644 --- a/features/docs/cli/retry_failing_tests.feature +++ b/features/docs/cli/retry_failing_tests.feature @@ -97,8 +97,8 @@ Feature: Retry failing tests """ Scenario: Flaky scenario gives zero exit code in no-strict-flaky mode if flaky step fails, passes and skips scenario - And a scenario "Flaky-skip" that fails three times, passes and then skips scenario - When I run `cucumber --retry 3 --no-strict-flaky --format summary` + And a scenario "Flaky-skip" that fails once, passes and then skips scenario + When I run `cucumber --retry 1 --no-strict-flaky --format summary` Then it should pass with: """ diff --git a/features/lib/step_definitions/scenarios_and_steps.rb b/features/lib/step_definitions/scenarios_and_steps.rb index 3c07f65966..97f898ff42 100644 --- a/features/lib/step_definitions/scenarios_and_steps.rb +++ b/features/lib/step_definitions/scenarios_and_steps.rb @@ -110,13 +110,13 @@ def snake_case(name) write_file("features/step_definitions/steps#{SecureRandom.uuid}.rb", content) end -Given('a scenario {string} that fails three times, passes and then skips scenario') do |full_name| +Given('a scenario {string} that fails once, passes and then skips scenario') do |full_name| name = snake_case(full_name) create_feature("#{full_name} feature") do create_scenario(full_name) do """ - Given it three times, then passes + Given it fails once, then passes And it skips scenario """ end @@ -127,21 +127,6 @@ def snake_case(name) step_definition('/^it skips scenario/', 'skip_this_scenario') ) - write_file( - "features/step_definitions/#{name}_steps.rb", - [ - step_definition('/^it skips scenario/', 'skip_this_scenario'), - step_definition( - '/^it three times, then passes/', - [ - "$#{name} ||= 0", - "$#{name} += 1", - "expect($#{name}).to be > 3" - ] - ) - ].join("\n") - ) - write_file( "features/support/#{name}_init.rb", " $#{name} = 0"