clear localStorage after each capybara test (global)

This commit is contained in:
Mike Greiling 2017-10-20 09:05:18 +03:00
parent 95d629a1ea
commit ce7449ce03
No known key found for this signature in database
GPG key ID: 0303DF507FA67596
3 changed files with 3 additions and 8 deletions

View file

@ -16,10 +16,6 @@ feature 'GFM autocomplete', :js do
wait_for_requests
end
after do
execute_script("localStorage.clear();")
end
it 'updates issue descripton with GFM reference' do
find('.issuable-edit').click

View file

@ -11,10 +11,6 @@ feature 'Issue markdown toolbar', :js do
visit project_issue_path(project, issue)
end
after do
execute_script("localStorage.clear();")
end
it "doesn't include first new line when adding bold" do
find('#note-body').native.send_keys('test')
find('#note-body').native.send_key(:enter)

View file

@ -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