selenium-webdriver 4.12.0 → 4.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +135 -1
  3. data/Gemfile +1 -0
  4. data/LICENSE +1 -1
  5. data/NOTICE +1 -1
  6. data/README.md +2 -2
  7. data/bin/linux/selenium-manager +0 -0
  8. data/bin/macos/selenium-manager +0 -0
  9. data/bin/windows/selenium-manager.exe +0 -0
  10. data/lib/selenium/server.rb +2 -1
  11. data/lib/selenium/webdriver/atoms/findElements.js +28 -27
  12. data/lib/selenium/webdriver/atoms/getAttribute.js +6 -100
  13. data/lib/selenium/webdriver/atoms/isDisplayed.js +24 -96
  14. data/lib/selenium/webdriver/atoms.rb +6 -3
  15. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +1 -1
  16. data/lib/selenium/webdriver/bidi/log_handler.rb +63 -0
  17. data/lib/selenium/webdriver/bidi/log_inspector.rb +5 -1
  18. data/lib/selenium/webdriver/bidi/session.rb +7 -7
  19. data/lib/selenium/webdriver/bidi/struct.rb +44 -0
  20. data/lib/selenium/webdriver/bidi.rb +10 -0
  21. data/lib/selenium/webdriver/chrome/features.rb +5 -1
  22. data/lib/selenium/webdriver/chrome/service.rb +7 -0
  23. data/lib/selenium/webdriver/chromium/driver.rb +1 -1
  24. data/lib/selenium/webdriver/chromium/features.rb +0 -4
  25. data/lib/selenium/webdriver/common/action_builder.rb +0 -4
  26. data/lib/selenium/webdriver/common/child_process.rb +8 -2
  27. data/lib/selenium/webdriver/common/driver.rb +23 -17
  28. data/lib/selenium/webdriver/common/driver_extensions/has_bidi.rb +1 -1
  29. data/lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb +55 -0
  30. data/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rb +65 -0
  31. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +1 -1
  32. data/lib/selenium/webdriver/common/driver_finder.rb +66 -14
  33. data/lib/selenium/webdriver/common/error.rb +22 -22
  34. data/lib/selenium/webdriver/common/fedcm/account.rb +50 -0
  35. data/lib/selenium/webdriver/common/fedcm/dialog.rb +74 -0
  36. data/lib/selenium/webdriver/common/fedcm.rb +27 -0
  37. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +0 -1
  38. data/lib/selenium/webdriver/common/interactions/pointer_cancel.rb +1 -1
  39. data/lib/selenium/webdriver/common/interactions/wheel_actions.rb +2 -1
  40. data/lib/selenium/webdriver/common/interactions/wheel_input.rb +1 -1
  41. data/lib/selenium/webdriver/common/local_driver.rb +8 -1
  42. data/lib/selenium/webdriver/common/logger.rb +7 -7
  43. data/lib/selenium/webdriver/common/manager.rb +1 -1
  44. data/lib/selenium/webdriver/common/options.rb +6 -2
  45. data/lib/selenium/webdriver/common/platform.rb +7 -1
  46. data/lib/selenium/webdriver/common/proxy.rb +2 -2
  47. data/lib/selenium/webdriver/common/script.rb +45 -0
  48. data/lib/selenium/webdriver/common/search_context.rb +10 -2
  49. data/lib/selenium/webdriver/common/selenium_manager.rb +34 -59
  50. data/lib/selenium/webdriver/common/service.rb +4 -0
  51. data/lib/selenium/webdriver/common/service_manager.rb +1 -1
  52. data/lib/selenium/webdriver/common/socket_poller.rb +1 -1
  53. data/lib/selenium/webdriver/common/takes_screenshot.rb +4 -2
  54. data/lib/selenium/webdriver/common/websocket_connection.rb +12 -0
  55. data/lib/selenium/webdriver/common.rb +5 -2
  56. data/lib/selenium/webdriver/devtools/network_interceptor.rb +1 -1
  57. data/lib/selenium/webdriver/edge/features.rb +5 -1
  58. data/lib/selenium/webdriver/edge/service.rb +7 -0
  59. data/lib/selenium/webdriver/firefox/features.rb +5 -1
  60. data/lib/selenium/webdriver/firefox/options.rb +3 -0
  61. data/lib/selenium/webdriver/firefox/profile.rb +14 -6
  62. data/lib/selenium/webdriver/firefox/profiles_ini.rb +1 -1
  63. data/lib/selenium/webdriver/{common/driver_extensions/has_location.rb → ie/features.rb} +8 -10
  64. data/lib/selenium/webdriver/ie/options.rb +3 -2
  65. data/lib/selenium/webdriver/ie.rb +4 -3
  66. data/lib/selenium/webdriver/{common/driver_extensions/has_network_connection.rb → remote/bidi_bridge.rb} +18 -11
  67. data/lib/selenium/webdriver/remote/bridge/commands.rb +13 -7
  68. data/lib/selenium/webdriver/remote/bridge/locator_converter.rb +76 -0
  69. data/lib/selenium/webdriver/remote/bridge.rb +87 -69
  70. data/lib/selenium/webdriver/remote/capabilities.rb +2 -2
  71. data/lib/selenium/webdriver/remote/driver.rb +4 -0
  72. data/lib/selenium/webdriver/remote/features.rb +75 -0
  73. data/lib/selenium/webdriver/remote/http/common.rb +21 -3
  74. data/lib/selenium/webdriver/remote/response.rb +8 -33
  75. data/lib/selenium/webdriver/remote/server_error.rb +1 -1
  76. data/lib/selenium/webdriver/remote.rb +2 -0
  77. data/lib/selenium/webdriver/safari/features.rb +5 -1
  78. data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
  79. data/lib/selenium/webdriver/support/guards/guard.rb +14 -12
  80. data/lib/selenium/webdriver/support/guards.rb +1 -1
  81. data/lib/selenium/webdriver/version.rb +1 -1
  82. data/lib/selenium/webdriver.rb +1 -1
  83. data/selenium-webdriver.gemspec +9 -7
  84. metadata +84 -6
@@ -113,15 +113,15 @@ module Selenium
113
113
  end
114
114
 
115
115
  def dispatch(name, *args)
116
- @listener.__send__("before_#{name}", *args)
116
+ @listener.__send__(:"before_#{name}", *args)
117
117
  returned = yield
118
- @listener.__send__("after_#{name}", *args)
118
+ @listener.__send__(:"after_#{name}", *args)
119
119
 
120
120
  returned
121
121
  end
122
122
 
123
- def method_missing(meth, *args, &blk) # rubocop:disable Style/MissingRespondToMissing
124
- @delegate.__send__(meth, *args, &blk)
123
+ def method_missing(meth, ...) # rubocop:disable Style/MissingRespondToMissing
124
+ @delegate.__send__(meth, ...)
125
125
  end
126
126
  end # EventFiringBridge
127
127
  end # Support
@@ -27,7 +27,7 @@ module Selenium
27
27
  #
28
28
 
29
29
  class Guard
30
- attr_reader :guarded, :type, :messages, :reason
30
+ attr_reader :guarded, :type, :messages, :reason, :tracker
31
31
 
32
32
  def initialize(guarded, type, guards = nil)
33
33
  @guarded = guarded
@@ -36,24 +36,25 @@ module Selenium
36
36
  @messages[:unknown] = 'TODO: Investigate why this is failing and file a bug report'
37
37
  @type = type
38
38
 
39
- @reason = @guarded.delete(:reason)
39
+ @reason = @guarded[:reason] || 'No reason given'
40
+ @guarded[:reason] = @reason
40
41
  end
41
42
 
42
43
  def message
43
- details = case @reason
44
+ details = case reason
44
45
  when Integer
45
- "Bug Filed: #{@tracker}/#{@reason}"
46
+ "Bug Filed: #{tracker}/#{reason}"
46
47
  when Symbol
47
- @messages[@reason]
48
- when String
49
- @reason
48
+ messages[reason]
50
49
  else
51
- 'no reason given'
50
+ "Guarded by #{guarded};"
52
51
  end
53
52
 
54
- case @type
53
+ case type
55
54
  when :exclude
56
- "Test not guarded because it breaks test run; #{details}"
55
+ "Test skipped because it breaks test run; #{details}"
56
+ when :flaky
57
+ "Test skipped because it is unreliable in this configuration; #{details}"
57
58
  when :exclusive
58
59
  "Test does not apply to this configuration; #{details}"
59
60
  else
@@ -71,9 +72,10 @@ module Selenium
71
72
  @type == :only
72
73
  end
73
74
 
74
- # Bug is present on all configurations specified, but test can not be run because it breaks other tests
75
+ # Bug is present on all configurations specified, but test can not be run because it breaks other tests,
76
+ # or it is flaky and unreliable
75
77
  def exclude?
76
- @type == :exclude
78
+ @type == :exclude || @type == :flaky
77
79
  end
78
80
 
79
81
  # Test only applies to configurations specified
@@ -24,7 +24,7 @@ module Selenium
24
24
  module WebDriver
25
25
  module Support
26
26
  class Guards
27
- GUARD_TYPES = %i[except only exclude exclusive].freeze
27
+ GUARD_TYPES = %i[except only exclude exclusive flaky].freeze
28
28
 
29
29
  attr_reader :messages
30
30
  attr_accessor :bug_tracker
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- VERSION = '4.12.0'
22
+ VERSION = '4.23.0'
23
23
  end # WebDriver
24
24
  end # Selenium
@@ -49,7 +49,7 @@ module Selenium
49
49
  # @api private
50
50
 
51
51
  def self.root
52
- @root ||= File.expand_path('..', __dir__)
52
+ @root ||= File.expand_path('..', __dir__.to_s)
53
53
  end
54
54
 
55
55
  #
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  root = File.expand_path(File.dirname(__FILE__))
4
- raise "cwd must be #{root} when reading gemspec" if root != Dir.pwd
5
-
6
4
  $LOAD_PATH.push(File.expand_path('lib', root))
7
5
  require 'selenium/webdriver/version'
8
6
 
@@ -49,17 +47,21 @@ Gem::Specification.new do |s|
49
47
  s.bindir = 'bin'
50
48
  s.require_paths = ['lib']
51
49
 
52
- s.add_runtime_dependency 'rexml', ['~> 3.2', '>= 3.2.5']
53
- s.add_runtime_dependency 'rubyzip', ['>= 1.2.2', '< 3.0']
54
- s.add_runtime_dependency 'websocket', ['~> 1.0']
50
+ s.add_dependency 'base64', ['~> 0.2']
51
+ s.add_dependency 'logger', ['~> 1.4']
52
+ s.add_dependency 'rexml', ['~> 3.2', '>= 3.2.5']
53
+ s.add_dependency 'rubyzip', ['>= 1.2.2', '< 3.0']
54
+ s.add_dependency 'websocket', ['~> 1.0']
55
55
 
56
+ s.add_development_dependency 'git', ['~> 1.19']
56
57
  s.add_development_dependency 'rack', ['~> 2.0']
57
58
  s.add_development_dependency 'rake', ['~> 13.0']
58
59
  s.add_development_dependency 'rspec', ['~> 3.0']
59
- s.add_development_dependency 'rubocop', ['~> 1.42']
60
+ s.add_development_dependency 'rubocop', ['~> 1.60', '>=1.60.2']
60
61
  s.add_development_dependency 'rubocop-performance', ['~> 1.15']
62
+ s.add_development_dependency 'rubocop-rake', ['~> 0.6.0']
61
63
  s.add_development_dependency 'rubocop-rspec', ['~> 2.16']
62
64
  s.add_development_dependency 'webmock', ['~> 3.5']
63
65
  s.add_development_dependency 'webrick', ['~> 1.7']
64
- s.add_development_dependency 'yard', ['~> 0.9.11']
66
+ s.add_development_dependency 'yard', ['~> 0.9.11', '>= 0.9.36']
65
67
  end
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.12.0
4
+ version: 4.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -10,8 +10,36 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-08-31 00:00:00.000000000 Z
13
+ date: 2024-07-18 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: base64
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.2'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '0.2'
29
+ - !ruby/object:Gem::Dependency
30
+ name: logger
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '1.4'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.4'
15
43
  - !ruby/object:Gem::Dependency
16
44
  name: rexml
17
45
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +94,20 @@ dependencies:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
96
  version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: git
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.19'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.19'
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: rack
71
113
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +156,20 @@ dependencies:
114
156
  requirements:
115
157
  - - "~>"
116
158
  - !ruby/object:Gem::Version
117
- version: '1.42'
159
+ version: '1.60'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 1.60.2
118
163
  type: :development
119
164
  prerelease: false
120
165
  version_requirements: !ruby/object:Gem::Requirement
121
166
  requirements:
122
167
  - - "~>"
123
168
  - !ruby/object:Gem::Version
124
- version: '1.42'
169
+ version: '1.60'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 1.60.2
125
173
  - !ruby/object:Gem::Dependency
126
174
  name: rubocop-performance
127
175
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +184,20 @@ dependencies:
136
184
  - - "~>"
137
185
  - !ruby/object:Gem::Version
138
186
  version: '1.15'
187
+ - !ruby/object:Gem::Dependency
188
+ name: rubocop-rake
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - "~>"
192
+ - !ruby/object:Gem::Version
193
+ version: 0.6.0
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
199
+ - !ruby/object:Gem::Version
200
+ version: 0.6.0
139
201
  - !ruby/object:Gem::Dependency
140
202
  name: rubocop-rspec
141
203
  requirement: !ruby/object:Gem::Requirement
@@ -185,6 +247,9 @@ dependencies:
185
247
  - - "~>"
186
248
  - !ruby/object:Gem::Version
187
249
  version: 0.9.11
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: 0.9.36
188
253
  type: :development
189
254
  prerelease: false
190
255
  version_requirements: !ruby/object:Gem::Requirement
@@ -192,6 +257,9 @@ dependencies:
192
257
  - - "~>"
193
258
  - !ruby/object:Gem::Version
194
259
  version: 0.9.11
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: 0.9.36
195
263
  description: |2
196
264
  Selenium implements the W3C WebDriver protocol to automate popular browsers.
197
265
  It aims to mimic the behaviour of a real user as it interacts with the application's HTML.
@@ -228,9 +296,11 @@ files:
228
296
  - lib/selenium/webdriver/bidi/log/filter_by.rb
229
297
  - lib/selenium/webdriver/bidi/log/generic_log_entry.rb
230
298
  - lib/selenium/webdriver/bidi/log/javascript_log_entry.rb
299
+ - lib/selenium/webdriver/bidi/log_handler.rb
231
300
  - lib/selenium/webdriver/bidi/log_inspector.rb
232
301
  - lib/selenium/webdriver/bidi/navigate_result.rb
233
302
  - lib/selenium/webdriver/bidi/session.rb
303
+ - lib/selenium/webdriver/bidi/struct.rb
234
304
  - lib/selenium/webdriver/chrome.rb
235
305
  - lib/selenium/webdriver/chrome/driver.rb
236
306
  - lib/selenium/webdriver/chrome/features.rb
@@ -258,12 +328,12 @@ files:
258
328
  - lib/selenium/webdriver/common/driver_extensions/has_context.rb
259
329
  - lib/selenium/webdriver/common/driver_extensions/has_debugger.rb
260
330
  - lib/selenium/webdriver/common/driver_extensions/has_devtools.rb
331
+ - lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb
332
+ - lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rb
261
333
  - lib/selenium/webdriver/common/driver_extensions/has_launching.rb
262
- - lib/selenium/webdriver/common/driver_extensions/has_location.rb
263
334
  - lib/selenium/webdriver/common/driver_extensions/has_log_events.rb
264
335
  - lib/selenium/webdriver/common/driver_extensions/has_logs.rb
265
336
  - lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb
266
- - lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb
267
337
  - lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb
268
338
  - lib/selenium/webdriver/common/driver_extensions/has_permissions.rb
269
339
  - lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb
@@ -274,6 +344,9 @@ files:
274
344
  - lib/selenium/webdriver/common/driver_finder.rb
275
345
  - lib/selenium/webdriver/common/element.rb
276
346
  - lib/selenium/webdriver/common/error.rb
347
+ - lib/selenium/webdriver/common/fedcm.rb
348
+ - lib/selenium/webdriver/common/fedcm/account.rb
349
+ - lib/selenium/webdriver/common/fedcm/dialog.rb
277
350
  - lib/selenium/webdriver/common/file_reaper.rb
278
351
  - lib/selenium/webdriver/common/html5/local_storage.rb
279
352
  - lib/selenium/webdriver/common/html5/session_storage.rb
@@ -308,6 +381,7 @@ files:
308
381
  - lib/selenium/webdriver/common/port_prober.rb
309
382
  - lib/selenium/webdriver/common/profile_helper.rb
310
383
  - lib/selenium/webdriver/common/proxy.rb
384
+ - lib/selenium/webdriver/common/script.rb
311
385
  - lib/selenium/webdriver/common/search_context.rb
312
386
  - lib/selenium/webdriver/common/selenium_manager.rb
313
387
  - lib/selenium/webdriver/common/service.rb
@@ -350,13 +424,17 @@ files:
350
424
  - lib/selenium/webdriver/firefox/util.rb
351
425
  - lib/selenium/webdriver/ie.rb
352
426
  - lib/selenium/webdriver/ie/driver.rb
427
+ - lib/selenium/webdriver/ie/features.rb
353
428
  - lib/selenium/webdriver/ie/options.rb
354
429
  - lib/selenium/webdriver/ie/service.rb
355
430
  - lib/selenium/webdriver/remote.rb
431
+ - lib/selenium/webdriver/remote/bidi_bridge.rb
356
432
  - lib/selenium/webdriver/remote/bridge.rb
357
433
  - lib/selenium/webdriver/remote/bridge/commands.rb
434
+ - lib/selenium/webdriver/remote/bridge/locator_converter.rb
358
435
  - lib/selenium/webdriver/remote/capabilities.rb
359
436
  - lib/selenium/webdriver/remote/driver.rb
437
+ - lib/selenium/webdriver/remote/features.rb
360
438
  - lib/selenium/webdriver/remote/http/common.rb
361
439
  - lib/selenium/webdriver/remote/http/curb.rb
362
440
  - lib/selenium/webdriver/remote/http/default.rb