diff options
| author | Maxim Perepelitsa <n0xff@outlook.com> | 2018-11-09 01:03:04 +0700 |
|---|---|---|
| committer | Maxim Perepelitsa <n0xff@outlook.com> | 2018-11-13 03:30:41 +0700 |
| commit | 59895db44b73b9a333387eee2078fda8feec9ce5 (patch) | |
| tree | ac7602eb1d043c489fbeadd06b1b8dc30f609153 /actionpack/lib/action_dispatch/system_testing/test_helpers | |
| parent | 4fe27cdc15b88fed5ae725a886b7e96202f649a8 (diff) | |
| download | rails-59895db44b73b9a333387eee2078fda8feec9ce5.tar.gz rails-59895db44b73b9a333387eee2078fda8feec9ce5.tar.bz2 rails-59895db44b73b9a333387eee2078fda8feec9ce5.zip | |
Reset sessions on failed system test screenshot
Reset Capybara sessions if `take_failed_screenshot` raise exception
in system test `after_teardown`.
Diffstat (limited to 'actionpack/lib/action_dispatch/system_testing/test_helpers')
| -rw-r--r-- | actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb b/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb index e47d5020f4..600e9c733b 100644 --- a/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +++ b/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb @@ -17,8 +17,11 @@ module ActionDispatch end def after_teardown - take_failed_screenshot - Capybara.reset_sessions! + begin + take_failed_screenshot + ensure + Capybara.reset_sessions! + end ensure super end |
