Skip to content

Commit 4a7fe20

Browse files
authored
Merge pull request #4161 from akostadinov/cuces-screenshots
Fix screenshots on failing cucumbers tests
2 parents 2f6c693 + ee97be4 commit 4a7fe20

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

features/support/hooks.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# frozen_string_literal: true
22

3+
# IMPORTANT: make sure this hook is defined **before** the one that saves screenshots,
4+
# because the After hooks run in the reverse order in which they are defined.
5+
After("@javascript") do
6+
Capybara.page&.driver&.quit
7+
end
8+
39
Around '@security' do |scenario, block|
410
with_forgery_protection(&block)
511
end
@@ -200,10 +206,6 @@
200206
end
201207
end
202208

203-
After("@javascript") do
204-
Capybara.page&.driver&.quit
205-
end
206-
207209
After do |scenario|
208210
if ENV['FAIL_FAST']
209211
Cucumber.wants_to_quit = true if scenario.failed?

0 commit comments

Comments
 (0)