mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Rubocop updates
This commit is contained in:
parent
65d43316d0
commit
a0dfe90c1e
4 changed files with 13 additions and 7 deletions
|
@ -62,6 +62,12 @@ Lint/UnusedMethodArgument:
|
|||
- 'lib/capybara/driver/base.rb'
|
||||
- 'lib/capybara/driver/node.rb'
|
||||
|
||||
Lint/RaiseException:
|
||||
Enabled: true
|
||||
|
||||
Lint/StructNewOverride:
|
||||
Enabled: true
|
||||
|
||||
Layout/EndAlignment:
|
||||
EnforcedStyleAlignWith: variable
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
|||
|
||||
def quit
|
||||
@browser&.quit
|
||||
rescue Selenium::WebDriver::Error::SessionNotCreatedError, Errno::ECONNREFUSED # rubocop:disable Lint/SuppressedException
|
||||
rescue Selenium::WebDriver::Error::SessionNotCreatedError, Errno::ECONNREFUSED
|
||||
# Browser must have already gone
|
||||
rescue Selenium::WebDriver::Error::UnknownError => e
|
||||
unless silenced_unknown_error_message?(e.message) # Most likely already gone
|
||||
|
@ -293,7 +293,7 @@ private
|
|||
def clear_browser_state
|
||||
delete_all_cookies
|
||||
clear_storage
|
||||
rescue *clear_browser_state_errors # rubocop:disable Lint/SuppressedException
|
||||
rescue *clear_browser_state_errors
|
||||
# delete_all_cookies fails when we've previously gone
|
||||
# to about:blank, so we rescue this error and do nothing
|
||||
# instead.
|
||||
|
@ -317,7 +317,7 @@ private
|
|||
def clear_storage
|
||||
clear_session_storage unless options[:clear_session_storage] == false
|
||||
clear_local_storage unless options[:clear_local_storage] == false
|
||||
rescue Selenium::WebDriver::Error::JavascriptError # rubocop:disable Lint/SuppressedException
|
||||
rescue Selenium::WebDriver::Error::JavascriptError
|
||||
# session/local storage may not be available if on non-http pages (e.g. about:blank)
|
||||
end
|
||||
|
||||
|
@ -353,7 +353,7 @@ private
|
|||
@browser.navigate.to(url)
|
||||
sleep 0.1 # slight wait for alert
|
||||
@browser.switch_to.alert.accept
|
||||
rescue modal_error # rubocop:disable Lint/SuppressedException
|
||||
rescue modal_error
|
||||
# alert now gone, should mean navigation happened
|
||||
end
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ module Capybara::Selenium::Driver::W3CFirefoxDriver
|
|||
begin
|
||||
# Firefox 68 hangs if we try to switch windows while a modal is visible
|
||||
browser.switch_to.alert&.dismiss
|
||||
rescue Selenium::WebDriver::Error::NoSuchAlertError # rubocop:disable Lint/SuppressedException
|
||||
rescue Selenium::WebDriver::Error::NoSuchAlertError
|
||||
# Swallow
|
||||
end
|
||||
end
|
||||
|
@ -61,7 +61,7 @@ module Capybara::Selenium::Driver::W3CFirefoxDriver
|
|||
accept_modal :confirm, wait: 0.1 do
|
||||
super
|
||||
end
|
||||
rescue Capybara::ModalNotFound # rubocop:disable Lint/SuppressedException
|
||||
rescue Capybara::ModalNotFound
|
||||
# No modal was opened - page has refreshed - ignore
|
||||
end
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ protected
|
|||
JS
|
||||
begin
|
||||
driver.execute_script(script, self)
|
||||
rescue StandardError # rubocop:disable Lint/SuppressedException
|
||||
rescue StandardError
|
||||
# Swallow error if scrollIntoView with options isn't supported
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue