selenium-webdriver 3.12.0 → 3.142.7
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.
- checksums.yaml +4 -4
- data/CHANGES +236 -0
- data/Gemfile +2 -0
- data/LICENSE +1 -1
- data/lib/selenium-webdriver.rb +2 -0
- data/lib/selenium/server.rb +13 -9
- data/lib/selenium/webdriver.rb +3 -1
- data/lib/selenium/webdriver/atoms.rb +20 -1
- data/lib/selenium/webdriver/atoms/getAttribute.js +6 -7
- data/lib/selenium/webdriver/atoms/isDisplayed.js +102 -0
- data/lib/selenium/webdriver/chrome.rb +10 -4
- data/lib/selenium/webdriver/chrome/bridge.rb +27 -2
- data/lib/selenium/webdriver/chrome/driver.rb +33 -21
- data/lib/selenium/webdriver/chrome/options.rb +13 -6
- data/lib/selenium/webdriver/chrome/profile.rb +6 -5
- data/lib/selenium/webdriver/chrome/service.rb +13 -13
- data/lib/selenium/webdriver/common.rb +6 -2
- data/lib/selenium/webdriver/common/action_builder.rb +3 -1
- data/lib/selenium/webdriver/common/alert.rb +2 -0
- data/lib/selenium/webdriver/common/bridge_helper.rb +8 -5
- data/lib/selenium/webdriver/common/driver.rb +22 -7
- data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +45 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +3 -3
- data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +3 -1
- data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +3 -1
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +2 -0
- data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +3 -3
- data/lib/selenium/webdriver/common/element.rb +4 -2
- data/lib/selenium/webdriver/common/error.rb +75 -18
- data/lib/selenium/webdriver/common/file_reaper.rb +3 -3
- data/lib/selenium/webdriver/common/html5/local_storage.rb +2 -0
- data/lib/selenium/webdriver/common/html5/session_storage.rb +2 -0
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +4 -1
- data/lib/selenium/webdriver/common/interactions/input_device.rb +4 -1
- data/lib/selenium/webdriver/common/interactions/interaction.rb +3 -0
- data/lib/selenium/webdriver/common/interactions/interactions.rb +3 -1
- data/lib/selenium/webdriver/common/interactions/key_actions.rb +2 -0
- data/lib/selenium/webdriver/common/interactions/key_input.rb +4 -0
- data/lib/selenium/webdriver/common/interactions/none_input.rb +3 -0
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +14 -4
- data/lib/selenium/webdriver/common/interactions/pointer_input.rb +7 -0
- data/lib/selenium/webdriver/common/keyboard.rb +4 -1
- data/lib/selenium/webdriver/common/keys.rb +3 -0
- data/lib/selenium/webdriver/common/log_entry.rb +4 -2
- data/lib/selenium/webdriver/common/logger.rb +15 -40
- data/lib/selenium/webdriver/common/logs.rb +2 -0
- data/lib/selenium/webdriver/common/manager.rb +177 -0
- data/lib/selenium/webdriver/common/mouse.rb +3 -0
- data/lib/selenium/webdriver/common/navigation.rb +2 -0
- data/lib/selenium/webdriver/common/options.rb +28 -126
- data/lib/selenium/webdriver/common/platform.rb +31 -30
- data/lib/selenium/webdriver/common/port_prober.rb +6 -17
- data/lib/selenium/webdriver/common/profile_helper.rb +2 -0
- data/lib/selenium/webdriver/common/proxy.rb +13 -5
- data/lib/selenium/webdriver/common/search_context.rb +6 -8
- data/lib/selenium/webdriver/common/service.rb +87 -29
- data/lib/selenium/webdriver/common/socket_lock.rb +10 -3
- data/lib/selenium/webdriver/common/socket_poller.rb +26 -17
- data/lib/selenium/webdriver/common/target_locator.rb +6 -4
- data/lib/selenium/webdriver/common/timeouts.rb +2 -0
- data/lib/selenium/webdriver/common/touch_action_builder.rb +5 -6
- data/lib/selenium/webdriver/common/touch_screen.rb +4 -1
- data/lib/selenium/webdriver/common/w3c_action_builder.rb +3 -0
- data/lib/selenium/webdriver/common/{w3c_options.rb → w3c_manager.rb} +3 -1
- data/lib/selenium/webdriver/common/wait.rb +13 -5
- data/lib/selenium/webdriver/common/window.rb +2 -0
- data/lib/selenium/webdriver/common/zipper.rb +3 -3
- data/lib/selenium/webdriver/edge.rb +12 -5
- data/lib/selenium/webdriver/edge/bridge.rb +2 -0
- data/lib/selenium/webdriver/edge/driver.rb +6 -13
- data/lib/selenium/webdriver/edge/options.rb +80 -0
- data/lib/selenium/webdriver/edge/service.rb +12 -15
- data/lib/selenium/webdriver/firefox.rb +10 -4
- data/lib/selenium/webdriver/firefox/binary.rb +9 -8
- data/lib/selenium/webdriver/firefox/driver.rb +2 -0
- data/lib/selenium/webdriver/firefox/extension.rb +4 -4
- data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -1
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +3 -0
- data/lib/selenium/webdriver/firefox/legacy/driver.rb +7 -3
- data/lib/selenium/webdriver/firefox/marionette/bridge.rb +4 -2
- data/lib/selenium/webdriver/firefox/marionette/driver.rb +6 -12
- data/lib/selenium/webdriver/firefox/options.rb +22 -9
- data/lib/selenium/webdriver/firefox/profile.rb +7 -8
- data/lib/selenium/webdriver/firefox/profiles_ini.rb +3 -0
- data/lib/selenium/webdriver/firefox/service.rb +11 -22
- data/lib/selenium/webdriver/firefox/util.rb +2 -0
- data/lib/selenium/webdriver/ie.rb +10 -4
- data/lib/selenium/webdriver/ie/driver.rb +5 -11
- data/lib/selenium/webdriver/ie/options.rb +6 -4
- data/lib/selenium/webdriver/ie/service.rb +8 -12
- data/lib/selenium/webdriver/remote.rb +2 -0
- data/lib/selenium/webdriver/remote/bridge.rb +15 -10
- data/lib/selenium/webdriver/remote/capabilities.rb +28 -12
- data/lib/selenium/webdriver/remote/driver.rb +2 -0
- data/lib/selenium/webdriver/remote/http/common.rb +11 -4
- data/lib/selenium/webdriver/remote/http/curb.rb +4 -2
- data/lib/selenium/webdriver/remote/http/default.rb +31 -25
- data/lib/selenium/webdriver/remote/http/persistent.rb +3 -1
- data/lib/selenium/webdriver/remote/oss/bridge.rb +14 -6
- data/lib/selenium/webdriver/remote/oss/commands.rb +106 -104
- data/lib/selenium/webdriver/remote/response.rb +11 -3
- data/lib/selenium/webdriver/remote/server_error.rb +2 -0
- data/lib/selenium/webdriver/remote/w3c/bridge.rb +48 -16
- data/lib/selenium/webdriver/remote/w3c/capabilities.rb +38 -21
- data/lib/selenium/webdriver/remote/w3c/commands.rb +66 -57
- data/lib/selenium/webdriver/safari.rb +12 -4
- data/lib/selenium/webdriver/safari/bridge.rb +5 -3
- data/lib/selenium/webdriver/safari/driver.rb +19 -12
- data/lib/selenium/webdriver/safari/options.rb +60 -0
- data/lib/selenium/webdriver/safari/service.rb +6 -25
- data/lib/selenium/webdriver/support.rb +2 -0
- data/lib/selenium/webdriver/support/abstract_event_listener.rb +2 -0
- data/lib/selenium/webdriver/support/block_event_listener.rb +3 -1
- data/lib/selenium/webdriver/support/color.rb +11 -9
- data/lib/selenium/webdriver/support/escaper.rb +2 -0
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +3 -1
- data/lib/selenium/webdriver/support/select.rb +19 -18
- data/lib/selenium/webdriver/version.rb +3 -1
- data/selenium-webdriver.gemspec +15 -8
- metadata +95 -26
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
module Selenium
|
|
21
|
+
module WebDriver
|
|
22
|
+
module DriverExtensions
|
|
23
|
+
module DownloadsFiles
|
|
24
|
+
|
|
25
|
+
#
|
|
26
|
+
# Sets download path for Chromium.
|
|
27
|
+
#
|
|
28
|
+
# @param [String] path
|
|
29
|
+
#
|
|
30
|
+
|
|
31
|
+
def download_path=(path)
|
|
32
|
+
params = {
|
|
33
|
+
'cmd' => 'Page.setDownloadBehavior',
|
|
34
|
+
'params' => {
|
|
35
|
+
'behavior' => 'allow',
|
|
36
|
+
'downloadPath' => path
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
@bridge.send_command(params)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end # DownloadsFiles
|
|
43
|
+
end # DriverExtensions
|
|
44
|
+
end # WebDriver
|
|
45
|
+
end # Selenium
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -24,9 +26,7 @@ module Selenium
|
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def location=(loc)
|
|
27
|
-
unless loc.is_a?(Location)
|
|
28
|
-
raise TypeError, "expected #{Location}, got #{loc.inspect}:#{loc.class}"
|
|
29
|
-
end
|
|
29
|
+
raise TypeError, "expected #{Location}, got #{loc.inspect}:#{loc.class}" unless loc.is_a?(Location)
|
|
30
30
|
|
|
31
31
|
@bridge.set_location loc.latitude, loc.longitude, loc.altitude
|
|
32
32
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -48,7 +50,7 @@ module Selenium
|
|
|
48
50
|
end
|
|
49
51
|
|
|
50
52
|
def valid_type?(type)
|
|
51
|
-
type_to_values.
|
|
53
|
+
type_to_values.key? type
|
|
52
54
|
end
|
|
53
55
|
end # HasNetworkConnection
|
|
54
56
|
end # DriverExtensions
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -23,7 +25,7 @@ module Selenium
|
|
|
23
25
|
|
|
24
26
|
module DriverExtensions
|
|
25
27
|
module Rotatable
|
|
26
|
-
ORIENTATIONS = [
|
|
28
|
+
ORIENTATIONS = %i[landscape portrait].freeze
|
|
27
29
|
|
|
28
30
|
#
|
|
29
31
|
# Change the screen orientation
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -48,9 +50,7 @@ module Selenium
|
|
|
48
50
|
#
|
|
49
51
|
|
|
50
52
|
def file_detector=(detector)
|
|
51
|
-
unless detector.nil? || detector.respond_to?(:call)
|
|
52
|
-
raise ArgumentError, 'detector must respond to #call'
|
|
53
|
-
end
|
|
53
|
+
raise ArgumentError, 'detector must respond to #call' unless detector.nil? || detector.respond_to?(:call)
|
|
54
54
|
|
|
55
55
|
bridge.file_detector = detector
|
|
56
56
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -32,7 +34,7 @@ module Selenium
|
|
|
32
34
|
end
|
|
33
35
|
|
|
34
36
|
def inspect
|
|
35
|
-
format '
|
|
37
|
+
format '#<%<class>s:0x%<hash>x id=%<id>s>', class: self.class, hash: hash * 2, id: @id.inspect
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
def ==(other)
|
|
@@ -196,7 +198,7 @@ module Selenium
|
|
|
196
198
|
#
|
|
197
199
|
|
|
198
200
|
def displayed?
|
|
199
|
-
bridge.element_displayed?
|
|
201
|
+
bridge.element_displayed? self
|
|
200
202
|
end
|
|
201
203
|
|
|
202
204
|
#
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
|
|
18
20
|
module Selenium
|
|
19
21
|
module WebDriver
|
|
20
|
-
module Error
|
|
22
|
+
module Error # rubocop:disable Metrics/ModuleLength
|
|
21
23
|
|
|
22
24
|
#
|
|
23
25
|
# Returns exception from code (Integer - OSS, String - W3C).
|
|
@@ -29,10 +31,10 @@ module Selenium
|
|
|
29
31
|
when nil, 0
|
|
30
32
|
nil
|
|
31
33
|
when Integer
|
|
32
|
-
ERRORS.fetch(code)
|
|
34
|
+
Object.const_get(ERRORS.fetch(code).to_s)
|
|
33
35
|
when String
|
|
34
36
|
klass_name = code.split(' ').map(&:capitalize).join.sub(/Error$/, '')
|
|
35
|
-
const_get("#{klass_name}Error")
|
|
37
|
+
const_get("#{klass_name}Error", false)
|
|
36
38
|
end
|
|
37
39
|
rescue KeyError, NameError
|
|
38
40
|
WebDriverError
|
|
@@ -210,6 +212,13 @@ module Selenium
|
|
|
210
212
|
|
|
211
213
|
class ElementNotInteractableError < WebDriverError; end
|
|
212
214
|
|
|
215
|
+
#
|
|
216
|
+
# A command could not be completed because TLS certificate is expired
|
|
217
|
+
# or invalid.
|
|
218
|
+
#
|
|
219
|
+
|
|
220
|
+
class InsecureCertificateError < WebDriverError; end
|
|
221
|
+
|
|
213
222
|
#
|
|
214
223
|
# The arguments passed to a command are either invalid or malformed.
|
|
215
224
|
#
|
|
@@ -263,29 +272,30 @@ module Selenium
|
|
|
263
272
|
class UnsupportedOperationError < WebDriverError; end
|
|
264
273
|
|
|
265
274
|
# Aliases for OSS dialect.
|
|
266
|
-
ScriptTimeoutError = ScriptTimeOutError
|
|
267
|
-
|
|
275
|
+
ScriptTimeoutError = Class.new(ScriptTimeOutError)
|
|
276
|
+
TimeoutError = Class.new(TimeOutError)
|
|
277
|
+
NoAlertOpenError = Class.new(NoAlertPresentError)
|
|
268
278
|
|
|
269
279
|
# Aliases for backwards compatibility.
|
|
270
|
-
ObsoleteElementError = StaleElementReferenceError
|
|
271
|
-
UnhandledError = UnknownError
|
|
272
|
-
UnexpectedJavascriptError = JavascriptError
|
|
273
|
-
ElementNotDisplayedError = ElementNotVisibleError
|
|
280
|
+
ObsoleteElementError = Class.new(StaleElementReferenceError)
|
|
281
|
+
UnhandledError = Class.new(UnknownError)
|
|
282
|
+
UnexpectedJavascriptError = Class.new(JavascriptError)
|
|
283
|
+
ElementNotDisplayedError = Class.new(ElementNotVisibleError)
|
|
274
284
|
|
|
275
285
|
#
|
|
276
286
|
# @api private
|
|
277
287
|
#
|
|
278
288
|
|
|
279
289
|
ERRORS = {
|
|
280
|
-
1
|
|
281
|
-
2
|
|
282
|
-
3
|
|
283
|
-
4
|
|
284
|
-
5
|
|
285
|
-
6
|
|
286
|
-
7
|
|
287
|
-
8
|
|
288
|
-
9
|
|
290
|
+
1 => IndexOutOfBoundsError,
|
|
291
|
+
2 => NoCollectionError,
|
|
292
|
+
3 => NoStringError,
|
|
293
|
+
4 => NoStringLengthError,
|
|
294
|
+
5 => NoStringWrapperError,
|
|
295
|
+
6 => NoSuchDriverError,
|
|
296
|
+
7 => NoSuchElementError,
|
|
297
|
+
8 => NoSuchFrameError,
|
|
298
|
+
9 => UnknownCommandError,
|
|
289
299
|
10 => StaleElementReferenceError,
|
|
290
300
|
11 => ElementNotVisibleError,
|
|
291
301
|
12 => InvalidElementStateError,
|
|
@@ -321,6 +331,53 @@ module Selenium
|
|
|
321
331
|
63 => UnableToCaptureScreenError
|
|
322
332
|
}.freeze
|
|
323
333
|
|
|
334
|
+
DEPRECATED_ERRORS = {
|
|
335
|
+
IndexOutOfBoundsError: nil,
|
|
336
|
+
NoCollectionError: nil,
|
|
337
|
+
NoStringError: nil,
|
|
338
|
+
NoStringLengthError: nil,
|
|
339
|
+
NoStringWrapperError: nil,
|
|
340
|
+
NoSuchDriverError: nil,
|
|
341
|
+
ElementNotVisibleError: ElementNotInteractableError,
|
|
342
|
+
InvalidElementStateError: ElementNotInteractableError,
|
|
343
|
+
ElementNotSelectableError: ElementNotInteractableError,
|
|
344
|
+
ExpectedError: nil,
|
|
345
|
+
NoSuchDocumentError: nil,
|
|
346
|
+
NoScriptResultError: nil,
|
|
347
|
+
XPathLookupError: InvalidSelectorError,
|
|
348
|
+
NoSuchCollectionError: nil,
|
|
349
|
+
UnhandledAlertError: UnexpectedAlertOpenError,
|
|
350
|
+
NoAlertPresentError: NoSuchAlertError,
|
|
351
|
+
NoAlertOpenError: NoSuchAlertError,
|
|
352
|
+
ScriptTimeOutError: ScriptTimeoutError,
|
|
353
|
+
InvalidElementCoordinatesError: nil,
|
|
354
|
+
IMENotAvailableError: nil,
|
|
355
|
+
IMEEngineActivationFailedError: nil,
|
|
356
|
+
InvalidXpathSelectorError: InvalidSelectorError,
|
|
357
|
+
InvalidXpathSelectorReturnTyperError: InvalidSelectorError,
|
|
358
|
+
TimeOutError: TimeoutError,
|
|
359
|
+
ObsoleteElementError: StaleElementReferenceError,
|
|
360
|
+
UnhandledError: UnknownError,
|
|
361
|
+
UnexpectedJavascriptError: JavascriptError,
|
|
362
|
+
ElementNotDisplayedError: ElementNotInteractableError
|
|
363
|
+
}.freeze
|
|
364
|
+
|
|
365
|
+
DEPRECATED_ERRORS.keys.each do |oss_error|
|
|
366
|
+
remove_const oss_error
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
def self.const_missing(const_name)
|
|
370
|
+
super unless DEPRECATED_ERRORS.key?(const_name)
|
|
371
|
+
if DEPRECATED_ERRORS[const_name]
|
|
372
|
+
WebDriver.logger.deprecate("Selenium::WebDriver::Error::#{const_name}",
|
|
373
|
+
"#{DEPRECATED_ERRORS[const_name]} (ensure the driver supports W3C WebDriver specification)")
|
|
374
|
+
DEPRECATED_ERRORS[const_name]
|
|
375
|
+
else
|
|
376
|
+
WebDriver.logger.deprecate("Selenium::WebDriver::Error::#{const_name}")
|
|
377
|
+
WebDriverError
|
|
378
|
+
end
|
|
379
|
+
end
|
|
380
|
+
|
|
324
381
|
end # Error
|
|
325
382
|
end # WebDriver
|
|
326
383
|
end # Selenium
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -41,9 +43,7 @@ module Selenium
|
|
|
41
43
|
def reap(file)
|
|
42
44
|
return unless reap?
|
|
43
45
|
|
|
44
|
-
unless tmp_files.include?(file)
|
|
45
|
-
raise Error::WebDriverError, "file not added for reaping: #{file.inspect}"
|
|
46
|
-
end
|
|
46
|
+
raise Error::WebDriverError, "file not added for reaping: #{file.inspect}" unless tmp_files.include?(file)
|
|
47
47
|
|
|
48
48
|
FileUtils.rm_rf tmp_files.delete(file)
|
|
49
49
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -30,6 +32,7 @@ module Selenium
|
|
|
30
32
|
def fetch(key)
|
|
31
33
|
return self[key] if key? key
|
|
32
34
|
return yield(key) if block_given?
|
|
35
|
+
|
|
33
36
|
raise KeyError, "missing key #{key.inspect}"
|
|
34
37
|
end
|
|
35
38
|
|
|
@@ -40,7 +43,7 @@ module Selenium
|
|
|
40
43
|
def each
|
|
41
44
|
return enum_for(:each) unless block_given?
|
|
42
45
|
|
|
43
|
-
keys.each do |k|
|
|
46
|
+
keys.each do |k|
|
|
44
47
|
yield k, self[k]
|
|
45
48
|
end
|
|
46
49
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -30,6 +32,7 @@ module Selenium
|
|
|
30
32
|
|
|
31
33
|
def add_action(action)
|
|
32
34
|
raise TypeError, "#{action.inspect} is not a valid action" unless action.class < Interaction
|
|
35
|
+
|
|
33
36
|
@actions << action
|
|
34
37
|
end
|
|
35
38
|
|
|
@@ -37,7 +40,7 @@ module Selenium
|
|
|
37
40
|
@actions.clear
|
|
38
41
|
end
|
|
39
42
|
|
|
40
|
-
def create_pause(duration =
|
|
43
|
+
def create_pause(duration = 0)
|
|
41
44
|
add_action(Pause.new(self, duration))
|
|
42
45
|
end
|
|
43
46
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -25,6 +27,7 @@ module Selenium
|
|
|
25
27
|
|
|
26
28
|
def initialize(source)
|
|
27
29
|
raise TypeError, "#{source.type} is not a valid input type" unless Interactions::SOURCE_TYPES.include? source.type
|
|
30
|
+
|
|
28
31
|
@source = source
|
|
29
32
|
end
|
|
30
33
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
4
|
# or more contributor license agreements. See the NOTICE file
|
|
3
5
|
# distributed with this work for additional information
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
16
|
# KIND, either express or implied. See the License for the
|
|
15
17
|
# specific language governing permissions and limitations
|
|
16
|
-
# under the License
|
|
18
|
+
# under the License.
|
|
17
19
|
|
|
18
20
|
module Selenium
|
|
19
21
|
module WebDriver
|