File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
lib/allure_cucumber/models Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ def fixture_result(hook_step)
6060 # @return [Hash<Symbol, String>]
6161 def failure_details ( result )
6262 return { message : result . exception . message , trace : result . exception . backtrace . join ( "\n " ) } if result . failed?
63- return { message : result . message , trace : result . backtrace . join ( "\n " ) } if result . undefined?
63+ return { message : result . message , trace : result . backtrace . join ( "\n " ) } if result . undefined? || result . skipped?
6464
6565 { }
6666 end
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ class CucumberHelper
2626
2727 AfterStep("@after_step") do
2828 end
29+
30+ Before("@skipped") do
31+ skip_this_scenario("because reasons")
32+ end
2933 RUBY
3034
3135 STEPS = <<~RUBY
Original file line number Diff line number Diff line change 8686 end
8787 end
8888 end
89+
90+ it "correctly updates skipped test case" do
91+ run_cucumber_cli ( <<~FEATURE )
92+ Feature: Simple feature
93+
94+ @skipped
95+ Scenario: Add a to b
96+ Simple scenario description
97+ Given a is 5
98+ And b is 10
99+ When I add a to b
100+ Then step fails with simple exception
101+ And this step shoud be skipped
102+ FEATURE
103+
104+ expect ( lifecycle ) . to have_received ( :update_test_case ) . with ( no_args ) do |&arg |
105+ arg . call ( @test_case )
106+ aggregate_failures "Should update correct test case parameters" do
107+ expect ( @test_case . stage ) . to eq ( Allure ::Stage ::FINISHED )
108+ expect ( @test_case . status ) . to eq ( Allure ::Status ::SKIPPED )
109+ expect ( @test_case . status_details . message ) . to eq ( "because reasons" )
110+ expect ( @test_case . status_details . trace ) . not_to be_empty
111+ end
112+ end
113+ end
89114end
You can’t perform that action at this time.
0 commit comments