Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
std_opts = "--format progress features -r features --strict --publish-quiet".dup
std_opts = "--format progress features -r features --publish-quiet".dup
std_opts << " --tags 'not @wip'"
std_opts << " --tags 'not @wip-jruby'" if defined?(JRUBY_VERSION)
Expand Down
39 changes: 8 additions & 31 deletions features/docs/cli/dry_run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Feature: Dry Run

1 scenario (1 skipped)
1 step (1 skipped)

"""

Scenario: With message formatter
Expand All @@ -39,50 +38,29 @@ Feature: Dry Run
And output should be valid NDJSON
And the output should contain NDJSON with key "status" and value "SKIPPED"

Scenario: In strict mode
Given a file named "features/test.feature" with:
"""
Feature: test
Scenario:
Given this step fails
"""
And the standard step definitions
When I run `cucumber --dry-run --strict --publish-quiet`
Then it should pass with exactly:
"""
Feature: test

Scenario: # features/test.feature:2
Given this step fails # features/step_definitions/steps.rb:4

1 scenario (1 skipped)
1 step (1 skipped)

"""

Scenario: In strict mode with an undefined step
Scenario: With an undefined step
Given a file named "features/test.feature" with:
"""
Feature: test
Scenario:
Given this step is undefined
"""
When I run `cucumber --dry-run --strict`
Then it should fail with:
When I run `cucumber --dry-run`
Then it should pass with:
"""
Feature: test

Scenario: # features/test.feature:2
Given this step is undefined # features/test.feature:3
Undefined step: "this step is undefined" (Cucumber::Core::Test::Result::Undefined)
features/test.feature:3:in `this step is undefined'

Undefined Scenarios:
cucumber features/test.feature:2 # Scenario:

1 scenario (1 undefined)
1 step (1 undefined)

You can implement step definitions for undefined steps with these snippets:

Given('this step is undefined') do
pending # Write code here that turns the phrase above into concrete actions
end
"""

Scenario: With BeforeAll and AfterAll hooks
Expand Down Expand Up @@ -113,5 +91,4 @@ Feature: Dry Run

1 scenario (1 skipped)
1 step (1 skipped)

"""
49 changes: 5 additions & 44 deletions features/docs/cli/retry_failing_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ Feature: Retry failing tests
And a scenario "Solid" that passes

Scenario: Retry once, so Fails-once starts to pass
Given a scenario "Fails-forever" that fails
When I run `cucumber -q --retry 1 --format summary`
# These split assertions are due to an issue with aruba treating the () as regex and it failing erroneously
Then it should fail with:
"""
4 scenarios (2 failed, 1 flaky, 1 passed)
3 scenarios (1 failed, 1 flaky, 1 passed)
"""
And it should fail with:
"""
Fails-forever
Fails-forever ✗
Fails-forever ✗

Fails-once feature
Fails-once ✗
Fails-once ✓
Expand All @@ -41,19 +37,13 @@ Feature: Retry failing tests
"""

Scenario: Retry twice, so Fails-twice starts to pass too
Given a scenario "Fails-forever" that fails
When I run `cucumber -q --retry 2 --format summary`
Then it should fail with:
Then it should pass with:
"""
4 scenarios (1 failed, 2 flaky, 1 passed)
3 scenarios (2 flaky, 1 passed)
"""
And it should fail with:
And it should pass with:
"""
Fails-forever
Fails-forever ✗
Fails-forever ✗
Fails-forever ✗

Fails-once feature
Fails-once ✗
Fails-once ✓
Expand All @@ -67,35 +57,6 @@ Feature: Retry failing tests
Solid ✓
"""

Scenario: Flaky scenarios gives exit code zero in non-strict mode
When I run `cucumber -q --retry 2 --format summary`
Then it should pass with:
"""


3 scenarios (2 flaky, 1 passed)
"""

Scenario: Flaky scenarios gives exit code zero in non-strict mode even when failing fast
When I run `cucumber -q --retry 2 --fail-fast --format summary`
Then it should pass with:
"""


3 scenarios (2 flaky, 1 passed)
"""

Scenario: Flaky scenarios gives non-zero exit code in strict mode
When I run `cucumber -q --retry 2 --format summary --strict`
Then it should fail with:
"""
Flaky Scenarios:
cucumber features/fails-once_feature.feature:2
cucumber features/fails-twice_feature.feature:2

3 scenarios (2 flaky, 1 passed)
"""

Scenario: Retry each test but suspend retrying after 2 failing tests, so later tests are not retried
Given a scenario "Fails-forever-1" that fails
And a scenario "Fails-forever-2" that fails
Expand Down
70 changes: 0 additions & 70 deletions features/docs/cli/strict_mode.feature

This file was deleted.

3 changes: 1 addition & 2 deletions features/docs/extending_cucumber/custom_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ Feature: Custom filter
config.filters << MakeAnythingPass.new
end
"""
When I run `cucumber --strict`
When I run `cucumber`
Then it should pass

12 changes: 6 additions & 6 deletions features/docs/formatters/junit_formatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ Feature: JUnit output formatter

"""

Scenario: pending and undefined steps with strict option should fail
When I run `cucumber --format junit --out tmp/ features/pending.feature --strict`
Scenario: pending and undefined steps should fail
When I run `cucumber --format junit --out tmp/ features/pending.feature`
Then it should fail with:
"""

Expand Down Expand Up @@ -331,8 +331,8 @@ can't convert .* into String \(TypeError\)
You *must* specify --out DIR for the junit formatter
"""

Scenario: strict mode, one feature, one scenario outline, four examples: one passing, one failing, one pending, one undefined
When I run `cucumber --strict --format junit --out tmp/ features/scenario_outline.feature`
Scenario: One feature, one scenario outline, four examples: one passing, one failing, one pending, one undefined
When I run `cucumber --format junit --out tmp/ features/scenario_outline.feature`
Then it should fail with:
"""

Expand Down Expand Up @@ -409,8 +409,8 @@ You *must* specify --out DIR for the junit formatter

"""

Scenario: strict mode with --expand option, one feature, one scenario outline, four examples: one passing, one failing, one pending, one undefined
When I run `cucumber --strict --expand --format junit --out tmp/ features/scenario_outline.feature --publish-quiet`
Scenario: Testing with --expand option, one feature, one scenario outline, four examples: one passing, one failing, one pending, one undefined
When I run `cucumber --expand --format junit --out tmp/ features/scenario_outline.feature --publish-quiet`
Then it should fail with exactly:
"""

Expand Down
36 changes: 0 additions & 36 deletions features/docs/formatters/rerun_formatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Feature: Rerun formatter

Scenario:
Given this step passes

"""

When I run `cucumber --publish-quiet -f rerun`
Expand All @@ -55,7 +54,6 @@ Feature: Rerun formatter

Scenario:
Given this step passes

"""
And a file named "features/all_good.feature" with:
"""
Expand All @@ -70,38 +68,6 @@ Feature: Rerun formatter
"""
"""

Scenario: Exit code is not zero, regular scenario
Given a file named "features/mixed.feature" with:
"""
Feature: Mixed

Scenario:
Given this step fails

Scenario:
Given this step is undefined

Scenario:
Given this step is pending

Scenario:
Given this step passes

"""
And a file named "features/all_good.feature" with:
"""
Feature: All good

Scenario:
Given this step passes
"""

When I run `cucumber --publish-quiet -f rerun --strict`
Then it should fail with exactly:
"""
features/mixed.feature:3:6:9
"""

Scenario: Exit code is not zero, scenario outlines
For details see https://github.com/cucumber/cucumber/issues/57
Given a file named "features/one_passing_one_failing.feature" with:
Expand All @@ -115,7 +81,6 @@ Feature: Rerun formatter
| status |
| passes |
| fails |

"""
When I run `cucumber -f rerun`
Then it should fail with:
Expand Down Expand Up @@ -179,7 +144,6 @@ Feature: Rerun formatter
| status |
| passes |
| fails |

"""
When I run `cucumber --expand -f rerun`
Then it should fail with:
Expand Down
2 changes: 1 addition & 1 deletion features/docs/writing_support_code/parameter_types.feature
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ Feature: Parameter Types
expect(name).to eq(@name)
end
"""
When I run `cucumber features/employees.feature --strict`
When I run `cucumber features/employees.feature`
Then it should pass
6 changes: 0 additions & 6 deletions lib/cucumber/cli/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def parse!(args)
@args = args
@options.parse!(args)
arrange_formats
raise("You can't use both --strict and --wip") if strict.strict? && wip?

set_environment_variables
end

Expand All @@ -44,10 +42,6 @@ def seed
Integer(@options[:seed] || rand(0xFFFF))
end

def strict
@options[:strict]
end

def wip?
@options[:wip]
end
Expand Down
Loading