selenium-webdriver 3.141.0 → 3.142.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +125 -0
  3. data/Gemfile +2 -0
  4. data/LICENSE +1 -1
  5. data/lib/selenium-webdriver.rb +2 -0
  6. data/lib/selenium/server.rb +9 -7
  7. data/lib/selenium/webdriver.rb +3 -1
  8. data/lib/selenium/webdriver/atoms.rb +20 -1
  9. data/lib/selenium/webdriver/atoms/getAttribute.js +6 -7
  10. data/lib/selenium/webdriver/atoms/isDisplayed.js +60 -59
  11. data/lib/selenium/webdriver/chrome.rb +10 -4
  12. data/lib/selenium/webdriver/chrome/bridge.rb +5 -3
  13. data/lib/selenium/webdriver/chrome/driver.rb +10 -13
  14. data/lib/selenium/webdriver/chrome/options.rb +4 -4
  15. data/lib/selenium/webdriver/chrome/profile.rb +4 -3
  16. data/lib/selenium/webdriver/chrome/service.rb +13 -13
  17. data/lib/selenium/webdriver/common.rb +4 -2
  18. data/lib/selenium/webdriver/common/action_builder.rb +2 -0
  19. data/lib/selenium/webdriver/common/alert.rb +2 -0
  20. data/lib/selenium/webdriver/common/bridge_helper.rb +8 -5
  21. data/lib/selenium/webdriver/common/driver.rb +22 -7
  22. data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +2 -0
  23. data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +2 -0
  24. data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +2 -0
  25. data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +3 -3
  26. data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +2 -0
  27. data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +3 -1
  28. data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +2 -0
  29. data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +2 -0
  30. data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +2 -0
  31. data/lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb +2 -0
  32. data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +2 -0
  33. data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +3 -1
  34. data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +2 -0
  35. data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +3 -3
  36. data/lib/selenium/webdriver/common/element.rb +3 -1
  37. data/lib/selenium/webdriver/common/error.rb +74 -18
  38. data/lib/selenium/webdriver/common/file_reaper.rb +3 -3
  39. data/lib/selenium/webdriver/common/html5/local_storage.rb +2 -0
  40. data/lib/selenium/webdriver/common/html5/session_storage.rb +2 -0
  41. data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +4 -1
  42. data/lib/selenium/webdriver/common/interactions/input_device.rb +3 -0
  43. data/lib/selenium/webdriver/common/interactions/interaction.rb +3 -0
  44. data/lib/selenium/webdriver/common/interactions/interactions.rb +3 -1
  45. data/lib/selenium/webdriver/common/interactions/key_actions.rb +2 -0
  46. data/lib/selenium/webdriver/common/interactions/key_input.rb +4 -0
  47. data/lib/selenium/webdriver/common/interactions/none_input.rb +3 -0
  48. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +2 -0
  49. data/lib/selenium/webdriver/common/interactions/pointer_input.rb +7 -0
  50. data/lib/selenium/webdriver/common/keyboard.rb +4 -1
  51. data/lib/selenium/webdriver/common/keys.rb +3 -0
  52. data/lib/selenium/webdriver/common/log_entry.rb +4 -2
  53. data/lib/selenium/webdriver/common/logger.rb +15 -40
  54. data/lib/selenium/webdriver/common/logs.rb +2 -0
  55. data/lib/selenium/webdriver/common/{options.rb → manager.rb} +27 -1
  56. data/lib/selenium/webdriver/common/mouse.rb +3 -0
  57. data/lib/selenium/webdriver/common/navigation.rb +2 -0
  58. data/lib/selenium/webdriver/common/platform.rb +26 -30
  59. data/lib/selenium/webdriver/common/port_prober.rb +6 -19
  60. data/lib/selenium/webdriver/common/profile_helper.rb +2 -0
  61. data/lib/selenium/webdriver/common/proxy.rb +13 -5
  62. data/lib/selenium/webdriver/common/search_context.rb +6 -8
  63. data/lib/selenium/webdriver/common/service.rb +87 -29
  64. data/lib/selenium/webdriver/common/socket_lock.rb +10 -3
  65. data/lib/selenium/webdriver/common/socket_poller.rb +26 -18
  66. data/lib/selenium/webdriver/common/target_locator.rb +6 -4
  67. data/lib/selenium/webdriver/common/timeouts.rb +2 -0
  68. data/lib/selenium/webdriver/common/touch_action_builder.rb +5 -6
  69. data/lib/selenium/webdriver/common/touch_screen.rb +4 -1
  70. data/lib/selenium/webdriver/common/w3c_action_builder.rb +3 -0
  71. data/lib/selenium/webdriver/common/{w3c_options.rb → w3c_manager.rb} +3 -1
  72. data/lib/selenium/webdriver/common/wait.rb +13 -5
  73. data/lib/selenium/webdriver/common/window.rb +2 -0
  74. data/lib/selenium/webdriver/common/zipper.rb +3 -3
  75. data/lib/selenium/webdriver/edge.rb +11 -5
  76. data/lib/selenium/webdriver/edge/bridge.rb +2 -0
  77. data/lib/selenium/webdriver/edge/driver.rb +5 -12
  78. data/lib/selenium/webdriver/edge/options.rb +3 -0
  79. data/lib/selenium/webdriver/edge/service.rb +8 -12
  80. data/lib/selenium/webdriver/firefox.rb +10 -4
  81. data/lib/selenium/webdriver/firefox/binary.rb +7 -6
  82. data/lib/selenium/webdriver/firefox/bridge.rb +47 -0
  83. data/lib/selenium/webdriver/firefox/driver.rb +2 -0
  84. data/lib/selenium/webdriver/firefox/extension.rb +4 -4
  85. data/lib/selenium/webdriver/firefox/launcher.rb +3 -0
  86. data/lib/selenium/webdriver/firefox/legacy/driver.rb +7 -3
  87. data/lib/selenium/webdriver/firefox/marionette/bridge.rb +4 -2
  88. data/lib/selenium/webdriver/firefox/marionette/driver.rb +5 -11
  89. data/lib/selenium/webdriver/firefox/options.rb +20 -7
  90. data/lib/selenium/webdriver/firefox/profile.rb +7 -8
  91. data/lib/selenium/webdriver/firefox/profiles_ini.rb +3 -0
  92. data/lib/selenium/webdriver/firefox/service.rb +8 -19
  93. data/lib/selenium/webdriver/firefox/util.rb +2 -0
  94. data/lib/selenium/webdriver/ie.rb +10 -4
  95. data/lib/selenium/webdriver/ie/driver.rb +4 -10
  96. data/lib/selenium/webdriver/ie/options.rb +4 -2
  97. data/lib/selenium/webdriver/ie/service.rb +8 -12
  98. data/lib/selenium/webdriver/remote.rb +2 -0
  99. data/lib/selenium/webdriver/remote/bridge.rb +6 -4
  100. data/lib/selenium/webdriver/remote/capabilities.rb +23 -10
  101. data/lib/selenium/webdriver/remote/commands.rb +156 -0
  102. data/lib/selenium/webdriver/remote/driver.rb +2 -0
  103. data/lib/selenium/webdriver/remote/http/common.rb +11 -4
  104. data/lib/selenium/webdriver/remote/http/curb.rb +4 -2
  105. data/lib/selenium/webdriver/remote/http/default.rb +31 -25
  106. data/lib/selenium/webdriver/remote/http/persistent.rb +3 -1
  107. data/lib/selenium/webdriver/remote/oss/bridge.rb +5 -2
  108. data/lib/selenium/webdriver/remote/oss/commands.rb +106 -104
  109. data/lib/selenium/webdriver/remote/response.rb +11 -3
  110. data/lib/selenium/webdriver/remote/server_error.rb +2 -0
  111. data/lib/selenium/webdriver/remote/w3c/bridge.rb +28 -13
  112. data/lib/selenium/webdriver/remote/w3c/capabilities.rb +37 -21
  113. data/lib/selenium/webdriver/remote/w3c/commands.rb +61 -58
  114. data/lib/selenium/webdriver/safari.rb +11 -4
  115. data/lib/selenium/webdriver/safari/bridge.rb +5 -3
  116. data/lib/selenium/webdriver/safari/driver.rb +8 -10
  117. data/lib/selenium/webdriver/safari/options.rb +2 -0
  118. data/lib/selenium/webdriver/safari/service.rb +6 -25
  119. data/lib/selenium/webdriver/support.rb +2 -0
  120. data/lib/selenium/webdriver/support/abstract_event_listener.rb +2 -0
  121. data/lib/selenium/webdriver/support/block_event_listener.rb +3 -1
  122. data/lib/selenium/webdriver/support/color.rb +11 -9
  123. data/lib/selenium/webdriver/support/escaper.rb +2 -0
  124. data/lib/selenium/webdriver/support/event_firing_bridge.rb +3 -1
  125. data/lib/selenium/webdriver/support/select.rb +19 -18
  126. data/lib/selenium/webdriver/version.rb +3 -1
  127. data/selenium-webdriver.gemspec +14 -7
  128. metadata +89 -23
@@ -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
@@ -21,9 +23,9 @@ module Selenium
21
23
  module Bridge
22
24
 
23
25
  COMMANDS = {
24
- get_network_conditions: [:get, '/session/:session_id/chromium/network_conditions'.freeze],
25
- set_network_conditions: [:post, '/session/:session_id/chromium/network_conditions'.freeze],
26
- send_command: [:post, '/session/:session_id/goog/cdp/execute'.freeze]
26
+ get_network_conditions: [:get, 'session/:session_id/chromium/network_conditions'],
27
+ set_network_conditions: [:post, 'session/:session_id/chromium/network_conditions'],
28
+ send_command: [:post, 'session/:session_id/goog/cdp/execute']
27
29
  }.freeze
28
30
 
29
31
  def commands(command)
@@ -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
@@ -35,15 +37,7 @@ module Selenium
35
37
  def initialize(opts = {})
36
38
  opts[:desired_capabilities] = create_capabilities(opts)
37
39
 
38
- unless opts.key?(:url)
39
- driver_path = opts.delete(:driver_path) || Chrome.driver_path
40
- driver_opts = opts.delete(:driver_opts) || {}
41
- port = opts.delete(:port) || Service::DEFAULT_PORT
42
-
43
- @service = Service.new(driver_path, port, driver_opts)
44
- @service.start
45
- opts[:url] = @service.uri
46
- end
40
+ opts[:url] ||= service_url(opts)
47
41
 
48
42
  listener = opts.delete(:listener)
49
43
  @bridge = Remote::Bridge.handshake(opts)
@@ -59,7 +53,11 @@ module Selenium
59
53
  def quit
60
54
  super
61
55
  ensure
62
- @service.stop if @service
56
+ @service&.stop
57
+ end
58
+
59
+ def execute_cdp(cmd, **params)
60
+ @bridge.send_command(cmd: cmd, params: params)
63
61
  end
64
62
 
65
63
  private
@@ -72,6 +70,7 @@ module Selenium
72
70
  if args
73
71
  WebDriver.logger.deprecate ':args or :switches', 'Selenium::WebDriver::Chrome::Options#add_argument'
74
72
  raise ArgumentError, ':args must be an Array of Strings' unless args.is_a? Array
73
+
75
74
  args.each { |arg| options.add_argument(arg.to_s) }
76
75
  end
77
76
 
@@ -79,9 +78,7 @@ module Selenium
79
78
  if profile
80
79
  profile = profile.as_json
81
80
 
82
- if options.args.none? { |arg| arg =~ /user-data-dir/ }
83
- options.add_argument("--user-data-dir=#{profile[:directory]}")
84
- end
81
+ options.add_argument("--user-data-dir=#{profile[:directory]}") if options.args.none? { |arg| arg =~ /user-data-dir/ }
85
82
 
86
83
  if profile[:extensions]
87
84
  WebDriver.logger.deprecate 'Using Selenium::WebDriver::Chrome::Profile#extensions',
@@ -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
@@ -22,7 +24,7 @@ module Selenium
22
24
  attr_reader :args, :prefs, :options, :emulation, :extensions, :encoded_extensions
23
25
  attr_accessor :binary
24
26
 
25
- KEY = 'goog:chromeOptions'.freeze
27
+ KEY = 'goog:chromeOptions'
26
28
 
27
29
  #
28
30
  # Create a new Options instance.
@@ -63,6 +65,7 @@ module Selenium
63
65
  def add_extension(path)
64
66
  raise Error::WebDriverError, "could not find extension at #{path.inspect}" unless File.file?(path)
65
67
  raise Error::WebDriverError, "file was not an extension #{path.inspect}" unless File.extname(path) == '.crx'
68
+
66
69
  @extensions << path
67
70
  end
68
71
 
@@ -134,9 +137,6 @@ module Selenium
134
137
 
135
138
  def headless!
136
139
  add_argument '--headless'
137
-
138
- # https://bugs.chromium.org/p/chromium/issues/detail?id=737678#c1
139
- add_argument '--disable-gpu' if WebDriver::Platform.windows?
140
140
  end
141
141
 
142
142
  #
@@ -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
@@ -34,9 +36,7 @@ module Selenium
34
36
  end
35
37
 
36
38
  def add_extension(path)
37
- unless File.file?(path)
38
- raise Error::WebDriverError, "could not find extension at #{path.inspect}"
39
- end
39
+ raise Error::WebDriverError, "could not find extension at #{path.inspect}" unless File.file?(path)
40
40
 
41
41
  @extensions << path
42
42
  end
@@ -97,6 +97,7 @@ module Selenium
97
97
 
98
98
  def read_model_prefs
99
99
  return {} unless @model
100
+
100
101
  JSON.parse File.read(prefs_file_for(@model))
101
102
  end
102
103
 
@@ -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,28 +25,26 @@ module Selenium
23
25
  #
24
26
 
25
27
  class Service < WebDriver::Service
26
- DEFAULT_PORT = 9515
27
- @executable = 'chromedriver'.freeze
28
- @missing_text = <<-ERROR.gsub(/\n +| {2,}/, ' ').freeze
28
+ @default_port = 9515
29
+ @executable = 'chromedriver'
30
+ @missing_text = <<~ERROR
29
31
  Unable to find chromedriver. Please download the server from
30
- http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
32
+ https://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
31
33
  More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
32
34
  ERROR
35
+ @shutdown_supported = true
33
36
 
34
- private
35
-
36
- def start_process
37
- @process = build_process(@executable_path, "--port=#{@port}", *@extra_args)
38
- @process.leader = true unless Platform.windows?
39
- @process.start
37
+ def self.driver_path=(path)
38
+ Platform.assert_executable path if path.is_a?(String)
39
+ @driver_path = path
40
40
  end
41
41
 
42
- def cannot_connect_error_text
43
- "unable to connect to chromedriver #{@host}:#{@port}"
44
- end
42
+ private
45
43
 
44
+ # Note: This processing is deprecated
46
45
  def extract_service_args(driver_opts)
47
46
  driver_args = super
47
+ driver_opts = driver_opts.dup
48
48
  driver_args << "--log-path=#{driver_opts.delete(:log_path)}" if driver_opts.key?(:log_path)
49
49
  driver_args << "--url-base=#{driver_opts.delete(:url_base)}" if driver_opts.key?(:url_base)
50
50
  driver_args << "--port-server=#{driver_opts.delete(:port_server)}" if driver_opts.key?(:port_server)
@@ -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
@@ -36,8 +38,8 @@ require 'selenium/webdriver/common/timeouts'
36
38
  require 'selenium/webdriver/common/window'
37
39
  require 'selenium/webdriver/common/logger'
38
40
  require 'selenium/webdriver/common/logs'
39
- require 'selenium/webdriver/common/options'
40
- require 'selenium/webdriver/common/w3c_options'
41
+ require 'selenium/webdriver/common/manager'
42
+ require 'selenium/webdriver/common/w3c_manager'
41
43
  require 'selenium/webdriver/common/search_context'
42
44
  require 'selenium/webdriver/common/action_builder'
43
45
  require 'selenium/webdriver/common/interactions/key_actions'
@@ -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
@@ -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
@@ -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
@@ -31,6 +33,7 @@ module Selenium
31
33
  when Hash
32
34
  element_id = element_id_from(arg)
33
35
  return Element.new(self, element_id) if element_id
36
+
34
37
  arg.each { |k, v| arg[k] = unwrap_script_result(v) }
35
38
  else
36
39
  arg
@@ -43,12 +46,12 @@ module Selenium
43
46
 
44
47
  def parse_cookie_string(str)
45
48
  result = {
46
- 'name' => '',
47
- 'value' => '',
48
- 'domain' => '',
49
- 'path' => '',
49
+ 'name' => '',
50
+ 'value' => '',
51
+ 'domain' => '',
52
+ 'path' => '',
50
53
  'expires' => '',
51
- 'secure' => false
54
+ 'secure' => false
52
55
  }
53
56
 
54
57
  str.split(';').each do |attribute|
@@ -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
@@ -73,7 +75,7 @@ module Selenium
73
75
  end
74
76
 
75
77
  def inspect
76
- format '#<%s:0x%x browser=%s>', self.class, hash * 2, bridge.browser.inspect
78
+ format '#<%<class>s:0x%<hash>x browser=%<browser>s>', class: self.class, hash: hash * 2, browser: bridge.browser.inspect
77
79
  end
78
80
 
79
81
  #
@@ -95,12 +97,12 @@ module Selenium
95
97
  end
96
98
 
97
99
  #
98
- # @return [Options]
99
- # @see Options
100
+ # @return [Manager]
101
+ # @see Manager
100
102
  #
101
103
 
102
104
  def manage
103
- bridge.options
105
+ bridge.manage
104
106
  end
105
107
 
106
108
  #
@@ -281,13 +283,26 @@ module Selenium
281
283
  # @see SearchContext
282
284
  #
283
285
 
284
- def ref
285
- nil
286
- end
286
+ def ref; end
287
287
 
288
288
  private
289
289
 
290
290
  attr_reader :bridge
291
+
292
+ def service_url(opts)
293
+ @service = opts.delete(:service)
294
+ %i[driver_opts driver_path port].each do |key|
295
+ next unless opts.key? key
296
+
297
+ WebDriver.logger.deprecate(":#{key}", ':service with an instance of Selenium::WebDriver::Service')
298
+ end
299
+ @service ||= Service.send(browser,
300
+ args: opts.delete(:driver_opts),
301
+ path: opts.delete(:driver_path),
302
+ port: opts.delete(:port))
303
+ @service.start
304
+ @service.uri
305
+ end
291
306
  end # Driver
292
307
  end # WebDriver
293
308
  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
@@ -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
@@ -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
@@ -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
@@ -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.keys.include? type
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 = [:landscape, :portrait].freeze
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
@@ -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 '#<%s:0x%x id=%s>', self.class, hash * 2, @id.inspect
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)