diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-20 09:05:18 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-20 09:05:18 +0300 |
commit | ce7449ce032039467c7b6b1271b4b00a642a1c81 (patch) | |
tree | a183c0d6c051818e8c5e92cfaa54f35af4b07090 /spec/support/capybara.rb | |
parent | 95d629a1ea20f84e9286fbe5ae73ed3302a67c1c (diff) |
clear localStorage after each capybara test (global)
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r-- | spec/support/capybara.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index b5b98f19694..3755648aaf7 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -45,6 +45,9 @@ RSpec.configure do |config| end config.after(:example, :js) do |example| + # prevent localstorage from introducing side effects based on test order + execute_script("localStorage.clear();") + # capybara/rspec already calls Capybara.reset_sessions! in an `after` hook, # but `block_and_wait_for_requests_complete` is called before it so by # calling it explicitely here, we prevent any new requests from being fired |