selenium-webdriver 4.7.0 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +34 -0
  3. data/LICENSE +1 -1
  4. data/NOTICE +1 -1
  5. data/lib/selenium/server.rb +1 -0
  6. data/lib/selenium/webdriver/atoms.rb +2 -3
  7. data/lib/selenium/webdriver/bidi/browsing_context.rb +88 -0
  8. data/lib/selenium/webdriver/bidi/browsing_context_info.rb +35 -0
  9. data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +35 -0
  10. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +35 -0
  11. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +33 -0
  12. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +33 -0
  13. data/lib/selenium/webdriver/bidi/log_inspector.rb +140 -0
  14. data/lib/selenium/webdriver/bidi/navigate_result.rb +33 -0
  15. data/lib/selenium/webdriver/bidi/session.rb +13 -0
  16. data/lib/selenium/webdriver/bidi.rb +2 -1
  17. data/lib/selenium/webdriver/chrome/driver.rb +19 -29
  18. data/lib/selenium/webdriver/chrome/features.rb +5 -72
  19. data/lib/selenium/webdriver/chrome/options.rb +3 -237
  20. data/lib/selenium/webdriver/chrome/profile.rb +3 -83
  21. data/lib/selenium/webdriver/chrome/service.rb +3 -18
  22. data/lib/selenium/webdriver/chromium/driver.rb +61 -0
  23. data/lib/selenium/webdriver/chromium/features.rb +103 -0
  24. data/lib/selenium/webdriver/chromium/options.rb +261 -0
  25. data/lib/selenium/webdriver/chromium/profile.rb +113 -0
  26. data/lib/selenium/webdriver/chromium/service.rb +42 -0
  27. data/lib/selenium/webdriver/chromium.rb +32 -0
  28. data/lib/selenium/webdriver/common/action_builder.rb +11 -48
  29. data/lib/selenium/webdriver/common/child_process.rb +0 -2
  30. data/lib/selenium/webdriver/common/driver.rb +34 -25
  31. data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +0 -2
  32. data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +0 -1
  33. data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +0 -2
  34. data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +0 -2
  35. data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +0 -2
  36. data/lib/selenium/webdriver/common/driver_extensions/has_bidi.rb +0 -2
  37. data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +0 -1
  38. data/lib/selenium/webdriver/common/driver_extensions/has_cdp.rb +0 -2
  39. data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +0 -2
  40. data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +0 -2
  41. data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +0 -2
  42. data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +0 -2
  43. data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +1 -2
  44. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -1
  45. data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +0 -2
  46. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -2
  47. data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +0 -2
  48. data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +0 -2
  49. data/lib/selenium/webdriver/common/element.rb +6 -6
  50. data/lib/selenium/webdriver/common/error.rb +0 -2
  51. data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +2 -2
  52. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +3 -3
  53. data/lib/selenium/webdriver/common/interactions/pointer_move.rb +2 -2
  54. data/lib/selenium/webdriver/common/interactions/scroll.rb +7 -5
  55. data/lib/selenium/webdriver/common/logger.rb +10 -2
  56. data/lib/selenium/webdriver/common/options.rb +30 -8
  57. data/lib/selenium/webdriver/common/profile_helper.rb +1 -1
  58. data/lib/selenium/webdriver/common/proxy.rb +1 -1
  59. data/lib/selenium/webdriver/common/selenium_manager.rb +10 -12
  60. data/lib/selenium/webdriver/common/service.rb +9 -5
  61. data/lib/selenium/webdriver/common/service_manager.rb +1 -1
  62. data/lib/selenium/webdriver/common/shadow_root.rb +1 -2
  63. data/lib/selenium/webdriver/common/socket_lock.rb +1 -0
  64. data/lib/selenium/webdriver/common/takes_screenshot.rb +2 -3
  65. data/lib/selenium/webdriver/common/target_locator.rb +2 -3
  66. data/lib/selenium/webdriver/common/timeouts.rb +2 -2
  67. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +8 -6
  68. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb +0 -1
  69. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb +16 -16
  70. data/lib/selenium/webdriver/common/websocket_connection.rb +1 -2
  71. data/lib/selenium/webdriver/devtools/console_event.rb +0 -2
  72. data/lib/selenium/webdriver/devtools/exception_event.rb +0 -2
  73. data/lib/selenium/webdriver/devtools/mutation_event.rb +0 -2
  74. data/lib/selenium/webdriver/devtools/network_interceptor.rb +3 -6
  75. data/lib/selenium/webdriver/devtools/pinned_script.rb +0 -2
  76. data/lib/selenium/webdriver/devtools/request.rb +0 -2
  77. data/lib/selenium/webdriver/devtools/response.rb +0 -2
  78. data/lib/selenium/webdriver/devtools.rb +0 -1
  79. data/lib/selenium/webdriver/edge/driver.rb +20 -3
  80. data/lib/selenium/webdriver/edge/features.rb +3 -4
  81. data/lib/selenium/webdriver/edge/options.rb +3 -5
  82. data/lib/selenium/webdriver/edge/profile.rb +2 -2
  83. data/lib/selenium/webdriver/edge/service.rb +2 -2
  84. data/lib/selenium/webdriver/firefox/driver.rb +19 -2
  85. data/lib/selenium/webdriver/firefox/features.rb +0 -1
  86. data/lib/selenium/webdriver/firefox/options.rb +4 -1
  87. data/lib/selenium/webdriver/firefox/profile.rb +6 -6
  88. data/lib/selenium/webdriver/firefox/service.rb +0 -1
  89. data/lib/selenium/webdriver/ie/driver.rb +20 -1
  90. data/lib/selenium/webdriver/ie/service.rb +1 -2
  91. data/lib/selenium/webdriver/remote/bridge.rb +8 -15
  92. data/lib/selenium/webdriver/remote/capabilities.rb +34 -12
  93. data/lib/selenium/webdriver/remote/commands.rb +0 -2
  94. data/lib/selenium/webdriver/remote/driver.rb +13 -13
  95. data/lib/selenium/webdriver/remote/http/curb.rb +0 -2
  96. data/lib/selenium/webdriver/remote/http/default.rb +1 -0
  97. data/lib/selenium/webdriver/remote/response.rb +0 -1
  98. data/lib/selenium/webdriver/safari/driver.rb +20 -1
  99. data/lib/selenium/webdriver/safari/features.rb +0 -2
  100. data/lib/selenium/webdriver/safari/options.rb +5 -1
  101. data/lib/selenium/webdriver/safari.rb +1 -1
  102. data/lib/selenium/webdriver/support/color.rb +15 -15
  103. data/lib/selenium/webdriver/support/guards/guard.rb +0 -2
  104. data/lib/selenium/webdriver/support/guards/guard_condition.rb +0 -2
  105. data/lib/selenium/webdriver/support/relative_locator.rb +0 -1
  106. data/lib/selenium/webdriver/version.rb +1 -1
  107. data/lib/selenium/webdriver.rb +3 -3
  108. data/selenium-webdriver.gemspec +3 -5
  109. metadata +25 -41
  110. data/lib/selenium/webdriver/support/cdp_client_generator.rb +0 -108
  111. data/lib/selenium/webdriver/support/nightly_version_generator.rb +0 -60
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.0
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
8
8
  - Titus Fortner
9
9
  - Thomas Walpole
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-12-01 00:00:00.000000000 Z
13
+ date: 2023-01-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rexml
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '2.0'
97
- - !ruby/object:Gem::Dependency
98
- name: rake
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: rspec
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,56 +114,42 @@ dependencies:
128
114
  requirements:
129
115
  - - "~>"
130
116
  - !ruby/object:Gem::Version
131
- version: '1.31'
117
+ version: '1.42'
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
122
  - - "~>"
137
123
  - !ruby/object:Gem::Version
138
- version: '1.31'
124
+ version: '1.42'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: rubocop-performance
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
- version: '1.13'
131
+ version: '1.15'
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
- version: '1.13'
153
- - !ruby/object:Gem::Dependency
154
- name: rubocop-rake
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
138
+ version: '1.15'
167
139
  - !ruby/object:Gem::Dependency
168
140
  name: rubocop-rspec
169
141
  requirement: !ruby/object:Gem::Requirement
170
142
  requirements:
171
143
  - - "~>"
172
144
  - !ruby/object:Gem::Version
173
- version: '2.12'
145
+ version: '2.16'
174
146
  type: :development
175
147
  prerelease: false
176
148
  version_requirements: !ruby/object:Gem::Requirement
177
149
  requirements:
178
150
  - - "~>"
179
151
  - !ruby/object:Gem::Version
180
- version: '2.12'
152
+ version: '2.16'
181
153
  - !ruby/object:Gem::Dependency
182
154
  name: webmock
183
155
  requirement: !ruby/object:Gem::Requirement
@@ -249,6 +221,14 @@ files:
249
221
  - lib/selenium/webdriver/atoms/isDisplayed.js
250
222
  - lib/selenium/webdriver/atoms/mutationListener.js
251
223
  - lib/selenium/webdriver/bidi.rb
224
+ - lib/selenium/webdriver/bidi/browsing_context.rb
225
+ - lib/selenium/webdriver/bidi/browsing_context_info.rb
226
+ - lib/selenium/webdriver/bidi/log/base_log_entry.rb
227
+ - lib/selenium/webdriver/bidi/log/console_log_entry.rb
228
+ - lib/selenium/webdriver/bidi/log/generic_log_entry.rb
229
+ - lib/selenium/webdriver/bidi/log/javascript_log_entry.rb
230
+ - lib/selenium/webdriver/bidi/log_inspector.rb
231
+ - lib/selenium/webdriver/bidi/navigate_result.rb
252
232
  - lib/selenium/webdriver/bidi/session.rb
253
233
  - lib/selenium/webdriver/chrome.rb
254
234
  - lib/selenium/webdriver/chrome/driver.rb
@@ -256,6 +236,12 @@ files:
256
236
  - lib/selenium/webdriver/chrome/options.rb
257
237
  - lib/selenium/webdriver/chrome/profile.rb
258
238
  - lib/selenium/webdriver/chrome/service.rb
239
+ - lib/selenium/webdriver/chromium.rb
240
+ - lib/selenium/webdriver/chromium/driver.rb
241
+ - lib/selenium/webdriver/chromium/features.rb
242
+ - lib/selenium/webdriver/chromium/options.rb
243
+ - lib/selenium/webdriver/chromium/profile.rb
244
+ - lib/selenium/webdriver/chromium/service.rb
259
245
  - lib/selenium/webdriver/common.rb
260
246
  - lib/selenium/webdriver/common/action_builder.rb
261
247
  - lib/selenium/webdriver/common/alert.rb
@@ -382,14 +368,12 @@ files:
382
368
  - lib/selenium/webdriver/support.rb
383
369
  - lib/selenium/webdriver/support/abstract_event_listener.rb
384
370
  - lib/selenium/webdriver/support/block_event_listener.rb
385
- - lib/selenium/webdriver/support/cdp_client_generator.rb
386
371
  - lib/selenium/webdriver/support/color.rb
387
372
  - lib/selenium/webdriver/support/escaper.rb
388
373
  - lib/selenium/webdriver/support/event_firing_bridge.rb
389
374
  - lib/selenium/webdriver/support/guards.rb
390
375
  - lib/selenium/webdriver/support/guards/guard.rb
391
376
  - lib/selenium/webdriver/support/guards/guard_condition.rb
392
- - lib/selenium/webdriver/support/nightly_version_generator.rb
393
377
  - lib/selenium/webdriver/support/relative_locator.rb
394
378
  - lib/selenium/webdriver/support/select.rb
395
379
  - lib/selenium/webdriver/version.rb
@@ -402,7 +386,7 @@ metadata:
402
386
  github_repo: ssh://github.com/SeleniumHQ/selenium
403
387
  source_code_uri: https://github.com/SeleniumHQ/selenium/tree/trunk/rb
404
388
  rubygems_mfa_required: 'true'
405
- post_install_message:
389
+ post_install_message:
406
390
  rdoc_options: []
407
391
  require_paths:
408
392
  - lib
@@ -418,7 +402,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
418
402
  version: 1.3.1
419
403
  requirements: []
420
404
  rubygems_version: 3.1.6
421
- signing_key:
405
+ signing_key:
422
406
  specification_version: 4
423
407
  summary: Selenium is a browser automation tool for automated testing of webapps and
424
408
  more
@@ -1,108 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed to the Software Freedom Conservancy (SFC) under one
4
- # or more contributor license agreements. See the NOTICE file
5
- # distributed with this work for additional information
6
- # regarding copyright ownership. The SFC licenses this file
7
- # to you under the Apache License, Version 2.0 (the
8
- # "License"); you may not use this file except in compliance
9
- # with the License. You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- require 'erb'
21
- require 'fileutils'
22
- require 'json'
23
-
24
- module Selenium
25
- module WebDriver
26
- module Support
27
- class CDPClientGenerator
28
- # Input JSON files are generated from PDL tasks.
29
- TEMPLATE_PATH = File.expand_path('cdp/domain.rb.erb', __dir__)
30
-
31
- RESERVED_KEYWORDS = %w[end].freeze
32
-
33
- def call(output_dir:, version:, browser_protocol_path: nil, js_protocol_path: nil, loader_path: nil, **)
34
- @template = ERB.new(File.read(TEMPLATE_PATH))
35
- @output_dir = output_dir
36
- @loader_path = loader_path || "#{@output_dir}.rb"
37
- @version = version
38
-
39
- browser_protocol_path ||= File.expand_path('cdp/browser_protocol.json', __dir__)
40
- js_protocol_path ||= File.expand_path('cdp/js_protocol.json', __dir__)
41
-
42
- browser_protocol = JSON.parse(File.read(browser_protocol_path), symbolize_names: true)
43
- js_protocol = JSON.parse(File.read(js_protocol_path), symbolize_names: true)
44
-
45
- FileUtils.mkdir_p(@output_dir)
46
-
47
- browser_protocol[:domains].each { |domain| process_domain(domain) }
48
- js_protocol[:domains].each { |domain| process_domain(domain) }
49
- require_file
50
- end
51
-
52
- def process_domain(domain)
53
- result = @template.result_with_hash(domain: domain, version: @version.upcase, h: self)
54
- filename = File.join(@output_dir, "#{snake_case(domain[:domain])}.rb")
55
- File.write(filename, remove_empty_lines(result))
56
- end
57
-
58
- def snake_case(string)
59
- name = string.gsub('JavaScript', 'Javascript')
60
- .gsub(/([A-Z]+)([A-Z][a-z]{2,})/, '\1_\2')
61
- .gsub(/([a-z\d])([A-Z])/, '\1_\2')
62
- .downcase
63
- # Certain CDP parameters conflict with Ruby keywords
64
- # so we prefix the name with underscore.
65
- name = "_#{name}" if RESERVED_KEYWORDS.include?(name)
66
-
67
- name
68
- end
69
-
70
- def kwargs(parameters)
71
- parameters = parameters.map do |parameter|
72
- if parameter[:optional]
73
- "#{snake_case(parameter[:name])}: nil"
74
- else
75
- "#{snake_case(parameter[:name])}:"
76
- end
77
- end
78
- parameters.join(', ')
79
- end
80
-
81
- def remove_empty_lines(string)
82
- string.split("\n").grep_v(/^\s+$/).join("\n")
83
- end
84
-
85
- def require_file
86
- # rubocop:disable Lint/InterpolationCheck
87
- dynamic_location = '#{File.dirname(File.absolute_path(__FILE__))}'
88
- # rubocop:enable Lint/InterpolationCheck
89
-
90
- require_all = "Dir.glob(\"#{dynamic_location}/#{@version}/*\", &method(:require))"
91
- File.write(@loader_path, require_all)
92
- end
93
- end
94
- end
95
- end
96
- end
97
-
98
- if $PROGRAM_NAME == __FILE__
99
- browser_protocol_path, js_protocol_path, output_dir, loader_path, version = *ARGV
100
-
101
- Selenium::WebDriver::Support::CDPClientGenerator.new.call(
102
- browser_protocol_path: browser_protocol_path,
103
- js_protocol_path: js_protocol_path,
104
- output_dir: output_dir,
105
- loader_path: loader_path,
106
- version: version
107
- )
108
- end
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Licensed to the Software Freedom Conservancy (SFC) under one
4
- # or more contributor license agreements. See the NOTICE file
5
- # distributed with this work for additional information
6
- # regarding copyright ownership. The SFC licenses this file
7
- # to you under the Apache License, Version 2.0 (the
8
- # "License"); you may not use this file except in compliance
9
- # with the License. You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- require 'date'
21
-
22
- module Selenium
23
- module WebDriver
24
- module Support
25
-
26
- #
27
- # Updates version in `version.rb` file with nightly suffix:
28
- # - VERSION = '4.6.1'
29
- # + VERSION = '4.6.1.nightly.20221126'
30
- #
31
- # @api private
32
- #
33
-
34
- class NightlyVersionGenerator
35
-
36
- REGEXP = /VERSION = ['"]([\d.]+)['"]/.freeze
37
-
38
- def self.call(version_file, version_suffix)
39
- version_suffix ||= Date.today.strftime('%Y%m%d')
40
- version_file_contents = File.read(version_file)
41
- version_file_contents.gsub!(REGEXP) do
42
- old_version = Regexp.last_match(1)
43
- new_version = [old_version, 'nightly', version_suffix].join('.')
44
- puts("#{old_version} -> #{new_version}")
45
-
46
- "VERSION = '#{new_version}'"
47
- end
48
-
49
- File.write(version_file, version_file_contents)
50
- end
51
-
52
- end # NightlyVersionGenerator
53
- end # Support
54
- end # WebDriver
55
- end # Selenium
56
-
57
- if __FILE__ == $PROGRAM_NAME
58
- version_file, version_suffix = *ARGV
59
- Selenium::WebDriver::Support::NightlyVersionGenerator.call(version_file, version_suffix)
60
- end