capybara 3.39.1 → 3.39.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b566dd2ce046b95741f9a3d75782ed30e4de0df17455f797d5700e2f41878b50
4
- data.tar.gz: e6e0107c091c49a9cd37bce916bd286a5351b3d6ca60fe4a24a52ff4b835f318
3
+ metadata.gz: '0945d8fedaab75fa31a90d12105de7318d78c20a46955a1b78ae88dc791f6a5a'
4
+ data.tar.gz: 9a59ca68ff9d44ef28597603ed275ebef28c79c8b6fb76ffdc26daaee68ab383
5
5
  SHA512:
6
- metadata.gz: db95d42045034d3fd15406ea2d18b900c5d1dc382abb45beec9175555389e5cad1fffc8ef31acbb52e909682e2548be2a20af30c835b5b129c991b89ba1f6a76
7
- data.tar.gz: 8d2de2c2fc6be233ed858ce4ba8d793b4bb7e6d530e66b697576229aba3780edf0928dca6333bb4141a4241b2404a15c845803db3c3222524a8d29c7076eb810
6
+ metadata.gz: dbb58a338e2408140ce5e6a44bc141fc44833952c10f611996f5a217c9a0ad00f8d6344a1c16b0bf53000801f9e1d45ef3848cb0fa886dabe68c6d766a42372a
7
+ data.tar.gz: db985c0c947ff348c80008fd4c90232a0ad4dcd38dbe8694b157ecfb512c099d6e9bc08177d8a115e1db17cca35c68903e10662da0fdd14c4f1a2ab671932b16
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ # Version 3.39.2
2
+ Release date: 2023-06-10
3
+
4
+ ### Fixed
5
+
6
+ * Fix Selenium version comparison [aki77]
7
+
1
8
  # Version 3.39.1
2
9
  Release date: 2023-05-12
3
10
 
@@ -10,7 +10,7 @@ module Capybara::Selenium::Driver::FirefoxDriver
10
10
  end
11
11
 
12
12
  def self.w3c?(driver)
13
- (defined?(Selenium::WebDriver::VERSION) && (Selenium::WebDriver::VERSION.to_f >= 4)) ||
13
+ (defined?(Selenium::WebDriver::VERSION) && (Gem::Version.new(Selenium::WebDriver::VERSION) >= Gem::Version.new('4'))) ||
14
14
  driver.browser.capabilities.is_a?(::Selenium::WebDriver::Remote::W3C::Capabilities)
15
15
  end
16
16
  end
@@ -416,14 +416,14 @@ private
416
416
  actions = browser_action.tap do |acts|
417
417
  if click_options.coords?
418
418
  if click_options.center_offset?
419
- if Selenium::WebDriver::VERSION.to_f >= 4.3
419
+ if Gem::Version.new(Selenium::WebDriver::VERSION) >= Gem::Version.new('4.3')
420
420
  acts.move_to(native, *click_options.coords)
421
421
  else
422
422
  ::Selenium::WebDriver.logger.suppress_deprecations do
423
423
  acts.move_to(native).move_by(*click_options.coords)
424
424
  end
425
425
  end
426
- elsif Selenium::WebDriver::VERSION.to_f >= 4.3
426
+ elsif Gem::Version.new(Selenium::WebDriver::VERSION) >= Gem::Version.new('4.3')
427
427
  right_by, down_by = *click_options.coords
428
428
  size = native.size
429
429
  left_offset = (size[:width] / 2).to_i
@@ -476,13 +476,13 @@ private
476
476
  end
477
477
 
478
478
  def w3c?
479
- (defined?(Selenium::WebDriver::VERSION) && (Selenium::WebDriver::VERSION.to_f >= 4)) ||
479
+ (defined?(Selenium::WebDriver::VERSION) && (Gem::Version.new(Selenium::WebDriver::VERSION) >= Gem::Version.new('4'))) ||
480
480
  capabilities.is_a?(::Selenium::WebDriver::Remote::W3C::Capabilities)
481
481
  end
482
482
 
483
483
  def action_pause(action, duration)
484
484
  if w3c?
485
- if Selenium::WebDriver::VERSION.to_f >= 4.2
485
+ if Gem::Version.new(Selenium::WebDriver::VERSION) >= Gem::Version.new('4.2')
486
486
  action.pause(device: action.pointer_inputs.first, duration: duration)
487
487
  else
488
488
  action.pause(action.pointer_inputs.first, duration)
@@ -20,7 +20,7 @@ module ActionPauser
20
20
  private_constant :Pauser
21
21
  end
22
22
 
23
- if defined?(Selenium::WebDriver::VERSION) && (Selenium::WebDriver::VERSION.to_f < 4) &&
23
+ if defined?(Selenium::WebDriver::VERSION) && (Gem::Version.new(Selenium::WebDriver::VERSION) < Gem::Version.new('4')) &&
24
24
  defined?(Selenium::WebDriver::ActionBuilder)
25
25
  Selenium::WebDriver::ActionBuilder.prepend(ActionPauser)
26
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Capybara
4
- VERSION = '3.39.1'
4
+ VERSION = '3.39.2'
5
5
  end
@@ -32,7 +32,7 @@ def ensure_selenium_running!
32
32
  end
33
33
 
34
34
  def selenium_gte?(version)
35
- defined?(Selenium::WebDriver::VERSION) && (Selenium::WebDriver::VERSION.to_f >= version)
35
+ defined?(Selenium::WebDriver::VERSION) && (Gem::Version.new(Selenium::WebDriver::VERSION) >= Gem::Version.new(version))
36
36
  end
37
37
 
38
38
  Capybara.register_driver :selenium_chrome_remote do |app|
data/spec/spec_helper.rb CHANGED
@@ -16,7 +16,7 @@ module Capybara
16
16
  module SpecHelper
17
17
  def firefox?(session)
18
18
  browser_name(session) == :firefox &&
19
- ((defined?(::Selenium::WebDriver::VERSION) && (::Selenium::WebDriver::VERSION.to_f >= 4)) ||
19
+ ((defined?(::Selenium::WebDriver::VERSION) && (Gem::Version.new(::Selenium::WebDriver::VERSION) >= Gem::Version.new('4'))) ||
20
20
  session.driver.browser.capabilities.is_a?(::Selenium::WebDriver::Remote::W3C::Capabilities))
21
21
  end
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.39.1
4
+ version: 3.39.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Walpole
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-12 00:00:00.000000000 Z
12
+ date: 2023-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable