Skip to content

Commit

Permalink
Merge pull request #218 from eduardrudko/fix_skip_scenario_retry
Browse files Browse the repository at this point in the history
1521 Fix skip scenario retry
  • Loading branch information
mattwynne authored May 17, 2021
2 parents e161e1a + eae5f0a commit 2ba4309
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cucumber/core/report/summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def subscribe_to(event_bus)
if event.test_case != @previous_test_case
@previous_test_case = event.test_case
event.result.describe_to test_cases
elsif event.result.passed?
elsif event.result.passed? || event.result.skipped?
test_cases.flaky
test_cases.decrement_failed
end
Expand Down
2 changes: 2 additions & 0 deletions lib/cucumber/core/test/result.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8
# frozen_string_literal: true

require "cucumber/messages/time_conversion"

module Cucumber
module Core
module Test
Expand Down
11 changes: 11 additions & 0 deletions spec/cucumber/core/report/summary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ module Cucumber::Core::Report
expect( @summary.test_cases.total(:flaky) ).to eq(1)
expect( @summary.test_cases.total ).to eq(1)
end

it "handless flaky with following skip test cases" do
allow(test_case).to receive(:==).and_return(false, true)
event_bus.send(:test_case_finished, test_case, failed_result)
event_bus.send(:test_case_finished, test_case, skipped_result)

expect( @summary.test_cases.total(:failed) ).to eq(0)
expect( @summary.test_cases.total(:skipped) ).to eq(0)
expect( @summary.test_cases.total(:flaky) ).to eq(1)
expect( @summary.test_cases.total ).to eq(1)
end
end

context "test step summary" do
Expand Down

0 comments on commit 2ba4309

Please sign in to comment.