selenium-webdriver 3.142.7 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES +350 -5
  3. data/Gemfile +3 -1
  4. data/LICENSE +1 -1
  5. data/NOTICE +2 -0
  6. data/README.md +4 -5
  7. data/lib/selenium/server.rb +69 -63
  8. data/lib/selenium/webdriver/atoms/findElements.js +122 -0
  9. data/lib/selenium/webdriver/atoms/getAttribute.js +100 -7
  10. data/lib/selenium/webdriver/atoms/isDisplayed.js +76 -78
  11. data/lib/selenium/webdriver/atoms/mutationListener.js +55 -0
  12. data/lib/selenium/webdriver/chrome/driver.rb +26 -83
  13. data/lib/selenium/webdriver/chrome/{bridge.rb → features.rb} +50 -12
  14. data/lib/selenium/webdriver/chrome/options.rb +129 -58
  15. data/lib/selenium/webdriver/chrome/profile.rb +6 -3
  16. data/lib/selenium/webdriver/chrome/service.rb +8 -15
  17. data/lib/selenium/webdriver/chrome.rb +10 -9
  18. data/lib/selenium/webdriver/common/action_builder.rb +97 -249
  19. data/lib/selenium/webdriver/common/driver.rb +112 -23
  20. data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +43 -0
  21. data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +51 -0
  22. data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +89 -0
  23. data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +77 -0
  24. data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_cdp.rb} +10 -8
  25. data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +45 -0
  26. data/lib/selenium/webdriver/{firefox/util.rb → common/driver_extensions/has_devtools.rb} +16 -19
  27. data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +38 -0
  28. data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +5 -8
  29. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +144 -0
  30. data/lib/selenium/webdriver/common/driver_extensions/has_logs.rb +30 -0
  31. data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +17 -0
  32. data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +6 -27
  33. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +136 -0
  34. data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +11 -11
  35. data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +77 -0
  36. data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +1 -0
  37. data/lib/selenium/webdriver/common/driver_extensions/{rotatable.rb → prints_page.rb} +18 -20
  38. data/lib/selenium/webdriver/common/element.rb +82 -22
  39. data/lib/selenium/webdriver/common/error.rb +32 -196
  40. data/lib/selenium/webdriver/common/interactions/interaction.rb +4 -1
  41. data/lib/selenium/webdriver/common/interactions/key_actions.rb +5 -5
  42. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +13 -13
  43. data/lib/selenium/webdriver/common/log_entry.rb +2 -2
  44. data/lib/selenium/webdriver/common/logger.rb +50 -15
  45. data/lib/selenium/webdriver/common/manager.rb +15 -15
  46. data/lib/selenium/webdriver/common/options.rb +154 -23
  47. data/lib/selenium/webdriver/common/platform.rb +6 -1
  48. data/lib/selenium/webdriver/common/port_prober.rb +4 -6
  49. data/lib/selenium/webdriver/common/profile_helper.rb +11 -9
  50. data/lib/selenium/webdriver/common/proxy.rb +6 -3
  51. data/lib/selenium/webdriver/common/search_context.rb +7 -3
  52. data/lib/selenium/webdriver/common/service.rb +17 -125
  53. data/lib/selenium/webdriver/common/service_manager.rb +151 -0
  54. data/lib/selenium/webdriver/common/shadow_root.rb +87 -0
  55. data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
  56. data/lib/selenium/webdriver/common/socket_poller.rb +2 -2
  57. data/lib/selenium/webdriver/common/takes_screenshot.rb +66 -0
  58. data/lib/selenium/webdriver/common/target_locator.rb +32 -4
  59. data/lib/selenium/webdriver/common/timeouts.rb +31 -4
  60. data/lib/selenium/webdriver/common/wait.rb +1 -1
  61. data/lib/selenium/webdriver/common/window.rb +0 -4
  62. data/lib/selenium/webdriver/common/zipper.rb +1 -9
  63. data/lib/selenium/webdriver/common.rb +23 -17
  64. data/lib/selenium/webdriver/devtools/console_event.rb +38 -0
  65. data/lib/selenium/webdriver/devtools/exception_event.rb +36 -0
  66. data/lib/selenium/webdriver/devtools/mutation_event.rb +37 -0
  67. data/lib/selenium/webdriver/devtools/pinned_script.rb +59 -0
  68. data/lib/selenium/webdriver/devtools/request.rb +67 -0
  69. data/lib/selenium/webdriver/devtools/response.rb +66 -0
  70. data/lib/selenium/webdriver/devtools.rb +182 -0
  71. data/lib/selenium/webdriver/edge/driver.rb +7 -29
  72. data/lib/selenium/webdriver/edge/features.rb +44 -0
  73. data/lib/selenium/webdriver/edge/options.rb +11 -48
  74. data/lib/selenium/webdriver/{common/w3c_manager.rb → edge/profile.rb} +7 -19
  75. data/lib/selenium/webdriver/edge/service.rb +10 -26
  76. data/lib/selenium/webdriver/edge.rb +11 -14
  77. data/lib/selenium/webdriver/firefox/driver.rb +31 -19
  78. data/lib/selenium/webdriver/firefox/extension.rb +8 -0
  79. data/lib/selenium/webdriver/firefox/features.rb +66 -0
  80. data/lib/selenium/webdriver/firefox/options.rb +70 -49
  81. data/lib/selenium/webdriver/firefox/profile.rb +21 -71
  82. data/lib/selenium/webdriver/firefox/service.rb +5 -9
  83. data/lib/selenium/webdriver/firefox.rb +22 -20
  84. data/lib/selenium/webdriver/ie/driver.rb +1 -47
  85. data/lib/selenium/webdriver/ie/options.rb +13 -44
  86. data/lib/selenium/webdriver/ie/service.rb +13 -15
  87. data/lib/selenium/webdriver/ie.rb +8 -7
  88. data/lib/selenium/webdriver/remote/bridge.rb +558 -86
  89. data/lib/selenium/webdriver/remote/capabilities.rb +159 -123
  90. data/lib/selenium/webdriver/remote/commands.rb +163 -0
  91. data/lib/selenium/webdriver/remote/driver.rb +22 -12
  92. data/lib/selenium/webdriver/remote/http/common.rb +0 -5
  93. data/lib/selenium/webdriver/remote/http/default.rb +17 -20
  94. data/lib/selenium/webdriver/remote/http/persistent.rb +11 -6
  95. data/lib/selenium/webdriver/remote/response.rb +16 -47
  96. data/lib/selenium/webdriver/remote.rb +15 -13
  97. data/lib/selenium/webdriver/safari/driver.rb +3 -31
  98. data/lib/selenium/webdriver/safari/{bridge.rb → features.rb} +3 -3
  99. data/lib/selenium/webdriver/safari/options.rb +10 -29
  100. data/lib/selenium/webdriver/safari/service.rb +4 -8
  101. data/lib/selenium/webdriver/safari.rb +17 -9
  102. data/lib/selenium/webdriver/support/block_event_listener.rb +1 -1
  103. data/lib/selenium/webdriver/support/cdp/domain.rb.erb +63 -0
  104. data/lib/selenium/webdriver/support/cdp_client_generator.rb +108 -0
  105. data/lib/selenium/webdriver/support/color.rb +2 -2
  106. data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
  107. data/lib/selenium/webdriver/support/guards/guard.rb +89 -0
  108. data/lib/selenium/webdriver/{firefox/marionette/bridge.rb → support/guards/guard_condition.rb} +22 -19
  109. data/lib/selenium/webdriver/support/guards.rb +95 -0
  110. data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
  111. data/lib/selenium/webdriver/support/select.rb +3 -3
  112. data/lib/selenium/webdriver/support.rb +1 -0
  113. data/lib/selenium/webdriver/version.rb +1 -1
  114. data/lib/selenium/webdriver.rb +12 -12
  115. data/selenium-webdriver.gemspec +28 -12
  116. metadata +128 -69
  117. data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
  118. data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +0 -64
  119. data/lib/selenium/webdriver/common/keyboard.rb +0 -70
  120. data/lib/selenium/webdriver/common/mouse.rb +0 -89
  121. data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -78
  122. data/lib/selenium/webdriver/common/touch_screen.rb +0 -123
  123. data/lib/selenium/webdriver/common/w3c_action_builder.rb +0 -212
  124. data/lib/selenium/webdriver/edge/bridge.rb +0 -76
  125. data/lib/selenium/webdriver/firefox/binary.rb +0 -187
  126. data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
  127. data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
  128. data/lib/selenium/webdriver/firefox/launcher.rb +0 -111
  129. data/lib/selenium/webdriver/firefox/legacy/driver.rb +0 -83
  130. data/lib/selenium/webdriver/firefox/marionette/driver.rb +0 -90
  131. data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
  132. data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
  133. data/lib/selenium/webdriver/remote/oss/bridge.rb +0 -594
  134. data/lib/selenium/webdriver/remote/oss/commands.rb +0 -223
  135. data/lib/selenium/webdriver/remote/w3c/bridge.rb +0 -605
  136. data/lib/selenium/webdriver/remote/w3c/capabilities.rb +0 -310
  137. data/lib/selenium/webdriver/remote/w3c/commands.rb +0 -157
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c9f40e154da198fff9e277f0613042c22fff6c98
4
- data.tar.gz: 33cc734e78b08e66c00a4c73f51c635d97c86fe6
2
+ SHA256:
3
+ metadata.gz: 7038d1d04e32c0eab2f4081b63161c315afcec139a1d2b45109e41852792f9b5
4
+ data.tar.gz: 5208af4b04d474558411a77a25c7150a1274a9123f4ceb3d50a4db7cd5656c2e
5
5
  SHA512:
6
- metadata.gz: b40eb2e74a284b21ee31924f7cf20b878c7ab6ebcfe7848b21ad163165c80467c9d3a6fa6252ca74680b82db7186e8c1b73a2ac5f4d37501b0dfa16763ec19b9
7
- data.tar.gz: bc9e9e0128888f3efe33f59160b677cc88655bf986877c534053adf915f3b39a78ff1d88e9b2d80753c1aba49af92f1796bb4f774ca68114027594813cc26ad3
6
+ metadata.gz: 1896dab6cb8b33ffe30a042829f118526709c2e45e933ad299e4370ab2a1f97263fda23183fc0e7ccce34ee2b1e131427b98919c573fd1c192d681cfc05fc740
7
+ data.tar.gz: 95da54a1ad17e54cdb08689c9fc148993b8e405a86319f8ed8ca4b49e00935de5182ea28e67a4987c7eb7671ffc9d4467062bf51fe0ae2c1fd798c317b765f1c
data/CHANGES CHANGED
@@ -1,3 +1,349 @@
1
+ 4.0.3 (2021-10-20)
2
+ =========================
3
+
4
+ Firefox:
5
+ * Fixed bug avoiding camel casing prefs (#9944 thanks @glaszig)
6
+
7
+ Ruby:
8
+ * Fixed bug in Select class for finding by index (#9945)
9
+
10
+ Remote:
11
+ * Fixed bug preventing sending keys with an empty value
12
+
13
+ 4.0.2 (2021-10-19)
14
+ =========================
15
+
16
+ Server:
17
+ * Fixed bug in new download code.
18
+
19
+ 4.0.1 (2021-10-19)
20
+ =========================
21
+
22
+ Server:
23
+ * Fixed download by pointing to new storage location.
24
+ - Only supports Selenium 4 versions
25
+ * Added default value for Server::get and Server::download to use the latest server version
26
+
27
+ 4.0.0 (2021-10-13)
28
+ =========================
29
+
30
+ Ruby:
31
+ * Updated minimum required Ruby version to 2.6
32
+ * Updated minimum required rexml gem version due to vulnerability
33
+
34
+ Chrome:
35
+ * Added default values for Network Conditions so no longer need to specify everything
36
+
37
+ Firefox:
38
+ * Fixed bug where Firefox prefs were converting snake case to camel case
39
+
40
+ 4.0.0.rc3 (2021-10-08)
41
+ =========================
42
+
43
+ Ruby:
44
+ * Added support for getting timeout values from the driver
45
+
46
+ 4.0.0.rc2 (2021-09-30)
47
+ =========================
48
+
49
+ DevTools:
50
+ * Released selenium-devtools 0.93.0 (2021-09-01)
51
+ - adds CDP version 93
52
+ - removes CDP version 91
53
+ * Released selenium-devtools 0.94.0 (2021-09-22)
54
+ - adds CDP version 94
55
+ - removes CDP version 92
56
+ * Added support for mutating responses in network interception
57
+
58
+ Ruby:
59
+ * Implemented Options#add_option to work for vendor extension capabilities
60
+ * Fixed bug for requiring uri (#9825 thanks @flanger001)
61
+ * Moved New Window functionality to TargetLocator#new_window to be used with Driver#switch_to
62
+ * Deprecated using Manager#new_window
63
+ * Changed order of logging output (#9850)
64
+ * Added support for web_socket_url capability
65
+
66
+ Chromium:
67
+ * Implemented casting functionality
68
+ * Implemented ability to launch chromium app
69
+ * Implemented support for specifying permissions
70
+ * Added support for Chrome-specific Android functionality with #enable_android
71
+
72
+ Firefox:
73
+ * Implemented context functionality
74
+ * Added support for Firefox-specific Android functionality with #enable_android
75
+
76
+ Remote:
77
+ * Added support for file detector to install Firefox addons from client machine
78
+
79
+ 4.0.0.rc1 (2021-09-01)
80
+ =========================
81
+
82
+ DevTools:
83
+ * Released selenium-devtools 0.92.0 (2021-08-21) which:
84
+ - adds CDP versions 92
85
+ - removes CDP versions 88, 89, 90
86
+
87
+ IE:
88
+ * Added options for running Microsoft Edge in IE mode with IE Driver
89
+
90
+ Remote:
91
+ * Added default file detector for remote driver
92
+
93
+ Ruby:
94
+ * Fixed bug for getting valid capability that has not been set
95
+ * Fixed bug preventing loading of ServerError class
96
+
97
+ 4.0.0.beta4 (2021-06-07)
98
+ =========================
99
+
100
+ Chrome:
101
+ * Fixed bug with camel casing of localState object
102
+
103
+ Firefox:
104
+ * Added support for Full Page Screenshots
105
+
106
+ Remote:
107
+ * Added support for #execute_cdp on Chrome and Edge
108
+
109
+ Ruby:
110
+ * Changed capabilities to use alwaysMatch instead of firstMatch by default
111
+ * Fixed bug preventing Options classes from handling Proxy instances
112
+
113
+ 4.0.0.beta3 (2021-04-13)
114
+ =========================
115
+
116
+ Chrome:
117
+ * Fixed a regression with prefs hash keys being converted to camelCase.
118
+ * Fixed an issue when passing Profile object to Options would fail.
119
+
120
+ DevTools:
121
+ * Released selenium-devtools 0.91.0 which:
122
+ - adds CDP versions 90 and 91
123
+ - removes CDP versions 86 and 87
124
+
125
+ Remote:
126
+ * Added support for setting alwaysMatch/firstMatch capabilities per W3C
127
+ WebDriver specification. It's done using the following methods where
128
+ `caps` is either a Ruby hash with desired capabilities or an instance
129
+ of Remote::Capabilities:
130
+ * Selenium::WebDriver::Remote::Capabilities.always_match(caps)
131
+ * Selenium::WebDriver::Remote::Capabilities.first_match(caps)
132
+ * Added support for Driver#save_print_page.
133
+ * Fixed an issue with Driver#print_page.
134
+ * Added support for setting timeouts capabilities in Remote::Capabilities
135
+ per W3C WebDriver specification.
136
+ * Added support for Element#aria_role which returns WAI-ARIA role of the element.
137
+ * Added support for Element#accessible name which returns WAI-ARIA label of the element.
138
+ * Added support for using DevTools version provided by Grid instead of
139
+ calculating it manually
140
+
141
+ Ruby:
142
+ * Remove JRuby-specific socket poller. Note that this requires JRuby 9.2.8.0+.
143
+
144
+ 4.0.0.beta2 (2021-03-16)
145
+ =========================
146
+
147
+ DevTools:
148
+ * Separated out DevTools methods into selenium-devtools gem to better manage versioning
149
+ * Updated supported versions to 85-89
150
+ * Add support for intercepting browser requests
151
+
152
+ Firefox:
153
+ * Add support for using DevTools commands with Firefox Nightly
154
+
155
+ Remote:
156
+ * Provide access to browser specific driver extensions as appropriate for designated browser
157
+ * Add support for using DevTools commands via Grid
158
+
159
+ Ruby:
160
+ * Spec Guard implementation moved into lib directory for other projects to use
161
+ * Implemented `Element#dom_attribute` to obtain attribute value as defined by w3c specification
162
+ * Implemented `Options#eq?`
163
+ * Allow Options subclass instances to be created from class methods in superclass
164
+
165
+ Safari:
166
+ * Fix bug that prevented usage of Safari Technology Preview
167
+
168
+ 4.0.0.beta1 (2021-02-15)
169
+ =========================
170
+
171
+ DevTools:
172
+ * Updated supported versions to 85-88
173
+
174
+ Edge:
175
+ * Removed support for legacy Edge HTML
176
+
177
+ Firefox:
178
+ * Fixed support for default profile settings
179
+ * Added support for Devtools for Firefox v87+
180
+
181
+ Safari:
182
+ * Removed default platformName specification so it works with Grid
183
+
184
+ Ruby:
185
+ * Added support for httpOnly attribute in Cookies
186
+ * Implemented `#print_page` method (thanks @raju249)
187
+ * Fixed support for missing libraries in Ruby 3.0 (thanks @znz)
188
+ * Deprecated `HTTP::Persistent` class
189
+ * Fixed support for accessors in options classes
190
+ * Added support for status endpoint for all browsers
191
+ * Fix support for Browser, Driver, and Performance Logging in Chrome and Edge
192
+
193
+ 4.0.0.alpha7 (2020-11-10)
194
+ =========================
195
+
196
+ Chrome:
197
+ * Fixed a link to download ChromeDriver when it's not found (thanks @masakazutakewaka).
198
+ * Fixed an issue when passing instance of Profile to an Options in capabilities
199
+ (thanks @masakazutakewaka).
200
+
201
+ DevTools:
202
+ * Added support for multiple version of CDP. Currently supported versions are
203
+ 84-87. The proper version is automatically selected when the browser is started
204
+ based on its version. The implementation is Chromium-based and is confirmed
205
+ to work in Chrome and Edge at least.
206
+ * Added support for basic authentication (see HasAuthentication).
207
+ * Added support for listening to JavaScript console messages (see HasLogEvents).
208
+ * Added support for listening to JavaScript exceptions (see HasLogEvents).
209
+ * Added support for listening to DOM mutations (see HasLogEvents).
210
+
211
+ Edge:
212
+ * Switched default Edge implementation to Chromium-based. To use older versions
213
+ of Edge, pass :edge_html when initializing the driver.
214
+
215
+ Firefox:
216
+ * Fixed an issue whereby using the new capabilities structure in local drivers
217
+ would cause the W3C check to complain that `browser_name` was an invalid
218
+ capability key name (thanks @luke-hill)
219
+
220
+ Ruby:
221
+ * Added support for taking screenshots of individual elements using Element#screenshot
222
+ (thanks @johndouthat).
223
+ * Fixed deprecation message of using Net::HTTP::Proxy (thanks @masakazutakewaka).
224
+ * Fixed false negative detection of Linux on WSL2 (thanks @snsten).
225
+ * Support ChildProcess 4.x versions (thanks @boutil).
226
+
227
+ Safari:
228
+ * Fixed browser name in capabilities for Safari Technology Preview.
229
+
230
+ 4.0.0.alpha6 (2020-05-28)
231
+ =========================
232
+
233
+ Chrome:
234
+ * Added DevTools classes and methods generated from the CDP specification.
235
+ It currently supports commands and events and provides Rubyish API:
236
+ driver.devtools.page.navigate(url: 'http://google.com')
237
+ driver.devtools.console.clear_messages
238
+ driver.devtools.page.enable
239
+ driver.devtools.page.on(:load_event_fired) do |params|
240
+ puts("Page loaded in #{params['timestamp']}")
241
+ end
242
+ Check https://chromedevtools.github.io/devtools-protocol/ for more information
243
+ about possible commands and events. Please note that this API is considered
244
+ to be experimental and may change any time before stable 4.0 release.
245
+ * Fixed an issue when passing :prompt_for_download (or similar snake_cased
246
+ symbols) in Options#prefs would be ignored by Chrome because Selenium
247
+ would internally convert it to camelCased format (:promptForDownload).
248
+ Now :prefs are left intact.
249
+
250
+ Edge:
251
+ * Fixed an issue when Driver#execute_cdp would not work for Chromium-based
252
+ Edge browser.
253
+
254
+ Ruby:
255
+ * Deprecated passing :desired_capabilities and :options to driver initialization
256
+ in favor of :capabilities. They now can be combined in an array to make
257
+ custom capabilities requirements:
258
+ caps = Selenium::WebDriver::Remote::Capabilities.chrome
259
+ opts = Selenium::WebDriver::Chrome::Options.new
260
+ Selenium::WebDriver.for(:remote, capabilities: :chrome)
261
+ Selenium::WebDriver.for(:remote, capabilities: caps)
262
+ Selenium::WebDriver.for(:remote, capabilities: opts)
263
+ Selenium::WebDriver.for(:remote, capabilities: [caps, opts])
264
+ * Deprecated passing Hash to :capabilities in favor of Remote::Capabilities object.
265
+ * Updated minimum require Ruby version to 2.5.
266
+ * Improved keyword arguments handling to avoid warnings in Ruby 2.7.
267
+
268
+ 4.0.0.alpha5 (2020-03-18)
269
+ =========================
270
+
271
+ The release is just to synchronize version with other bindings and does not
272
+ include any changes.
273
+
274
+ 4.0.0.alpha4 (2020-01-09)
275
+ =========================
276
+
277
+ Ruby:
278
+ * Added initial support for relative locators, which allow to find elements
279
+ above/below/left/right/near another element. For example, you can find all
280
+ the cells in a table to the right of your starting cell:
281
+ start_cell = driver.find_element(css: 'td')
282
+ right_cells = driver.find_elements(relative: {tag_name: 'td', right: start_cell})
283
+ The documentation is still lacking so refer to examples in df6be2e962.
284
+ * Added ability to silence certain logger messages by using it's identifiers:
285
+ Selenium::WebDriver.logger.ignore(:driver_path)
286
+ * Added new dependency: websocket. It's used for communicating with Chrome DevTools.
287
+ * Loosened childprocess dependency to allow using version 2.0+.
288
+ * Loosened rubyzip dependency to allow using version 2.0+.
289
+ * Fixed Errno::EACCES error on Linux DeX and similar distributes
290
+
291
+ Chrome:
292
+ * Added initial support for communicating with Chrome DevTools. The implementation
293
+ is very basic and lacks CDP domains, events and types - those will be added
294
+ in future releases. Still, it allows to execute simple commands to DevTools:
295
+ driver.devtools.send('Page.navigate', {url: 'https://google.com'})
296
+
297
+ 4.0.0.alpha3 (2019-07-08)
298
+ =========================
299
+
300
+ Ruby:
301
+ * All documented driver capabilities supported in respective browser Options class by constructor and accessor
302
+ * Driver constructor :options and :desired_capabilities generate the same capabilities for local and remote execution
303
+ * Deprecated :options as keyword for initializing browser Options classes
304
+
305
+ Chrome:
306
+ * Add support for browser logging with latest versions of chromedriver
307
+
308
+ Edge:
309
+ * Add support for Chromium based implementation
310
+
311
+ 4.0.0.alpha2 (2019-05-02)
312
+ =========================
313
+
314
+ Ruby:
315
+ * Fixed an issue with previous alpha release which lead to removed files
316
+ being packaged inside the gem
317
+
318
+ 4.0.0.alpha1 (2019-05-01)
319
+ =========================
320
+
321
+ Ruby:
322
+ * Removed Mouse and Keyboard as their implementations are not compliant to WebDriver specification
323
+ * Removed TouchActionBuilder as its implementation is not compliant to WebDriver specification
324
+ * Change ActionBuilder to be fully compliant to WebDriver specification
325
+ * Change Manager to be fully compliant to WebDriver specification
326
+ * Removed all deprecated errors that are not compliant to WebDriver specification
327
+ * Update minimum required Ruby version to 2.4
328
+ * Changed capabilities to use only those that are compliant to WebDriver specification
329
+ * Removed deprecated timeout setter on default HTTP client
330
+ * Removed deprecated Remote::W3C::Capabilities
331
+ * Fixed an issue when services are not shutdown properly
332
+
333
+ Chrome:
334
+ * Removed support for OSS mode - use W3C mode instead by using
335
+ Selenium::WebDriver::Chrome::Options.new(options: {w3c: true})
336
+
337
+ PhantomJS:
338
+ * Removed support for PhantomJS driver
339
+
340
+ Firefox:
341
+ * Removed support for legacy Firefox driver - use GeckoDriver instead
342
+ * Removed deprecated outdated capabilities
343
+ * Fixed an issue when passing :profile string to Firefox::Options.new would
344
+ result in NoMethodError. Now it will find a profile with such name on your
345
+ system and use it accordingly (issue #7119)
346
+
1
347
  3.142.7 (2019-12-27)
2
348
  ====================
3
349
 
@@ -30,7 +376,6 @@ Firefox:
30
376
  * Fixed a regression when Firefox binary path was not sent to GeckoDriver
31
377
  by default and browser could not be located (issue #7219)
32
378
 
33
-
34
379
  3.142.2 (2019-05-11)
35
380
  ====================
36
381
 
@@ -581,11 +926,11 @@ Ruby:
581
926
  * Fix bug in auto detection of drivers which allowed selection of non-executable binaries
582
927
 
583
928
  W3C:
584
- * Implement #cookie_named and #delete_all_cookies methods (thanks lmtierney)
585
- * Implement element #property method (thanks lmtierney)
929
+ * Implement #cookie_named and #delete_all_cookies methods (thanks lmtierney)
930
+ * Implement element #property method (thanks lmtierney)
586
931
 
587
932
  Chrome:
588
- * Fix bug in switches (thanks danvine)
933
+ * Fix bug in switches (thanks danvine)
589
934
 
590
935
  3.0.1 (2016-11-06)
591
936
  ===================
@@ -607,7 +952,7 @@ Ruby:
607
952
  * Add support for latest driver options
608
953
  * Add support for :port parameter for launching driver
609
954
  * Add support for :service_args parameter for driver command line switches
610
- * Improve reliability by increasing service shutdown timeout (#2815; thanks John Barbuto )
955
+ * Improve reliability by increasing service shutdown timeout (#2815; thanks John Barbuto )
611
956
 
612
957
  Firefox:
613
958
  * Add support for :firefox_options in geckodriver
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  source 'https://rubygems.org'
4
- gemspec
4
+ Dir["#{__dir__}/*.gemspec"].each do |spec|
5
+ gemspec name: File.basename(spec, '.gemspec')
6
+ end
data/LICENSE CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright 2019 Software Freedom Conservancy (SFC)
190
+ Copyright 2021 Software Freedom Conservancy (SFC)
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
data/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ Copyright 2011-2021 Software Freedom Conservancy
2
+ Copyright 2004-2011 Selenium committers
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # selenium-webdriver
2
2
 
3
- This gem provides Ruby bindings for WebDriver
4
- and has been tested to work on MRI (2.0 through 2.2),
3
+ This gem provides Ruby bindings for Selenium and supports MRI >= 2.6
5
4
 
6
5
  ## Install
7
6
 
@@ -9,14 +8,14 @@ and has been tested to work on MRI (2.0 through 2.2),
9
8
 
10
9
  ## Links
11
10
 
12
- * http://rubygems.org/gems/selenium-webdriver
13
- * http://seleniumhq.github.io/selenium/docs/api/rb/index.html
11
+ * https://rubygems.org/gems/selenium-webdriver
12
+ * https://www.selenium.dev/selenium/docs/api/rb/index.html
14
13
  * https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings
15
14
  * https://github.com/SeleniumHQ/selenium/issues
16
15
 
17
16
  ## License
18
17
 
19
- Copyright 2009-2018 Software Freedom Conservancy
18
+ Copyright 2009-2021 Software Freedom Conservancy
20
19
 
21
20
  Licensed to the Software Freedom Conservancy (SFC) under one
22
21
  or more contributor license agreements. See the NOTICE file
@@ -57,47 +57,41 @@ module Selenium
57
57
 
58
58
  CL_RESET = WebDriver::Platform.windows? ? '' : "\r\e[0K"
59
59
 
60
- def self.get(required_version, opts = {})
61
- new(download(required_version), opts)
62
- end
60
+ class << self
61
+ #
62
+ # Download the given version of the selenium-server jar and return instance
63
+ #
64
+ # @param [String, Symbol] required_version X.Y.Z defaults to ':latest'
65
+ # @param [Hash] opts
66
+ # @return [Selenium::Server]
67
+ #
63
68
 
64
- #
65
- # Download the given version of the selenium-server-standalone jar.
66
- #
69
+ def get(required_version = :latest, opts = {})
70
+ new(download(required_version), opts)
71
+ end
67
72
 
68
- class << self
69
- def download(required_version)
73
+ #
74
+ # Download the given version of the selenium-server jar and return location
75
+ #
76
+ # @param [String, Symbol] required_version X.Y.Z defaults to ':latest'
77
+ # @return [String] location of downloaded file
78
+ #
79
+
80
+ def download(required_version = :latest)
70
81
  required_version = latest if required_version == :latest
71
- download_file_name = "selenium-server-standalone-#{required_version}.jar"
82
+ download_file_name = "selenium-server-#{required_version}.jar"
72
83
 
73
84
  return download_file_name if File.exist? download_file_name
74
85
 
75
86
  begin
76
- File.open(download_file_name, 'wb') do |destination|
77
- net_http.start('selenium-release.storage.googleapis.com') do |http|
78
- resp = http.request_get("/#{required_version[/(\d+\.\d+)\./, 1]}/#{download_file_name}") do |response|
79
- total = response.content_length
80
- progress = 0
81
- segment_count = 0
82
-
83
- response.read_body do |segment|
84
- progress += segment.length
85
- segment_count += 1
87
+ server = 'https://github.com/seleniumhq/selenium/releases/download'
88
+ released = Net::HTTP.get_response(URI.parse("#{server}/selenium-#{required_version}/#{download_file_name}"))
89
+ redirected = URI.parse released.header['location']
86
90
 
87
- if (segment_count % 15).zero?
88
- percent = (progress.to_f / total.to_f) * 100
89
- print "#{CL_RESET}Downloading #{download_file_name}: #{percent.to_i}% (#{progress} / #{total})"
90
- segment_count = 0
91
- end
92
-
93
- destination.write(segment)
94
- end
95
- end
96
-
97
- raise Error, "#{resp.code} for #{download_file_name}" unless resp.is_a? Net::HTTPSuccess
98
- end
91
+ File.open(download_file_name, 'wb') do |destination|
92
+ download_server(redirected, destination)
99
93
  end
100
- rescue
94
+ rescue StandardError
101
95
  FileUtils.rm download_file_name if File.exist? download_file_name
102
96
  raise
103
97
  end
@@ -106,57 +100,67 @@ module Selenium
106
100
  end
107
101
 
108
102
  #
109
- # Ask Google Code what the latest selenium-server-standalone version is.
103
+ # Ask GitHub what the latest selenium-server version is.
110
104
  #
111
105
 
112
106
  def latest
113
- require 'rexml/document'
114
- net_http.start('selenium-release.storage.googleapis.com') do |http|
115
- versions = REXML::Document.new(http.get('/').body).root.get_elements('//Contents/Key').map do |e|
116
- e.text[/selenium-server-standalone-(\d+\.\d+\.\d+)\.jar/, 1]
107
+ @latest ||= begin
108
+ net_http_start('api.github.com') do |http|
109
+ json = http.get('/repos/seleniumhq/selenium/releases').body
110
+ all_assets = JSON.parse(json).map { |release| release['assets'] }.flatten
111
+ server_assets = all_assets.map { |asset| asset['name'][/selenium-server-(\d+\.\d+\.\d+)\.jar/, 1] }.compact
112
+ server_assets.map { |version| Gem::Version.new(version) }.max.version
117
113
  end
118
-
119
- versions.compact.map { |version| Gem::Version.new(version) }.max.version
120
114
  end
121
115
  end
122
116
 
123
- def net_http
124
- http_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
117
+ # @api private
125
118
 
119
+ def net_http_start(address, &block)
120
+ http_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
126
121
  if http_proxy
127
122
  http_proxy = "http://#{http_proxy}" unless http_proxy.start_with?('http://')
128
123
  uri = URI.parse(http_proxy)
129
124
 
130
- Net::HTTP::Proxy(uri.host, uri.port)
125
+ Net::HTTP.start(address, nil, uri.host, uri.port, &block)
131
126
  else
132
- Net::HTTP
127
+ Net::HTTP.start(address, use_ssl: true, &block)
133
128
  end
134
129
  end
135
- end
136
-
137
- #
138
- # The server port
139
- #
140
-
141
- attr_accessor :port
142
-
143
- #
144
- # The server timeout
145
- #
146
130
 
147
- attr_accessor :timeout
131
+ def download_server(uri, destination)
132
+ net_http_start('github-releases.githubusercontent.com') do |http|
133
+ request = Net::HTTP::Get.new uri
134
+ resp = http.request(request) do |response|
135
+ total = response.content_length
136
+ progress = 0
137
+ segment_count = 0
138
+
139
+ response.read_body do |segment|
140
+ progress += segment.length
141
+ segment_count += 1
142
+
143
+ if (segment_count % 15).zero?
144
+ percent = progress.fdiv(total) * 100
145
+ print "#{CL_RESET}Downloading #{destination.path}: #{percent.to_i}% (#{progress} / #{total})"
146
+ segment_count = 0
147
+ end
148
148
 
149
- #
150
- # Whether to launch the server in the background
151
- #
149
+ destination.write(segment)
150
+ end
151
+ end
152
152
 
153
- attr_accessor :background
153
+ raise Error, "#{resp.code} for #{destination.path}" unless resp.is_a? Net::HTTPSuccess
154
+ end
155
+ end
156
+ end
154
157
 
155
158
  #
156
- # Path to log file, or 'true' for stdout.
159
+ # The Mode of the Server
160
+ # :standalone, #hub, #node
157
161
  #
158
162
 
159
- attr_accessor :log
163
+ attr_accessor :role, :port, :timeout, :background, :log
160
164
 
161
165
  #
162
166
  # @param [String] jar Path to the server jar.
@@ -175,11 +179,12 @@ module Selenium
175
179
 
176
180
  @jar = jar
177
181
  @host = '127.0.0.1'
182
+ @role = opts.fetch(:role, 'standalone')
178
183
  @port = opts.fetch(:port, 4444)
179
184
  @timeout = opts.fetch(:timeout, 30)
180
185
  @background = opts.fetch(:background, false)
181
186
  @log = opts[:log]
182
-
187
+ @log_file = nil
183
188
  @additional_args = []
184
189
  end
185
190
 
@@ -234,7 +239,8 @@ module Selenium
234
239
  @process ||= begin
235
240
  # extract any additional_args that start with -D as options
236
241
  properties = @additional_args.dup - @additional_args.delete_if { |arg| arg[/^-D/] }
237
- server_command = ['java'] + properties + ['-jar', @jar, '-port', @port.to_s] + @additional_args
242
+ args = ['-jar', @jar, @role, '--port', @port.to_s]
243
+ server_command = ['java'] + properties + args + @additional_args
238
244
  cp = ChildProcess.build(*server_command)
239
245
  WebDriver.logger.debug("Executing Process #{server_command}")
240
246