selenium-webdriver 4.4.0 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +86 -1
  3. data/LICENSE +1 -1
  4. data/NOTICE +1 -1
  5. data/bin/linux/selenium-manager +0 -0
  6. data/bin/macos/selenium-manager +0 -0
  7. data/bin/windows/selenium-manager.exe +0 -0
  8. data/lib/selenium/server.rb +20 -16
  9. data/lib/selenium/webdriver/atoms/findElements.js +0 -0
  10. data/lib/selenium/webdriver/atoms/getAttribute.js +0 -0
  11. data/lib/selenium/webdriver/atoms/isDisplayed.js +0 -0
  12. data/lib/selenium/webdriver/atoms/mutationListener.js +0 -0
  13. data/lib/selenium/webdriver/atoms.rb +2 -3
  14. data/lib/selenium/webdriver/bidi/browsing_context.rb +88 -0
  15. data/lib/selenium/webdriver/bidi/browsing_context_info.rb +35 -0
  16. data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +35 -0
  17. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +35 -0
  18. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +33 -0
  19. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +33 -0
  20. data/lib/selenium/webdriver/bidi/log_inspector.rb +140 -0
  21. data/lib/selenium/webdriver/bidi/navigate_result.rb +33 -0
  22. data/lib/selenium/webdriver/bidi/session.rb +13 -0
  23. data/lib/selenium/webdriver/bidi.rb +2 -1
  24. data/lib/selenium/webdriver/chrome/driver.rb +19 -28
  25. data/lib/selenium/webdriver/chrome/features.rb +5 -72
  26. data/lib/selenium/webdriver/chrome/options.rb +3 -237
  27. data/lib/selenium/webdriver/chrome/profile.rb +3 -83
  28. data/lib/selenium/webdriver/chrome/service.rb +4 -19
  29. data/lib/selenium/webdriver/chromium/driver.rb +61 -0
  30. data/lib/selenium/webdriver/chromium/features.rb +103 -0
  31. data/lib/selenium/webdriver/chromium/options.rb +261 -0
  32. data/lib/selenium/webdriver/chromium/profile.rb +113 -0
  33. data/lib/selenium/webdriver/chromium/service.rb +42 -0
  34. data/lib/selenium/webdriver/chromium.rb +32 -0
  35. data/lib/selenium/webdriver/common/action_builder.rb +11 -48
  36. data/lib/selenium/webdriver/common/child_process.rb +124 -0
  37. data/lib/selenium/webdriver/common/driver.rb +34 -25
  38. data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +0 -2
  39. data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +0 -1
  40. data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +0 -2
  41. data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +0 -2
  42. data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +0 -2
  43. data/lib/selenium/webdriver/common/driver_extensions/has_bidi.rb +0 -2
  44. data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +0 -1
  45. data/lib/selenium/webdriver/common/driver_extensions/has_cdp.rb +0 -2
  46. data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +0 -2
  47. data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +0 -2
  48. data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +0 -2
  49. data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +0 -2
  50. data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +1 -2
  51. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -1
  52. data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +0 -2
  53. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -2
  54. data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +0 -2
  55. data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +0 -2
  56. data/lib/selenium/webdriver/common/element.rb +7 -7
  57. data/lib/selenium/webdriver/common/error.rb +0 -2
  58. data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +2 -2
  59. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +3 -3
  60. data/lib/selenium/webdriver/common/interactions/pointer_move.rb +2 -2
  61. data/lib/selenium/webdriver/common/interactions/scroll.rb +7 -5
  62. data/lib/selenium/webdriver/common/logger.rb +10 -2
  63. data/lib/selenium/webdriver/common/options.rb +30 -8
  64. data/lib/selenium/webdriver/common/platform.rb +4 -1
  65. data/lib/selenium/webdriver/common/profile_helper.rb +1 -1
  66. data/lib/selenium/webdriver/common/proxy.rb +1 -1
  67. data/lib/selenium/webdriver/common/selenium_manager.rb +89 -0
  68. data/lib/selenium/webdriver/common/service.rb +16 -8
  69. data/lib/selenium/webdriver/common/service_manager.rb +2 -10
  70. data/lib/selenium/webdriver/common/shadow_root.rb +1 -2
  71. data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
  72. data/lib/selenium/webdriver/common/takes_screenshot.rb +2 -3
  73. data/lib/selenium/webdriver/common/target_locator.rb +2 -3
  74. data/lib/selenium/webdriver/common/timeouts.rb +2 -2
  75. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +8 -6
  76. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb +0 -1
  77. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb +16 -16
  78. data/lib/selenium/webdriver/common/websocket_connection.rb +10 -2
  79. data/lib/selenium/webdriver/common.rb +2 -0
  80. data/lib/selenium/webdriver/devtools/console_event.rb +0 -2
  81. data/lib/selenium/webdriver/devtools/exception_event.rb +0 -2
  82. data/lib/selenium/webdriver/devtools/mutation_event.rb +0 -2
  83. data/lib/selenium/webdriver/devtools/network_interceptor.rb +3 -6
  84. data/lib/selenium/webdriver/devtools/pinned_script.rb +0 -2
  85. data/lib/selenium/webdriver/devtools/request.rb +0 -2
  86. data/lib/selenium/webdriver/devtools/response.rb +0 -2
  87. data/lib/selenium/webdriver/devtools.rb +0 -1
  88. data/lib/selenium/webdriver/edge/driver.rb +20 -3
  89. data/lib/selenium/webdriver/edge/features.rb +3 -4
  90. data/lib/selenium/webdriver/edge/options.rb +3 -5
  91. data/lib/selenium/webdriver/edge/profile.rb +2 -2
  92. data/lib/selenium/webdriver/edge/service.rb +2 -2
  93. data/lib/selenium/webdriver/firefox/driver.rb +19 -2
  94. data/lib/selenium/webdriver/firefox/features.rb +5 -2
  95. data/lib/selenium/webdriver/firefox/options.rb +6 -2
  96. data/lib/selenium/webdriver/firefox/profile.rb +6 -6
  97. data/lib/selenium/webdriver/firefox/service.rb +0 -1
  98. data/lib/selenium/webdriver/ie/driver.rb +20 -1
  99. data/lib/selenium/webdriver/ie/service.rb +1 -2
  100. data/lib/selenium/webdriver/remote/bridge.rb +8 -15
  101. data/lib/selenium/webdriver/remote/capabilities.rb +34 -12
  102. data/lib/selenium/webdriver/remote/commands.rb +0 -2
  103. data/lib/selenium/webdriver/remote/driver.rb +13 -13
  104. data/lib/selenium/webdriver/remote/http/curb.rb +0 -2
  105. data/lib/selenium/webdriver/remote/http/default.rb +1 -0
  106. data/lib/selenium/webdriver/remote/response.rb +0 -1
  107. data/lib/selenium/webdriver/safari/driver.rb +20 -1
  108. data/lib/selenium/webdriver/safari/features.rb +0 -2
  109. data/lib/selenium/webdriver/safari/options.rb +5 -1
  110. data/lib/selenium/webdriver/safari.rb +1 -1
  111. data/lib/selenium/webdriver/support/color.rb +15 -15
  112. data/lib/selenium/webdriver/support/guards/guard.rb +0 -2
  113. data/lib/selenium/webdriver/support/guards/guard_condition.rb +0 -2
  114. data/lib/selenium/webdriver/support/relative_locator.rb +0 -1
  115. data/lib/selenium/webdriver/support/select.rb +3 -1
  116. data/lib/selenium/webdriver/version.rb +1 -1
  117. data/lib/selenium/webdriver.rb +3 -4
  118. data/selenium-webdriver.gemspec +8 -9
  119. metadata +29 -73
  120. data/lib/selenium/webdriver/support/cdp/domain.rb.erb +0 -63
  121. data/lib/selenium/webdriver/support/cdp_client_generator.rb +0 -108
@@ -20,7 +20,6 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  module Safari
23
-
24
23
  #
25
24
  # Driver implementation for Safari.
26
25
  # @api private
@@ -31,9 +30,29 @@ module Selenium
31
30
  DriverExtensions::HasApplePermissions,
32
31
  DriverExtensions::HasWebStorage].freeze
33
32
 
33
+ def initialize(capabilities: nil, options: nil, service: nil, url: nil, **opts)
34
+ raise ArgumentError, "Can't initialize #{self.class} with :url" if url
35
+
36
+ caps = process_options(options, capabilities)
37
+ url = service_url(service || Service.safari)
38
+ super(caps: caps, url: url, **opts)
39
+ end
40
+
34
41
  def browser
35
42
  :safari
36
43
  end
44
+
45
+ private
46
+
47
+ def process_options(options, capabilities)
48
+ if options && !options.is_a?(Options)
49
+ raise ArgumentError, ":options must be an instance of #{Options}"
50
+ elsif options.nil? && capabilities.nil?
51
+ options = Options.new
52
+ end
53
+
54
+ super(options, capabilities)
55
+ end
37
56
  end # Driver
38
57
  end # Safari
39
58
  end # WebDriver
@@ -21,7 +21,6 @@ module Selenium
21
21
  module WebDriver
22
22
  module Safari
23
23
  module Features
24
-
25
24
  # https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/WebDriverEndpointDoc/Commands/Commands.html
26
25
  SAFARI_COMMANDS = {
27
26
  get_permissions: [:get, 'session/:session_id/apple/permissions'],
@@ -44,7 +43,6 @@ module Selenium
44
43
  def attach_debugger
45
44
  execute :attach_debugger, {}, {}
46
45
  end
47
-
48
46
  end # Bridge
49
47
  end # Safari
50
48
  end # WebDriver
@@ -26,7 +26,7 @@ module Selenium
26
26
  # @see https://developer.apple.com/documentation/webkit/about_webdriver_for_safari
27
27
  CAPABILITIES = {automatic_inspection: 'safari:automaticInspection',
28
28
  automatic_profiling: 'safari:automaticProfiling'}.freeze
29
- BROWSER = 'safari'
29
+ BROWSER = Selenium::WebDriver::Safari.technology_preview? ? 'Safari Technology Preview' : 'safari'
30
30
 
31
31
  def add_option(name, value = nil)
32
32
  key = name.is_a?(Hash) ? name.keys.first : name
@@ -35,6 +35,10 @@ module Selenium
35
35
  super
36
36
  end
37
37
 
38
+ def as_json(*)
39
+ @options[:browser_name] = Safari.technology_preview? ? 'Safari Technology Preview' : 'safari'
40
+ super
41
+ end
38
42
  end # Options
39
43
  end # Safari
40
44
  end # WebDriver
@@ -29,7 +29,7 @@ module Selenium
29
29
  attr_accessor :use_technology_preview
30
30
 
31
31
  def technology_preview
32
- "/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/safaridriver"
32
+ '/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver'
33
33
  end
34
34
 
35
35
  def technology_preview!
@@ -21,29 +21,29 @@ module Selenium
21
21
  module WebDriver
22
22
  module Support
23
23
  class Color
24
- RGB_PATTERN = %r{^\s*rgb\(\s*(\d{1,3})\s*,
24
+ RGB_PATTERN = /^\s*rgb\(\s*(\d{1,3})\s*,
25
25
  \s*(\d{1,3})\s*,
26
- \s*(\d{1,3})\s*\)\s*$}x.freeze
27
- RGB_PCT_PATTERN = %r{^\s*rgb\(\s*(\d{1,3}|\d{1,2}\.\d+)%\s*,
26
+ \s*(\d{1,3})\s*\)\s*$/x.freeze
27
+ RGB_PCT_PATTERN = /^\s*rgb\(\s*(\d{1,3}|\d{1,2}\.\d+)%\s*,
28
28
  \s*(\d{1,3}|\d{1,2}\.\d+)%\s*,
29
- \s*(\d{1,3}|\d{1,2}\.\d+)%\s*\)\s*$}x.freeze
30
- RGBA_PATTERN = %r{^\s*rgba\(\s*(\d{1,3})\s*,
29
+ \s*(\d{1,3}|\d{1,2}\.\d+)%\s*\)\s*$/x.freeze
30
+ RGBA_PATTERN = /^\s*rgba\(\s*(\d{1,3})\s*,
31
31
  \s*(\d{1,3})\s*,
32
32
  \s*(\d{1,3})\s*,
33
- \s*(0|1|0\.\d+)\s*\)\s*$}x.freeze
34
- RGBA_PCT_PATTERN = %r{^\s*rgba\(\s*(\d{1,3}|\d{1,2}\.\d+)
33
+ \s*(0|1|0\.\d+)\s*\)\s*$/x.freeze
34
+ RGBA_PCT_PATTERN = /^\s*rgba\(\s*(\d{1,3}|\d{1,2}\.\d+)
35
35
  %\s*,\s*(\d{1,3}|\d{1,2}\.\d+)
36
36
  %\s*,\s*(\d{1,3}|\d{1,2}\.\d+)
37
- %\s*,\s*(0|1|0\.\d+)\s*\)\s*$}x.freeze
37
+ %\s*,\s*(0|1|0\.\d+)\s*\)\s*$/x.freeze
38
38
  HEX_PATTERN = /#(\h{2})(\h{2})(\h{2})/.freeze
39
39
  HEX3_PATTERN = /#(\h)(\h)(\h)/.freeze
40
- HSL_PATTERN = %r{^\s*hsl\(\s*(\d{1,3})\s*,
40
+ HSL_PATTERN = /^\s*hsl\(\s*(\d{1,3})\s*,
41
41
  \s*(\d{1,3})%\s*,
42
- \s*(\d{1,3})%\s*\)\s*$}x.freeze
43
- HSLA_PATTERN = %r{^\s*hsla\(\s*(\d{1,3})\s*,
42
+ \s*(\d{1,3})%\s*\)\s*$/x.freeze
43
+ HSLA_PATTERN = /^\s*hsla\(\s*(\d{1,3})\s*,
44
44
  \s*(\d{1,3})%\s*,
45
45
  \s*(\d{1,3})%\s*,
46
- \s*(0|1|0\.\d+)\s*\)\s*$}x.freeze
46
+ \s*(0|1|0\.\d+)\s*\)\s*$/x.freeze
47
47
 
48
48
  attr_reader :red, :green, :blue, :alpha
49
49
 
@@ -83,8 +83,8 @@ module Selenium
83
83
  g = r
84
84
  b = r
85
85
  else
86
- luminocity2 = l < 0.5 ? l * (1 + s) : l + s - (l * s)
87
- luminocity1 = (2 * l) - luminocity2
86
+ luminocity2 = l < 0.5 ? l * (s + 1) : l + s - (l * s)
87
+ luminocity1 = (l * 2) - luminocity2
88
88
 
89
89
  r = hue_to_rgb(luminocity1, luminocity2, h + (1.0 / 3.0))
90
90
  g = hue_to_rgb(luminocity1, luminocity2, h)
@@ -122,7 +122,7 @@ module Selenium
122
122
 
123
123
  [red, green, blue, alpha] == [other.red, other.green, other.blue, other.alpha]
124
124
  end
125
- alias_method :eql?, :==
125
+ alias eql? ==
126
126
 
127
127
  def hash
128
128
  [red, green, blue, alpha, self.class].hash
@@ -21,14 +21,12 @@ module Selenium
21
21
  module WebDriver
22
22
  module Support
23
23
  class Guards
24
-
25
24
  #
26
25
  # Guard derived from RSpec example metadata.
27
26
  # @api private
28
27
  #
29
28
 
30
29
  class Guard
31
-
32
30
  attr_reader :guarded, :type, :messages, :reason
33
31
 
34
32
  def initialize(guarded, type, guards = nil)
@@ -21,7 +21,6 @@ module Selenium
21
21
  module WebDriver
22
22
  module Support
23
23
  class Guards
24
-
25
24
  #
26
25
  # Guard derived from RSpec example metadata.
27
26
  # @api private
@@ -44,7 +43,6 @@ module Selenium
44
43
 
45
44
  list.empty? || @execution.call(list)
46
45
  end
47
-
48
46
  end # GuardCondition
49
47
  end # Guards
50
48
  end # Support
@@ -20,7 +20,6 @@
20
20
  module Selenium
21
21
  module WebDriver
22
22
  module Support
23
-
24
23
  #
25
24
  # @api private
26
25
  #
@@ -86,7 +86,7 @@ module Selenium
86
86
  #
87
87
  # <option value="foo">Bar</option>
88
88
  #
89
- # When slecting by :value, selects all options that have a value matching the argument. That is, when given "foo" this
89
+ # When selecting by :value, selects all options that have a value matching the argument. That is, when given "foo" this
90
90
  # would select an option like:
91
91
  #
92
92
  # <option value="foo">Bar</option>
@@ -215,6 +215,8 @@ module Selenium
215
215
  end
216
216
 
217
217
  def select_option(option)
218
+ raise Error::UnsupportedOperationError, 'You may not select a disabled option' unless option.enabled?
219
+
218
220
  option.click unless option.selected?
219
221
  end
220
222
 
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Selenium
21
21
  module WebDriver
22
- VERSION = '4.4.0'
22
+ VERSION = '4.8.0'
23
23
  end # WebDriver
24
24
  end # Selenium
@@ -17,7 +17,6 @@
17
17
  # specific language governing permissions and limitations
18
18
  # under the License.
19
19
 
20
- require 'childprocess'
21
20
  require 'tmpdir'
22
21
  require 'fileutils'
23
22
  require 'date'
@@ -34,9 +33,9 @@ module Selenium
34
33
  Point = Struct.new(:x, :y)
35
34
  Dimension = Struct.new(:width, :height)
36
35
  Rectangle = Struct.new(:x, :y, :width, :height)
37
- Location = Struct.new(:latitude, :longitude, :altitude)
38
36
 
39
37
  autoload :BiDi, 'selenium/webdriver/bidi'
38
+ autoload :Chromium, 'selenium/webdriver/chromium'
40
39
  autoload :Chrome, 'selenium/webdriver/chrome'
41
40
  autoload :DevTools, 'selenium/webdriver/devtools'
42
41
  autoload :Edge, 'selenium/webdriver/edge'
@@ -95,8 +94,8 @@ module Selenium
95
94
  # @return [Logger]
96
95
  #
97
96
 
98
- def self.logger
99
- @logger ||= WebDriver::Logger.new
97
+ def self.logger(**opts)
98
+ @logger ||= WebDriver::Logger.new('Selenium', **opts)
100
99
  end
101
100
  end # WebDriver
102
101
  end # Selenium
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.homepage = 'https://selenium.dev'
25
25
  s.metadata = {
26
26
  'changelog_uri' => 'https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES',
27
+ 'github_repo' => 'ssh://github.com/SeleniumHQ/selenium',
27
28
  'source_code_uri' => 'https://github.com/SeleniumHQ/selenium/tree/trunk/rb',
28
29
  'rubygems_mfa_required' => 'true'
29
30
  }
@@ -41,25 +42,23 @@ Gem::Specification.new do |s|
41
42
  'lib/selenium-webdriver.rb',
42
43
  'lib/selenium/server.rb',
43
44
  'lib/selenium/webdriver.rb'
44
- ] + Dir['lib/selenium/webdriver/**/*']
45
+ ]
46
+ s.files += Dir['bin/**/*']
47
+ s.files += Dir['lib/selenium/webdriver/**/*']
45
48
 
49
+ s.bindir = 'bin'
46
50
  s.require_paths = ['lib']
47
51
 
48
- s.add_runtime_dependency 'childprocess', ['>= 0.5', '< 5.0']
49
52
  s.add_runtime_dependency 'rexml', ['~> 3.2', '>= 3.2.5']
50
53
  s.add_runtime_dependency 'rubyzip', ['>= 1.2.2', '< 3.0']
51
54
  s.add_runtime_dependency 'websocket', ['~> 1.0']
52
55
 
53
- # childprocess requires ffi on windows but doesn't declare it in its dependencies
54
- s.add_development_dependency 'ffi'
55
56
  s.add_development_dependency 'pry', ['~> 0.14']
56
57
  s.add_development_dependency 'rack', ['~> 2.0']
57
- s.add_development_dependency 'rake'
58
58
  s.add_development_dependency 'rspec', ['~> 3.0']
59
- s.add_development_dependency 'rubocop', ['~> 1.31']
60
- s.add_development_dependency 'rubocop-performance', ['~> 1.13']
61
- s.add_development_dependency 'rubocop-rake'
62
- s.add_development_dependency 'rubocop-rspec', ['~> 2.12']
59
+ s.add_development_dependency 'rubocop', ['~> 1.42']
60
+ s.add_development_dependency 'rubocop-performance', ['~> 1.15']
61
+ s.add_development_dependency 'rubocop-rspec', ['~> 2.16']
63
62
  s.add_development_dependency 'webmock', ['~> 3.5']
64
63
  s.add_development_dependency 'webrick', ['~> 1.7']
65
64
  s.add_development_dependency 'yard', ['~> 0.9.11']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -10,28 +10,8 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-08-09 00:00:00.000000000 Z
13
+ date: 2023-01-23 00:00:00.000000000 Z
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: childprocess
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: '0.5'
22
- - - "<"
23
- - !ruby/object:Gem::Version
24
- version: '5.0'
25
- type: :runtime
26
- prerelease: false
27
- version_requirements: !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: '0.5'
32
- - - "<"
33
- - !ruby/object:Gem::Version
34
- version: '5.0'
35
15
  - !ruby/object:Gem::Dependency
36
16
  name: rexml
37
17
  requirement: !ruby/object:Gem::Requirement
@@ -86,20 +66,6 @@ dependencies:
86
66
  - - "~>"
87
67
  - !ruby/object:Gem::Version
88
68
  version: '1.0'
89
- - !ruby/object:Gem::Dependency
90
- name: ffi
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
69
  - !ruby/object:Gem::Dependency
104
70
  name: pry
105
71
  requirement: !ruby/object:Gem::Requirement
@@ -128,20 +94,6 @@ dependencies:
128
94
  - - "~>"
129
95
  - !ruby/object:Gem::Version
130
96
  version: '2.0'
131
- - !ruby/object:Gem::Dependency
132
- name: rake
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- version: '0'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
97
  - !ruby/object:Gem::Dependency
146
98
  name: rspec
147
99
  requirement: !ruby/object:Gem::Requirement
@@ -162,56 +114,42 @@ dependencies:
162
114
  requirements:
163
115
  - - "~>"
164
116
  - !ruby/object:Gem::Version
165
- version: '1.31'
117
+ version: '1.42'
166
118
  type: :development
167
119
  prerelease: false
168
120
  version_requirements: !ruby/object:Gem::Requirement
169
121
  requirements:
170
122
  - - "~>"
171
123
  - !ruby/object:Gem::Version
172
- version: '1.31'
124
+ version: '1.42'
173
125
  - !ruby/object:Gem::Dependency
174
126
  name: rubocop-performance
175
127
  requirement: !ruby/object:Gem::Requirement
176
128
  requirements:
177
129
  - - "~>"
178
130
  - !ruby/object:Gem::Version
179
- version: '1.13'
131
+ version: '1.15'
180
132
  type: :development
181
133
  prerelease: false
182
134
  version_requirements: !ruby/object:Gem::Requirement
183
135
  requirements:
184
136
  - - "~>"
185
137
  - !ruby/object:Gem::Version
186
- version: '1.13'
187
- - !ruby/object:Gem::Dependency
188
- name: rubocop-rake
189
- requirement: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: '0'
194
- type: :development
195
- prerelease: false
196
- version_requirements: !ruby/object:Gem::Requirement
197
- requirements:
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- version: '0'
138
+ version: '1.15'
201
139
  - !ruby/object:Gem::Dependency
202
140
  name: rubocop-rspec
203
141
  requirement: !ruby/object:Gem::Requirement
204
142
  requirements:
205
143
  - - "~>"
206
144
  - !ruby/object:Gem::Version
207
- version: '2.12'
145
+ version: '2.16'
208
146
  type: :development
209
147
  prerelease: false
210
148
  version_requirements: !ruby/object:Gem::Requirement
211
149
  requirements:
212
150
  - - "~>"
213
151
  - !ruby/object:Gem::Version
214
- version: '2.12'
152
+ version: '2.16'
215
153
  - !ruby/object:Gem::Dependency
216
154
  name: webmock
217
155
  requirement: !ruby/object:Gem::Requirement
@@ -271,6 +209,9 @@ files:
271
209
  - LICENSE
272
210
  - NOTICE
273
211
  - README.md
212
+ - bin/linux/selenium-manager
213
+ - bin/macos/selenium-manager
214
+ - bin/windows/selenium-manager.exe
274
215
  - lib/selenium-webdriver.rb
275
216
  - lib/selenium/server.rb
276
217
  - lib/selenium/webdriver.rb
@@ -280,6 +221,14 @@ files:
280
221
  - lib/selenium/webdriver/atoms/isDisplayed.js
281
222
  - lib/selenium/webdriver/atoms/mutationListener.js
282
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
283
232
  - lib/selenium/webdriver/bidi/session.rb
284
233
  - lib/selenium/webdriver/chrome.rb
285
234
  - lib/selenium/webdriver/chrome/driver.rb
@@ -287,9 +236,16 @@ files:
287
236
  - lib/selenium/webdriver/chrome/options.rb
288
237
  - lib/selenium/webdriver/chrome/profile.rb
289
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
290
245
  - lib/selenium/webdriver/common.rb
291
246
  - lib/selenium/webdriver/common/action_builder.rb
292
247
  - lib/selenium/webdriver/common/alert.rb
248
+ - lib/selenium/webdriver/common/child_process.rb
293
249
  - lib/selenium/webdriver/common/driver.rb
294
250
  - lib/selenium/webdriver/common/driver_extensions/downloads_files.rb
295
251
  - lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb
@@ -351,6 +307,7 @@ files:
351
307
  - lib/selenium/webdriver/common/profile_helper.rb
352
308
  - lib/selenium/webdriver/common/proxy.rb
353
309
  - lib/selenium/webdriver/common/search_context.rb
310
+ - lib/selenium/webdriver/common/selenium_manager.rb
354
311
  - lib/selenium/webdriver/common/service.rb
355
312
  - lib/selenium/webdriver/common/service_manager.rb
356
313
  - lib/selenium/webdriver/common/shadow_root.rb
@@ -411,8 +368,6 @@ files:
411
368
  - lib/selenium/webdriver/support.rb
412
369
  - lib/selenium/webdriver/support/abstract_event_listener.rb
413
370
  - lib/selenium/webdriver/support/block_event_listener.rb
414
- - lib/selenium/webdriver/support/cdp/domain.rb.erb
415
- - lib/selenium/webdriver/support/cdp_client_generator.rb
416
371
  - lib/selenium/webdriver/support/color.rb
417
372
  - lib/selenium/webdriver/support/escaper.rb
418
373
  - lib/selenium/webdriver/support/event_firing_bridge.rb
@@ -428,6 +383,7 @@ licenses:
428
383
  - Apache-2.0
429
384
  metadata:
430
385
  changelog_uri: https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES
386
+ github_repo: ssh://github.com/SeleniumHQ/selenium
431
387
  source_code_uri: https://github.com/SeleniumHQ/selenium/tree/trunk/rb
432
388
  rubygems_mfa_required: 'true'
433
389
  post_install_message:
@@ -445,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
445
401
  - !ruby/object:Gem::Version
446
402
  version: 1.3.1
447
403
  requirements: []
448
- rubygems_version: 3.0.3.1
404
+ rubygems_version: 3.1.6
449
405
  signing_key:
450
406
  specification_version: 4
451
407
  summary: Selenium is a browser automation tool for automated testing of webapps and
@@ -1,63 +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
- # This file is automatically generated. Any changes will be lost!
21
- module Selenium
22
- module DevTools
23
- module <%= version %>
24
- class <%= domain[:domain] %>
25
- <% if domain[:events] %>
26
- EVENTS = {
27
- <% domain[:events].each do |event| %>
28
- <%= h.snake_case(event[:name]) %>: '<%= event[:name] %>',
29
- <% end %>
30
- }.freeze
31
- <% end %>
32
-
33
- def initialize(devtools)
34
- @devtools = devtools
35
- end
36
-
37
- def on(event, &block)
38
- event = EVENTS[event] if event.is_a?(Symbol)
39
- @devtools.callbacks["<%= domain[:domain] %>.#{event}"] << block
40
- end
41
-
42
- <% domain[:commands].each do |command| %>
43
- <% if command[:parameters] %>
44
- def <%= h.snake_case(command[:name]) %>(<%= h.kwargs(command[:parameters]) %>)
45
- <% else %>
46
- def <%= h.snake_case(command[:name]) %>
47
- <% end %>
48
- <% if command[:parameters] %>
49
- @devtools.send_cmd('<%= domain[:domain] %>.<%= command[:name] %>',
50
- <% until command[:parameters].empty? %>
51
- <% parameter = command[:parameters].shift %>
52
- <%= parameter[:name] %>: <%= h.snake_case(parameter[:name]) %><%= command[:parameters].empty? ? ')' : ',' %>
53
- <% end %>
54
- <% else %>
55
- @devtools.send_cmd('<%= domain[:domain] %>.<%= command[:name] %>')
56
- <% end %>
57
- end
58
-
59
- <% end %>
60
- end # <%= domain[:domain] %>
61
- end # <%= version %>
62
- end # DevTools
63
- end # Selenium
@@ -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