Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NameError #4

Merged
merged 2 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ gem "puma"
gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "rubocop", "~> 1.21"
gem "selenium-webdriver"
gem "sinatra", "~> 3.0"
gem "webdrivers"
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ DEPENDENCIES
rake (~> 13.0)
rspec (~> 3.0)
rubocop (~> 1.21)
selenium-webdriver
sinatra (~> 3.0)
webdrivers

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/wait_before_click.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _wait_for_image_loading # rubocop:disable Metrics/MethodLength
_logger.debug "[capybara-wait_before_click]Timeout::Error"
rescue Capybara::NotSupportedByDriverError
# It comes here when you run it in rack-test, but you can ignore it
rescue Selenium::WebDriver::Error::StaleElementReferenceError
rescue ::Selenium::WebDriver::Error::StaleElementReferenceError
_logger.debug "[capybara-wait_before_click]Selenium::WebDriver::Error::StaleElementReferenceError"
reload
_wait_for_image_loading
Expand Down
4 changes: 2 additions & 2 deletions spec/capybara/wait_before_click_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
without_images_duration = without_images_after - without_images_before
with_a_image_duration = with_a_image_after - with_a_image_before

expect(without_images_duration + 2).to be_within(0.2).of(with_a_image_duration)
expect(without_images_duration + 2).to be_within(0.5).of(with_a_image_duration)
end

it "wait a image before hover" do
Expand All @@ -33,6 +33,6 @@
without_images_duration = without_images_after - without_images_before
with_a_image_duration = with_a_image_after - with_a_image_before

expect(without_images_duration + 2).to be_within(0.2).of(with_a_image_duration)
expect(without_images_duration + 2).to be_within(0.5).of(with_a_image_duration)
end
end