Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-10-20 09:05:18 +0300
committerMike Greiling <mike@pixelcog.com>2017-10-20 09:05:18 +0300
commitce7449ce032039467c7b6b1271b4b00a642a1c81 (patch)
treea183c0d6c051818e8c5e92cfaa54f35af4b07090 /spec/support/capybara.rb
parent95d629a1ea20f84e9286fbe5ae73ed3302a67c1c (diff)
clear localStorage after each capybara test (global)
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r--spec/support/capybara.rb3
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