diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-02-23 15:50:53 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-02-23 15:50:53 -0600 |
commit | c14cb5bff64b72456a1d6072e6b481b0d4969810 (patch) | |
tree | 7d56a37de8ff4c89f14e39a773d1147bfe208272 /spec/support/capybara.rb | |
parent | 296a4e6825a3528917bb385123cdf62ae3d1944e (diff) | |
download | gitlab-ce-c14cb5bff64b72456a1d6072e6b481b0d4969810.tar.gz |
prevent localStorage.clear from running when it would cause an error
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r-- | spec/support/capybara.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 5189c57b7db..8603b7f3e2c 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -78,8 +78,10 @@ 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();") + # prevent localStorage from introducing side effects based on test order + unless ['', 'about:blank', 'data:,'].include? Capybara.current_session.driver.browser.current_url + execute_script("localStorage.clear();") + end # capybara/rspec already calls Capybara.reset_sessions! in an `after` hook, # but `block_and_wait_for_requests_complete` is called before it so by |