Commit ce7449ce authored by Mike Greiling's avatar Mike Greiling

clear localStorage after each capybara test (global)

parent 95d629a1
...@@ -16,10 +16,6 @@ feature 'GFM autocomplete', :js do ...@@ -16,10 +16,6 @@ feature 'GFM autocomplete', :js do
wait_for_requests wait_for_requests
end end
after do
execute_script("localStorage.clear();")
end
it 'updates issue descripton with GFM reference' do it 'updates issue descripton with GFM reference' do
find('.issuable-edit').click find('.issuable-edit').click
......
...@@ -11,10 +11,6 @@ feature 'Issue markdown toolbar', :js do ...@@ -11,10 +11,6 @@ feature 'Issue markdown toolbar', :js do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
end end
after do
execute_script("localStorage.clear();")
end
it "doesn't include first new line when adding bold" do it "doesn't include first new line when adding bold" do
find('#note-body').native.send_keys('test') find('#note-body').native.send_keys('test')
find('#note-body').native.send_key(:enter) find('#note-body').native.send_key(:enter)
......
...@@ -45,6 +45,9 @@ RSpec.configure do |config| ...@@ -45,6 +45,9 @@ RSpec.configure do |config|
end end
config.after(:example, :js) do |example| 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, # capybara/rspec already calls Capybara.reset_sessions! in an `after` hook,
# but `block_and_wait_for_requests_complete` is called before it so by # 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 # calling it explicitely here, we prevent any new requests from being fired
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment