selenium-webdriver 4.0.0.rc3 → 4.0.0

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: 2ab22cf48ce547f745515fdd60b09f44788f92bc7a6a339c43462c53d8161cab
4
- data.tar.gz: 898185398832035b0c29294eb83f05883650ff3e61a5ecdc3da8842a454c28bd
3
+ metadata.gz: c06a2d4e78b10cc31c89baf7ac72014ca43bf4425b0825ede55d942ef90ae47a
4
+ data.tar.gz: f3d005b5469d38ab07c6a35a032c65b69f97c54ecbd648bbaf5217f43e1a9457
5
5
  SHA512:
6
- metadata.gz: 9147cc75bbabff4744ba484bbf23e4fd5a6d683e201315eb42f536f07f35789a78151f3b5abc53da60624c5681f90e064da5ec5dd30117bbb8d33b71f1b37b6a
7
- data.tar.gz: 173788de6fc1b98ac83255f49cf8e03a5e7d1b7c68853077a7a6d6b96880e768daad66aaa2f228e72d8f76db4c8c13070c762860a6ecccbaf98e4190c1ccf990
6
+ metadata.gz: dba83257a6a44f2a68fdea7f7c7ae30b2d27802407d22b42bd4262b3ba8a71be00b90de4a1850428a208392ce6ecc63db20b30af8b2b14d910d5a7c20be9c32e
7
+ data.tar.gz: f9bf4b3098e9e9b5487c766e33ccdebda51f4854f3aaf896af12b26875644ab691530700af80d84fc15b73369e27742568aba375800975da9c81fc8e46beeb9d
data/CHANGES CHANGED
@@ -1,3 +1,16 @@
1
+ 4.0.0 (2021-10-13)
2
+ =========================
3
+
4
+ Ruby:
5
+ * Updated minimum required Ruby version to 2.6
6
+ * Updated minimum required rexml gem version due to vulnerability
7
+
8
+ Chrome:
9
+ * Added default values for Network Conditions so no longer need to specify everything
10
+
11
+ Firefox:
12
+ * Fixed bug where Firefox prefs were converting snake case to camel case
13
+
1
14
  4.0.0.rc3 (2021-10-08)
2
15
  =========================
3
16
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # selenium-webdriver
2
2
 
3
- This gem provides Ruby bindings for Selenium and supports MRI > 2.5
3
+ This gem provides Ruby bindings for Selenium and supports MRI >= 2.6
4
4
 
5
5
  ## Install
6
6
 
@@ -38,10 +38,19 @@ module Selenium
38
38
  # @param [Hash] conditions
39
39
  # @option conditions [Integer] :latency
40
40
  # @option conditions [Integer] :throughput
41
+ # @option conditions [Integer] :upload_throughput
42
+ # @option conditions [Integer] :download_throughput
41
43
  # @option conditions [Boolean] :offline
42
44
  #
43
45
 
44
46
  def network_conditions=(conditions)
47
+ conditions[:latency] ||= 0
48
+ unless conditions.key?(:throughput)
49
+ conditions[:download_throughput] ||= -1
50
+ conditions[:upload_throughput] ||= -1
51
+ end
52
+ conditions[:offline] = false unless conditions.key?(:offline)
53
+
45
54
  @bridge.network_conditions = conditions
46
55
  end
47
56
 
@@ -65,26 +65,37 @@ module Selenium
65
65
  arr << Errno::EALREADY if Platform.wsl?
66
66
  }.freeze
67
67
 
68
- def listening?
69
- addr = Socket.getaddrinfo(@host, @port, Socket::AF_INET, Socket::SOCK_STREAM)
70
- sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
71
- sockaddr = Socket.pack_sockaddr_in(@port, addr[0][3])
72
-
73
- begin
74
- sock.connect_nonblock sockaddr
75
- rescue Errno::EINPROGRESS
76
- retry if socket_writable?(sock) && conn_completed?(sock)
77
- raise Errno::ECONNREFUSED
78
- rescue *CONNECTED_ERRORS
79
- # yay!
68
+ if Platform.jruby?
69
+ # we use a plain TCPSocket here since JRuby has issues closing socket
70
+ # see https://github.com/jruby/jruby/issues/5709
71
+ def listening?
72
+ TCPSocket.new(@host, @port).close
73
+ true
74
+ rescue *NOT_CONNECTED_ERRORS
75
+ false
76
+ end
77
+ else
78
+ def listening?
79
+ addr = Socket.getaddrinfo(@host, @port, Socket::AF_INET, Socket::SOCK_STREAM)
80
+ sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
81
+ sockaddr = Socket.pack_sockaddr_in(@port, addr[0][3])
82
+
83
+ begin
84
+ sock.connect_nonblock sockaddr
85
+ rescue Errno::EINPROGRESS
86
+ retry if socket_writable?(sock) && conn_completed?(sock)
87
+ raise Errno::ECONNREFUSED
88
+ rescue *CONNECTED_ERRORS
89
+ # yay!
90
+ end
91
+
92
+ sock.close
93
+ true
94
+ rescue *NOT_CONNECTED_ERRORS
95
+ sock&.close
96
+ WebDriver.logger.debug("polling for socket on #{[@host, @port].inspect}")
97
+ false
80
98
  end
81
-
82
- sock.close
83
- true
84
- rescue *NOT_CONNECTED_ERRORS
85
- sock&.close
86
- WebDriver.logger.debug("polling for socket on #{[@host, @port].inspect}")
87
- false
88
99
  end
89
100
 
90
101
  def socket_writable?(sock)
@@ -173,6 +173,10 @@ module Selenium
173
173
  Profile.from_name(profile)
174
174
  end
175
175
  end
176
+
177
+ def camelize?(key)
178
+ key != :prefs
179
+ end
176
180
  end # Options
177
181
  end # Firefox
178
182
  end # WebDriver
@@ -657,7 +657,7 @@ module Selenium
657
657
  # @see https://mathiasbynens.be/notes/css-escapes
658
658
  def escape_css(string)
659
659
  string = string.gsub(ESCAPE_CSS_REGEXP) { |match| "\\#{match}" }
660
- string = "\\#{UNICODE_CODE_POINT + Integer(string[0])} #{string[1..-1]}" if string[0]&.match?(/[[:digit:]]/)
660
+ string = "\\#{UNICODE_CODE_POINT + Integer(string[0])} #{string[1..]}" if string[0]&.match?(/[[:digit:]]/)
661
661
 
662
662
  string
663
663
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- VERSION = '4.0.0.rc3'
22
+ VERSION = '4.0.0'
23
23
  end # WebDriver
24
24
  end # Selenium
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  }
29
29
 
30
30
  s.required_rubygems_version = Gem::Requirement.new('> 1.3.1') if s.respond_to? :required_rubygems_version=
31
- s.required_ruby_version = Gem::Requirement.new('>= 2.5')
31
+ s.required_ruby_version = Gem::Requirement.new('>= 2.6')
32
32
 
33
33
  s.files = [
34
34
  'CHANGES',
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
45
45
  s.require_paths = ['lib']
46
46
 
47
47
  s.add_runtime_dependency 'childprocess', ['>= 0.5', '< 5.0']
48
- s.add_runtime_dependency 'rexml', ['~> 3.2']
48
+ s.add_runtime_dependency 'rexml', ['~> 3.2', '>= 3.2.5']
49
49
  s.add_runtime_dependency 'rubyzip', ['>= 1.2.2']
50
50
 
51
51
  # childprocess requires ffi on windows but doesn't declare it in its dependencies
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.rc3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-10-08 00:00:00.000000000 Z
13
+ date: 2021-10-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: childprocess
@@ -39,6 +39,9 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '3.2'
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 3.2.5
42
45
  type: :runtime
43
46
  prerelease: false
44
47
  version_requirements: !ruby/object:Gem::Requirement
@@ -46,6 +49,9 @@ dependencies:
46
49
  - - "~>"
47
50
  - !ruby/object:Gem::Version
48
51
  version: '3.2'
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.5
49
55
  - !ruby/object:Gem::Dependency
50
56
  name: rubyzip
51
57
  requirement: !ruby/object:Gem::Requirement
@@ -380,7 +386,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
380
386
  requirements:
381
387
  - - ">="
382
388
  - !ruby/object:Gem::Version
383
- version: '2.5'
389
+ version: '2.6'
384
390
  required_rubygems_version: !ruby/object:Gem::Requirement
385
391
  requirements:
386
392
  - - ">"