diff --git a/rb/Steepfile b/rb/Steepfile index b051298ba21fe..d663fa219ec72 100644 --- a/rb/Steepfile +++ b/rb/Steepfile @@ -1,8 +1,88 @@ # frozen_string_literal: true +# rubocop:disable Metrics/BlockLength -- Disable due to the steep configuration not matching rubocop expectations target :lib do - signature 'sig' # Signature directory + signature 'sig', '.gem_rbs_collection/rubyzip' # Signature directory check 'lib' # Directory name + # Total amount of errors ignore 66 in 31 files + ignore( + # Ignore line 166 due to UDP RBS issue + 'lib/selenium/webdriver/common/platform.rb', + # Ignore due to webmock gem not having RBS signatures + 'lib/selenium/webdriver/remote/http/curb.rb', + # Ignore due to line 71, there is one last error where RBS thinks backtrace is nil + 'lib/selenium/webdriver/remote/response.rb', + # Ignore due to Errno::EACCES error + 'lib/selenium/webdriver/support/color.rb', + 'lib/selenium/webdriver/common/port_prober.rb', + # Ignore due to error overloading + 'lib/selenium/webdriver/common/socket_poller.rb', + # Ignore due to Parser on line 611 + 'lib/selenium/webdriver/remote/bridge.rb', + # Ignore due to error on line 101 with block + 'lib/selenium/webdriver/devtools/network_interceptor.rb', + # Ignore due to error on line 21 with overloading issues + 'lib/selenium/webdriver/common/virtual_authenticator/credential.rb', + # Ignore due to error with the Zipper RBS + 'lib/selenium/webdriver/common/zipper.rb', + # Ignore due to error on line 117 with the debug? method + 'lib/selenium/webdriver/common/selenium_manager.rb', + # Ignore due to line 230 with the overloading issues + 'lib/selenium/webdriver/common/action_builder.rb', + # Ignore due to CAPABILITIES not able to be found on line 55 + 'lib/selenium/webdriver/common/options.rb', + # Ignore due to strftime error in RBS on line 188 + 'lib/selenium/webdriver/common/logger.rb', + # Ignore due to error with Process + 'lib/selenium/webdriver/common/child_process.rb', + # Ignore due to Net::HTTP not being found on line 49 + 'lib/selenium/webdriver/chromium/driver.rb', + # Ignore due to error on line 37 with include? + 'lib/selenium/webdriver/support/guards/guard_condition.rb', + # Ignore due to positional argument error on line 69 + 'lib/selenium/webdriver/common/socket_lock.rb', + # Ignore due to is_a? bot error on line 70 + 'lib/selenium/webdriver/remote/driver.rb', + # Ignore due to line 118 causing an error with URI & Net::HTTP + 'lib/selenium/server.rb', + # Ignore due to overloading issue on line 84 + 'lib/selenium/webdriver/chromium/features.rb', + # Ignore due to line 59 with the same URI & Net::HTTP issue + 'lib/selenium/webdriver/firefox/driver.rb', + # Ignore due to line 27 with overloading issue + 'lib/selenium/webdriver/bidi/log/console_log_entry.rb', + # Ignore due to line 89 with overloading issue + 'lib/selenium/webdriver.rb', + # Ignore due to line 37 with overloading issue + 'lib/selenium/webdriver/common/interactions/wheel_input.rb', + # Cannot override last error on line 71 + 'lib/selenium/webdriver/common/wait.rb', + # Cannot override params on line 83 + 'lib/selenium/webdriver/bidi/log_inspector.rb', + # Kwargs issue on line 74 + 'lib/selenium/webdriver/common/driver.rb', + # issue with the Zipper RBS library on line 54 + 'lib/selenium/webdriver/firefox/extension.rb', + # Ignored due to return of last match in line 57 and 59 + 'lib/selenium/webdriver/firefox/profiles_ini.rb', + # Ignored due to error on line 100 of response being nillable + 'lib/selenium/webdriver/remote/http/default.rb' + ) - library 'forwardable' # Standard libraries + # Standard libraries used in the project + library( + 'base64', + 'date', + 'erb', + 'find', + 'forwardable', + 'ipaddr', + 'net-http', + 'openssl', + 'tmpdir', + 'securerandom', + 'uri', + 'zlib' + ) end +# rubocop:enable Metrics/BlockLength diff --git a/rb/lib/selenium/devtools/support/cdp_client_generator.rb b/rb/lib/selenium/devtools/support/cdp_client_generator.rb index 0d983fb035357..be3562704bfef 100644 --- a/rb/lib/selenium/devtools/support/cdp_client_generator.rb +++ b/rb/lib/selenium/devtools/support/cdp_client_generator.rb @@ -26,8 +26,9 @@ module DevTools module Support class CDPClientGenerator # Input JSON files are generated from PDL tasks. - DOMAIN_TEMPLATE_PATH = File.expand_path('cdp/domain.rb.erb', __dir__) - LOADER_TEMPLATE_PATH = File.expand_path('cdp/loader.rb.erb', __dir__) + DIR = __dir__ || '' + DOMAIN_TEMPLATE_PATH = File.expand_path('cdp/domain.rb.erb', DIR) + LOADER_TEMPLATE_PATH = File.expand_path('cdp/loader.rb.erb', DIR) RESERVED_KEYWORDS = %w[end].freeze @@ -39,9 +40,9 @@ def call(output_dir:, version:, **opts) @version = version browser_protocol_path = opts.delete(:browser_protocol_path) do - File.expand_path('cdp/browser_protocol.json', __dir__) + File.expand_path('cdp/browser_protocol.json', DIR) end - js_protocol_path = opts.delete(:js_protocol_path) { File.expand_path('cdp/js_protocol.json', __dir__) } + js_protocol_path = opts.delete(:js_protocol_path) { File.expand_path('cdp/js_protocol.json', DIR) } raise ArgumentError, "Invalid arguments: #{opts.keys}" unless opts.empty? @@ -103,7 +104,7 @@ def process_loader(domains) Selenium::DevTools::Support::CDPClientGenerator.new.call( browser_protocol_path: browser_protocol_path, js_protocol_path: js_protocol_path, - output_dir: loader_path.sub(/\.rb$/, ''), + output_dir: loader_path&.sub(/\.rb$/, ''), loader_path: loader_path, version: version ) diff --git a/rb/lib/selenium/webdriver.rb b/rb/lib/selenium/webdriver.rb index 290b3344ebaac..5b82fc1a0554d 100644 --- a/rb/lib/selenium/webdriver.rb +++ b/rb/lib/selenium/webdriver.rb @@ -49,7 +49,7 @@ module WebDriver # @api private def self.root - @root ||= File.expand_path('..', __dir__) + @root ||= File.expand_path('..', __dir__.to_s) end # diff --git a/rb/lib/selenium/webdriver/common/driver.rb b/rb/lib/selenium/webdriver/common/driver.rb index 00c9f470b5bd4..6a816cb67b301 100644 --- a/rb/lib/selenium/webdriver/common/driver.rb +++ b/rb/lib/selenium/webdriver/common/driver.rb @@ -292,7 +292,7 @@ def [](sel) end def browser - bridge&.browser + bridge.browser end def capabilities diff --git a/rb/lib/selenium/webdriver/common/manager.rb b/rb/lib/selenium/webdriver/common/manager.rb index a018b30cf07f5..6ba94fca8d829 100644 --- a/rb/lib/selenium/webdriver/common/manager.rb +++ b/rb/lib/selenium/webdriver/common/manager.rb @@ -56,7 +56,7 @@ def add_cookie(opts = {}) opts[:httpOnly] = http_only if http_only obj = opts.delete(:expires) - opts[:expiry] = seconds_from(obj).to_i if obj + opts[:expiry] = seconds_from(obj).to_int if obj @bridge.add_cookie opts end diff --git a/rb/lib/selenium/webdriver/common/options.rb b/rb/lib/selenium/webdriver/common/options.rb index cfe900fe36a31..4170a7c9e7ce1 100644 --- a/rb/lib/selenium/webdriver/common/options.rb +++ b/rb/lib/selenium/webdriver/common/options.rb @@ -177,7 +177,7 @@ def convert_json_key(key, camelize: true) end def camel_case(str) - str.gsub(/_([a-z])/) { Regexp.last_match(1).upcase } + str.gsub(/_([a-z])/) { Regexp.last_match(1)&.upcase } end end # Options end # WebDriver diff --git a/rb/lib/selenium/webdriver/common/service.rb b/rb/lib/selenium/webdriver/common/service.rb index 442f90849369a..e1266a7350ea4 100644 --- a/rb/lib/selenium/webdriver/common/service.rb +++ b/rb/lib/selenium/webdriver/common/service.rb @@ -88,7 +88,7 @@ def initialize(path: nil, port: nil, log: nil, args: nil) def launch @executable_path ||= begin - default_options = WebDriver.const_get("#{self.class.name.split('::')[2]}::Options").new + default_options = WebDriver.const_get("#{self.class.name&.split('::')&.[](2)}::Options").new DriverFinder.path(default_options, self.class) end ServiceManager.new(self).tap(&:start) diff --git a/rb/lib/selenium/webdriver/common/socket_poller.rb b/rb/lib/selenium/webdriver/common/socket_poller.rb index 3dd80a9c9eee6..a638454a026ba 100644 --- a/rb/lib/selenium/webdriver/common/socket_poller.rb +++ b/rb/lib/selenium/webdriver/common/socket_poller.rb @@ -78,7 +78,7 @@ def listening? def listening? addr = Socket.getaddrinfo(@host, @port, Socket::AF_INET, Socket::SOCK_STREAM) sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) - sockaddr = Socket.pack_sockaddr_in(@port, addr[0][3]) + sockaddr = Socket.pack_sockaddr_in(@port, addr[0][3].to_s) begin sock.connect_nonblock sockaddr diff --git a/rb/lib/selenium/webdriver/firefox/profile.rb b/rb/lib/selenium/webdriver/firefox/profile.rb index 85c50bce02dd4..f018c5e2c7541 100644 --- a/rb/lib/selenium/webdriver/firefox/profile.rb +++ b/rb/lib/selenium/webdriver/firefox/profile.rb @@ -24,6 +24,10 @@ class Profile include ProfileHelper VALID_PREFERENCE_TYPES = [TrueClass, FalseClass, Integer, Float, String].freeze + WEBDRIVER_PREFS = { + port: 'webdriver_firefox_port', + log_file: 'webdriver.log.file' + }.freeze DEFAULT_PREFERENCES = { 'browser.newtabpage.enabled' => false, @@ -35,8 +39,8 @@ class Profile LOCK_FILES = %w[.parentlock parent.lock lock].freeze - attr_reader :name, :log_file - attr_writer :secure_ssl, :load_no_focus_lib + attr_reader :name, :log_file + attr_writer :secure_ssl, :load_no_focus_lib class << self def ini @@ -206,8 +210,8 @@ def read_user_prefs(path) File.read(path).split("\n").each do |line| next unless line =~ /user_pref\("([^"]+)"\s*,\s*(.+?)\);/ - key = Regexp.last_match(1).strip - value = Regexp.last_match(2).strip + key = Regexp.last_match(1)&.strip + value = Regexp.last_match(2)&.strip # wrap the value in an array to make it a valid JSON string. prefs[key] = JSON.parse("[#{value}]").first @@ -223,7 +227,9 @@ def write_prefs(prefs, path) end end end - end # Profile + end + + # Profile end # Firefox end # WebDriver end # Selenium diff --git a/rb/lib/selenium/webdriver/firefox/profiles_ini.rb b/rb/lib/selenium/webdriver/firefox/profiles_ini.rb index f9eeee3f34ea7..5050e31a2d905 100644 --- a/rb/lib/selenium/webdriver/firefox/profiles_ini.rb +++ b/rb/lib/selenium/webdriver/firefox/profiles_ini.rb @@ -52,7 +52,7 @@ def parse when /^\[Profile/ name, path = nil if path_for(name, is_relative, path) when /^Name=(.+)$/ - name = Regexp.last_match(1).strip + name = Regexp.last_match(1)&.strip when /^IsRelative=(.+)$/ is_relative = Regexp.last_match(1).strip == '1' when /^Path=(.+)$/ diff --git a/rb/lib/selenium/webdriver/remote/capabilities.rb b/rb/lib/selenium/webdriver/remote/capabilities.rb index 4bcac5e12c4bd..ce6b59d461bc6 100644 --- a/rb/lib/selenium/webdriver/remote/capabilities.rb +++ b/rb/lib/selenium/webdriver/remote/capabilities.rb @@ -99,7 +99,7 @@ def json_create(data) end def camel_case(str_or_sym) - str_or_sym.to_s.gsub(/_([a-z])/) { Regexp.last_match(1).upcase } + str_or_sym.to_s.gsub(/_([a-z])/) { Regexp.last_match(1)&.upcase } end private diff --git a/rb/rbs_collection.lock.yaml b/rb/rbs_collection.lock.yaml index e0f5305ca074a..ce3878d164f4f 100644 --- a/rb/rbs_collection.lock.yaml +++ b/rb/rbs_collection.lock.yaml @@ -1,21 +1,23 @@ --- -sources: -- type: git - name: ruby/gem_rbs_collection - revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f - remote: https://github.com/ruby/gem_rbs_collection.git - repo_dir: gems path: ".gem_rbs_collection" gems: +- name: addressable + version: '2.8' + source: + type: git + name: ruby/gem_rbs_collection + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems - name: ast version: '2.4' source: type: git name: ruby/gem_rbs_collection - revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems -- name: base64 +- name: bigdecimal version: '0' source: type: stdlib @@ -23,6 +25,18 @@ gems: version: '0' source: type: stdlib +- name: fileutils + version: '0' + source: + type: stdlib +- name: hashdiff + version: '1.1' + source: + type: git + name: ruby/gem_rbs_collection + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems - name: json version: '0' source: @@ -44,7 +58,15 @@ gems: source: type: git name: ruby/gem_rbs_collection - revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: parser + version: '3.2' + source: + type: git + name: ruby/gem_rbs_collection + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems - name: rack @@ -52,7 +74,7 @@ gems: source: type: git name: ruby/gem_rbs_collection - revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems - name: rainbow @@ -60,7 +82,43 @@ gems: source: type: git name: ruby/gem_rbs_collection - revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: rake + version: '13.0' + source: + type: git + name: ruby/gem_rbs_collection + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: regexp_parser + version: '2.8' + source: + type: git + name: ruby/gem_rbs_collection + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: ripper + version: '0' + source: + type: stdlib +- name: rubocop + version: '1.57' + source: + type: git + name: ruby/gem_rbs_collection + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: rubocop-ast + version: '1.30' + source: + type: git + name: ruby/gem_rbs_collection + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems - name: tempfile @@ -76,7 +134,7 @@ gems: source: type: git name: ruby/gem_rbs_collection - revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f + revision: 01361bb0fd6e2f3e2da2b11a733ffc938b9047c4 remote: https://github.com/ruby/gem_rbs_collection.git repo_dir: gems gemfile_lock_path: Gemfile.lock diff --git a/rb/sig/gems/open3/open3.rbs b/rb/sig/gems/open3/open3.rbs new file mode 100644 index 0000000000000..dc9904a99d157 --- /dev/null +++ b/rb/sig/gems/open3/open3.rbs @@ -0,0 +1,3 @@ +module Open3 + def self.capture3: (*untyped) -> untyped +end diff --git a/rb/sig/gems/rexml/document.rbs b/rb/sig/gems/rexml/document.rbs new file mode 100644 index 0000000000000..f8d9b4975827b --- /dev/null +++ b/rb/sig/gems/rexml/document.rbs @@ -0,0 +1,7 @@ +module REXML + class Document + def initialize: (untyped element) -> void + + def root: () -> untyped + end +end diff --git a/rb/sig/gems/rexml/xpath.rbs b/rb/sig/gems/rexml/xpath.rbs new file mode 100644 index 0000000000000..0a390e81d4c32 --- /dev/null +++ b/rb/sig/gems/rexml/xpath.rbs @@ -0,0 +1,5 @@ +module REXML + class XPath + def self.first: (untyped element, untyped path) -> untyped + end +end diff --git a/rb/sig/gems/websocket/handshake.rbs b/rb/sig/gems/websocket/handshake.rbs new file mode 100644 index 0000000000000..b040e994f6301 --- /dev/null +++ b/rb/sig/gems/websocket/handshake.rbs @@ -0,0 +1,7 @@ +module WebSocket + module Handshake + class Client + def initialize: (untyped) -> void + end + end +end diff --git a/rb/sig/gems/websocket/incoming.rbs b/rb/sig/gems/websocket/incoming.rbs new file mode 100644 index 0000000000000..1cd693a678b72 --- /dev/null +++ b/rb/sig/gems/websocket/incoming.rbs @@ -0,0 +1,9 @@ +module WebSocket + module Frame + class Incoming + class Client + def initialize: (untyped) -> void + end + end + end +end diff --git a/rb/sig/gems/websocket/outgoing.rbs b/rb/sig/gems/websocket/outgoing.rbs new file mode 100644 index 0000000000000..2d39c4483bdc0 --- /dev/null +++ b/rb/sig/gems/websocket/outgoing.rbs @@ -0,0 +1,9 @@ +module WebSocket + module Frame + class Outgoing + class Client + def initialize: (untyped) -> void + end + end + end +end diff --git a/rb/sig/gems/websocket/websocket.rbs b/rb/sig/gems/websocket/websocket.rbs new file mode 100644 index 0000000000000..03cbfaecf3ef4 --- /dev/null +++ b/rb/sig/gems/websocket/websocket.rbs @@ -0,0 +1,22 @@ +module WebSocket + DEFAULT_VERSION: Integer + ROOT: String + + # Defining autoloaded classes as interface or class is dependent on their implementation, + # which is not provided. Here, we'll declare them as modules, but they might need to be + # updated according to their actual definitions. + module Error + end + + module ExceptionHandler + end + + module Frame + end + + module Handshake + end + + module NiceInspect + end +end diff --git a/rb/sig/interfaces/action_builder.rbs b/rb/sig/interfaces/action_builder.rbs new file mode 100644 index 0000000000000..a26f787e4ccfe --- /dev/null +++ b/rb/sig/interfaces/action_builder.rbs @@ -0,0 +1,11 @@ +interface _ActionBuilder + def tick: (untyped) -> (nil | Array[Selenium::WebDriver::Interactions::InputDevice]) + + def device: (untyped) -> Selenium::WebDriver::Interactions::InputDevice + + def add_pointer_input: (Symbol kind, String name) -> ::Selenium::WebDriver::Interactions::PointerInput + + def add_key_input: (String key) -> ::Selenium::WebDriver::Interactions::KeyInput + + def add_wheel_input: (String name) -> ::Selenium::WebDriver::Interactions::InputDevice +end diff --git a/rb/sig/interfaces/bridge.rbs b/rb/sig/interfaces/bridge.rbs new file mode 100644 index 0000000000000..65b901248fda3 --- /dev/null +++ b/rb/sig/interfaces/bridge.rbs @@ -0,0 +1,3 @@ +interface _Bridge + def execute: (untyped command, ?Hash[untyped, untyped] opts, ?untyped? command_hash) -> untyped +end diff --git a/rb/sig/interfaces/clickable.rbs b/rb/sig/interfaces/clickable.rbs new file mode 100644 index 0000000000000..405bd0086aec7 --- /dev/null +++ b/rb/sig/interfaces/clickable.rbs @@ -0,0 +1,3 @@ +interface _Clickable + def click: (untyped) -> untyped +end diff --git a/rb/sig/interfaces/commands.rbs b/rb/sig/interfaces/commands.rbs new file mode 100644 index 0000000000000..876539899adcf --- /dev/null +++ b/rb/sig/interfaces/commands.rbs @@ -0,0 +1,3 @@ +interface _Commands + def commands: (untyped command) -> untyped +end diff --git a/rb/sig/interfaces/commands_list.rbs b/rb/sig/interfaces/commands_list.rbs new file mode 100644 index 0000000000000..356b9272bc188 --- /dev/null +++ b/rb/sig/interfaces/commands_list.rbs @@ -0,0 +1,3 @@ +interface _CommandList + def command_list: () -> untyped +end diff --git a/rb/sig/interfaces/define_method.rbs b/rb/sig/interfaces/define_method.rbs new file mode 100644 index 0000000000000..62eff9c38997f --- /dev/null +++ b/rb/sig/interfaces/define_method.rbs @@ -0,0 +1,3 @@ +interface _DefineMethod + def define_method: (untyped) { (untyped) -> untyped } -> untyped +end diff --git a/rb/sig/interfaces/devtools.rbs b/rb/sig/interfaces/devtools.rbs new file mode 100644 index 0000000000000..01b4ce39f1bc6 --- /dev/null +++ b/rb/sig/interfaces/devtools.rbs @@ -0,0 +1,11 @@ +interface _DevTools + def devtools: () -> untyped +end + +interface _ExecuteScript + def execute_script: (untyped, *untyped) -> untyped +end + +interface _FindElements + def find_elements: (untyped) -> untyped +end diff --git a/rb/sig/interfaces/driver.rbs b/rb/sig/interfaces/driver.rbs new file mode 100644 index 0000000000000..4089947d7abe4 --- /dev/null +++ b/rb/sig/interfaces/driver.rbs @@ -0,0 +1,17 @@ +interface _Driver + def capabilities: () -> untyped + + def devtools_url: () -> untyped + + def devtools_version: () -> untyped + + def devtools_address: () -> untyped + + def ref: () -> untyped + + def bridge: () -> untyped + + def browser: () -> untyped + + def service_url: (untyped service) -> untyped +end diff --git a/rb/sig/interfaces/features.rbs b/rb/sig/interfaces/features.rbs new file mode 100644 index 0000000000000..42d59006c7977 --- /dev/null +++ b/rb/sig/interfaces/features.rbs @@ -0,0 +1,3 @@ +interface _Features + def upload_if_necessary: (untyped keys) -> untyped +end diff --git a/rb/sig/interfaces/full_page_screenshot.rbs b/rb/sig/interfaces/full_page_screenshot.rbs new file mode 100644 index 0000000000000..d9c4bb4692077 --- /dev/null +++ b/rb/sig/interfaces/full_page_screenshot.rbs @@ -0,0 +1,5 @@ +interface _FullPageScreenshot + def full_screenshot: () -> untyped + + def screenshot: () -> untyped +end diff --git a/rb/sig/interfaces/local_storage.rbs b/rb/sig/interfaces/local_storage.rbs new file mode 100644 index 0000000000000..fc68ce0eda140 --- /dev/null +++ b/rb/sig/interfaces/local_storage.rbs @@ -0,0 +1,3 @@ +interface _LocalStorage + def keys: () -> untyped +end diff --git a/rb/sig/interfaces/options.rbs b/rb/sig/interfaces/options.rbs new file mode 100644 index 0000000000000..489d92faab385 --- /dev/null +++ b/rb/sig/interfaces/options.rbs @@ -0,0 +1,5 @@ +interface _Options + def enable_login: -> untyped + + def enable_logging: (untyped browser_options) -> untyped +end diff --git a/rb/sig/interfaces/platform.rbs b/rb/sig/interfaces/platform.rbs new file mode 100644 index 0000000000000..2c12f56d6c2bd --- /dev/null +++ b/rb/sig/interfaces/platform.rbs @@ -0,0 +1,3 @@ +interface _Platform + def unix?: () -> bool +end diff --git a/rb/sig/interfaces/profile.rbs b/rb/sig/interfaces/profile.rbs new file mode 100644 index 0000000000000..e802692900f4d --- /dev/null +++ b/rb/sig/interfaces/profile.rbs @@ -0,0 +1,3 @@ +interface _Profile + def layout_on_disk: () -> untyped +end diff --git a/rb/sig/interfaces/proxy.rbs b/rb/sig/interfaces/proxy.rbs new file mode 100644 index 0000000000000..c4c8923a04014 --- /dev/null +++ b/rb/sig/interfaces/proxy.rbs @@ -0,0 +1,23 @@ +interface _Proxy + def auto_detect: -> untyped + + def type: -> untyped + + def ftp: -> untyped + + def pac: -> untyped + + def http: -> untyped + + def ssl: -> untyped + + def socks: -> untyped + + def no_proxy: -> untyped + + def socks_password: -> untyped + + def socks_username: -> untyped + + def socks_version: -> untyped +end diff --git a/rb/sig/interfaces/take_screenshot.rbs b/rb/sig/interfaces/take_screenshot.rbs new file mode 100644 index 0000000000000..11bec497d6b13 --- /dev/null +++ b/rb/sig/interfaces/take_screenshot.rbs @@ -0,0 +1,3 @@ +interface _TakeScreenshot + def save_screenshot: (String png_path, ?full_page: bool full_page) -> untyped +end diff --git a/rb/sig/interfaces/target.rbs b/rb/sig/interfaces/target.rbs new file mode 100644 index 0000000000000..27930d3b44ff4 --- /dev/null +++ b/rb/sig/interfaces/target.rbs @@ -0,0 +1,7 @@ +interface _Target + def target: () -> untyped + + def getTarget: () -> Hash[untyped, untyped] + + def attach_to_target: (Hash[untyped, untyped]) -> untyped +end diff --git a/rb/sig/lib/selenium/devtools.rbs b/rb/sig/lib/selenium/devtools.rbs new file mode 100644 index 0000000000000..46dab49dd30dd --- /dev/null +++ b/rb/sig/lib/selenium/devtools.rbs @@ -0,0 +1,13 @@ +module Selenium + module DevTools + attr_accessor self.version: untyped + + def self.load_version: () -> untyped + + private + + def self.load_older_version: () -> untyped + + def self.load_old_version: (untyped version) -> untyped + end +end diff --git a/rb/sig/lib/selenium/devtools/support/cdp_client_generator.rbs b/rb/sig/lib/selenium/devtools/support/cdp_client_generator.rbs new file mode 100644 index 0000000000000..4999f692c928b --- /dev/null +++ b/rb/sig/lib/selenium/devtools/support/cdp_client_generator.rbs @@ -0,0 +1,37 @@ +module Selenium + module DevTools + module Support + class CDPClientGenerator + DIR: untyped + + @domain_template: untyped + + @loader_template: untyped + + @output_dir: untyped + + @loader_path: untyped + + @version: untyped + + DOMAIN_TEMPLATE_PATH: untyped + + LOADER_TEMPLATE_PATH: untyped + + RESERVED_KEYWORDS: Array[String] + + def call: (output_dir: untyped, version: untyped, **untyped opts) -> untyped + + def process_domain: (untyped domain) -> untyped + + def snake_case: (untyped string) -> untyped + + def kwargs: (untyped parameters) -> untyped + + def remove_empty_lines: (untyped string) -> untyped + + def process_loader: (untyped domains) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/server.rbs b/rb/sig/lib/selenium/server.rbs new file mode 100644 index 0000000000000..4ae361debc94b --- /dev/null +++ b/rb/sig/lib/selenium/server.rbs @@ -0,0 +1,80 @@ +module Selenium + class Server + self.@latest: untyped + + self.@available_assets: untyped + + @jar: untyped + + @host: untyped + + @role: untyped + + @port: untyped + + @timeout: untyped + + @background: untyped + + @additional_args: untyped + + @log: untyped + + @log_file: untyped + + @process: untyped + + @socket: untyped + + class Error < StandardError + end + + CL_RESET: untyped + + def self.get: (?Symbol required_version, ?Hash[untyped, untyped] opts) -> untyped + + def self.download: (?Symbol required_version) -> untyped + + def self.latest: () -> untyped + + def self.available_assets: () -> untyped + + def self.net_http_start: (untyped address) { () -> untyped } -> untyped + + def self.download_server: (untyped uri, untyped destination) -> untyped + + attr_accessor role: untyped + + attr_accessor host: untyped + + attr_accessor port: untyped + + attr_accessor timeout: untyped + + attr_accessor background: untyped + + attr_accessor log: untyped + + def initialize: (untyped jar, ?Hash[untyped, untyped] opts) -> void + + def start: () -> untyped + + def stop: () -> untyped + + def webdriver_url: () -> String + + def <<: (untyped arg) -> untyped + + private + + def stop_process: () -> untyped + + def process: () -> untyped + + def poll_for_service: () -> nil? + + def poll_for_shutdown: () -> nil? + + def socket: () -> untyped + end +end diff --git a/rb/sig/lib/selenium/support/nightly_version_generator.rbs b/rb/sig/lib/selenium/support/nightly_version_generator.rbs new file mode 100644 index 0000000000000..2070cd7767720 --- /dev/null +++ b/rb/sig/lib/selenium/support/nightly_version_generator.rbs @@ -0,0 +1,9 @@ +module Selenium + module Support + class NightlyVersionGenerator + REGEXP: Regexp + + def self.call: (untyped version_file, untyped version_suffix) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver.rbs b/rb/sig/lib/selenium/webdriver.rbs index 63e1f3bc11f91..147911acb6a0a 100644 --- a/rb/sig/lib/selenium/webdriver.rbs +++ b/rb/sig/lib/selenium/webdriver.rbs @@ -27,7 +27,7 @@ module Selenium def self.root: () -> String - def self.for: (*String args) -> WebDriver::Driver + def self.for: (*untyped args) -> untyped def self.logger: (**String | Symbol opts) -> WebDriver::Logger end diff --git a/rb/sig/lib/selenium/webdriver/atoms.rbs b/rb/sig/lib/selenium/webdriver/atoms.rbs index 0382de4bfd8d6..eacbd40132411 100644 --- a/rb/sig/lib/selenium/webdriver/atoms.rbs +++ b/rb/sig/lib/selenium/webdriver/atoms.rbs @@ -1,6 +1,11 @@ module Selenium module WebDriver module Atoms + include _Bridge + include _ExecuteScript + + def atom_script: (untyped) -> untyped + private def read_atom: (Symbol function) -> String diff --git a/rb/sig/lib/selenium/webdriver/bidi.rbs b/rb/sig/lib/selenium/webdriver/bidi.rbs new file mode 100644 index 0000000000000..e37040f4d9061 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi.rbs @@ -0,0 +1,21 @@ +module Selenium + module WebDriver + class BiDi + @ws: untyped + + @session: untyped + + def initialize: (url: untyped) -> void + + def close: () -> untyped + + def callbacks: () -> untyped + + def session: () -> untyped + + def send_cmd: (untyped method, **untyped params) -> untyped + + def error_message: (untyped message) -> ::String + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/browsing_context.rbs b/rb/sig/lib/selenium/webdriver/bidi/browsing_context.rbs new file mode 100644 index 0000000000000..a690a38221634 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/browsing_context.rbs @@ -0,0 +1,27 @@ +module Selenium + module WebDriver + class BiDi + class BrowsingContext + @bidi: untyped + + @id: untyped + + attr_accessor id: untyped + + READINESS_STATE: Hash[Symbol, String] + + def initialize: (driver: untyped, ?browsing_context_id: untyped?, ?type: untyped?, ?reference_context: untyped?) -> void + + def navigate: (url: untyped, ?readiness_state: untyped?) -> untyped + + def get_tree: (?max_depth: untyped?) -> untyped + + def close: () -> untyped + + private + + def create: (untyped type, untyped reference_context) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/browsing_context_info.rbs b/rb/sig/lib/selenium/webdriver/bidi/browsing_context_info.rbs new file mode 100644 index 0000000000000..1e0d12140f7ad --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/browsing_context_info.rbs @@ -0,0 +1,25 @@ +module Selenium + module WebDriver + class BiDi + class BrowsingContextInfo + @id: untyped + + @url: untyped + + @children: untyped + + @parent_browsing_context: untyped + + attr_accessor id: untyped + + attr_accessor url: untyped + + attr_accessor children: untyped + + attr_accessor parent_browsing_context: untyped + + def initialize: (id: untyped, url: untyped, children: untyped, parent_context: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/log/base_log_entry.rbs b/rb/sig/lib/selenium/webdriver/bidi/log/base_log_entry.rbs new file mode 100644 index 0000000000000..b68966f0d8102 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/log/base_log_entry.rbs @@ -0,0 +1,25 @@ +module Selenium + module WebDriver + class BiDi + class BaseLogEntry + @level: untyped + + @text: untyped + + @timestamp: untyped + + @stack_trace: untyped + + attr_accessor level: untyped + + attr_accessor text: untyped + + attr_accessor timestamp: untyped + + attr_accessor stack_trace: untyped + + def initialize: (level: untyped, text: untyped, timestamp: untyped, stack_trace: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/log/console_log_entry.rbs b/rb/sig/lib/selenium/webdriver/bidi/log/console_log_entry.rbs new file mode 100644 index 0000000000000..b0b1ca11d80b4 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/log/console_log_entry.rbs @@ -0,0 +1,21 @@ +module Selenium + module WebDriver + class BiDi + class ConsoleLogEntry < GenericLogEntry + @method: untyped + + @realm: untyped + + @args: untyped + + attr_accessor method: untyped + + attr_accessor realm: untyped + + attr_accessor args: untyped + + def initialize: (method: untyped, realm: untyped, args: untyped, **untyped opts) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/log/filter_by.rbs b/rb/sig/lib/selenium/webdriver/bidi/log/filter_by.rbs new file mode 100644 index 0000000000000..3937dd37c60f2 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/log/filter_by.rbs @@ -0,0 +1,15 @@ +module Selenium + module WebDriver + class BiDi + class FilterBy + @level: untyped + + attr_accessor level: untyped + + def initialize: (untyped level) -> void + + def self.log_level: (?untyped? level) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/log/generic_log_entry.rbs b/rb/sig/lib/selenium/webdriver/bidi/log/generic_log_entry.rbs new file mode 100644 index 0000000000000..71c98b0215e6b --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/log/generic_log_entry.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + class BiDi + class GenericLogEntry < BaseLogEntry + @type: untyped + + attr_accessor type: untyped + + def initialize: (level: untyped, text: untyped, timestamp: untyped, type: untyped, stack_trace: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/log/javascript_log_entry.rbs b/rb/sig/lib/selenium/webdriver/bidi/log/javascript_log_entry.rbs new file mode 100644 index 0000000000000..fdb88b70b5a56 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/log/javascript_log_entry.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + class BiDi + class JavascriptLogEntry < GenericLogEntry + @type: untyped + + attr_accessor type: untyped + + def initialize: (level: untyped, text: untyped, timestamp: untyped, type: untyped, stack_trace: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/log_inspector.rbs b/rb/sig/lib/selenium/webdriver/bidi/log_inspector.rbs new file mode 100644 index 0000000000000..565ec3aa46142 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/log_inspector.rbs @@ -0,0 +1,33 @@ +module Selenium + module WebDriver + class BiDi + class LogInspector + @bidi: untyped + + EVENTS: Hash[Symbol, String] + + LOG_LEVEL: Hash[Symbol, String] + + def initialize: (untyped driver, ?untyped? browsing_context_ids) -> void + + def on_console_entry: (?untyped? filter_by) { () -> untyped } -> untyped + + def on_javascript_log: (?untyped? filter_by) { () -> untyped } -> untyped + + def on_javascript_exception: () { () -> untyped } -> untyped + + def on_log: (?untyped? filter_by) { (untyped) -> untyped } -> untyped? + + private + + def on: (untyped event) { () -> untyped } -> untyped + + def check_valid_filter: (untyped filter_by) -> (nil | untyped) + + def console_log_events: (untyped params, untyped filter_by) { (untyped) -> untyped } -> untyped? + + def javascript_log_events: (untyped params, untyped filter_by) { (untyped) -> untyped } -> untyped? + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/navigate_result.rbs b/rb/sig/lib/selenium/webdriver/bidi/navigate_result.rbs new file mode 100644 index 0000000000000..54b4737e81c7c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/navigate_result.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + class BiDi + class NavigateResult + @url: untyped + + @navigation_id: untyped + + attr_accessor url: untyped + + attr_accessor navigation_id: untyped + + def initialize: (url: untyped, navigation_id: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/bidi/session.rbs b/rb/sig/lib/selenium/webdriver/bidi/session.rbs new file mode 100644 index 0000000000000..99b94c52afd5b --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/bidi/session.rbs @@ -0,0 +1,19 @@ +module Selenium + module WebDriver + class BiDi + class Session + @bidi: untyped + + Status: untyped + + def initialize: (untyped bidi) -> void + + def status: () -> untyped + + def subscribe: (untyped events, ?untyped? browsing_contexts) -> untyped + + def unsubscribe: (untyped events, ?untyped? browsing_contexts) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/chrome/driver.rbs b/rb/sig/lib/selenium/webdriver/chrome/driver.rbs new file mode 100644 index 0000000000000..92653102f9a90 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/chrome/driver.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Chrome + class Driver < Chromium::Driver + include LocalDriver + + def initialize: (?options: untyped?, ?service: untyped?, ?url: untyped?, **untyped opts) -> void + + def browser: () -> Symbol + + private + + def devtools_address: () -> String + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/chrome/features.rbs b/rb/sig/lib/selenium/webdriver/chrome/features.rbs index 71803ec58b589..a4523edc32d4b 100644 --- a/rb/sig/lib/selenium/webdriver/chrome/features.rbs +++ b/rb/sig/lib/selenium/webdriver/chrome/features.rbs @@ -4,7 +4,10 @@ module Selenium module Features include WebDriver::Chromium::Features - CHROME_COMMANDS: Hash[Symbol, Array[Symbol | String]] + CHROME_COMMANDS: untyped + COMMANDS: Array[Symbol | String] + + def command_list: -> untyped def commands: (Symbol command) -> Array[Symbol | String] end diff --git a/rb/sig/lib/selenium/webdriver/chrome/options.rbs b/rb/sig/lib/selenium/webdriver/chrome/options.rbs new file mode 100644 index 0000000000000..eae4c2feab36f --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/chrome/options.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Chrome + class Options < Chromium::Options + KEY: String + + BROWSER: String + + private + + def enable_logging: (untyped browser_options) -> untyped + + def binary_path: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/chrome/profile.rbs b/rb/sig/lib/selenium/webdriver/chrome/profile.rbs new file mode 100644 index 0000000000000..d5b2e2cff8736 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/chrome/profile.rbs @@ -0,0 +1,8 @@ +module Selenium + module WebDriver + module Chrome + class Profile < Chromium::Profile + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/chrome/service.rbs b/rb/sig/lib/selenium/webdriver/chrome/service.rbs new file mode 100644 index 0000000000000..a94d9c8d4900c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/chrome/service.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Chrome + class Service < WebDriver::Service + @log: untyped + + DEFAULT_PORT: Integer + + EXECUTABLE: String + + SHUTDOWN_SUPPORTED: bool + + def log: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/chromium/driver.rbs b/rb/sig/lib/selenium/webdriver/chromium/driver.rbs new file mode 100644 index 0000000000000..32353772c8251 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/chromium/driver.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module Chromium + class Driver < WebDriver::Driver + include _Driver + + EXTENSIONS: Array[untyped] + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/chromium/features.rbs b/rb/sig/lib/selenium/webdriver/chromium/features.rbs index 1442a25f92b97..a48cca64401fe 100644 --- a/rb/sig/lib/selenium/webdriver/chromium/features.rbs +++ b/rb/sig/lib/selenium/webdriver/chromium/features.rbs @@ -2,6 +2,8 @@ module Selenium module WebDriver module Chromium module Features + include _Bridge + CHROMIUM_COMMANDS: Hash[Symbol, Array[Symbol | String]] def commands: (Symbol command) -> Array[Symbol | String] @@ -32,7 +34,8 @@ module Selenium def available_log_types: () -> Array[Symbol] - def log: (untyped type) -> untyped + def log: (Symbol type) -> Array[Hash[String, untyped]] | + (Symbol type) -> Array[LogEntry] end end end diff --git a/rb/sig/lib/selenium/webdriver/chromium/options.rbs b/rb/sig/lib/selenium/webdriver/chromium/options.rbs new file mode 100644 index 0000000000000..9d0262127ce75 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/chromium/options.rbs @@ -0,0 +1,53 @@ +module Selenium + module WebDriver + module Chromium + class Options < WebDriver::Options + include _Options + + @profile: untyped + + @options: untyped + + @logging_prefs: untyped + + @encoded_extensions: untyped + + @extensions: untyped + + attr_accessor profile: untyped + + attr_accessor logging_prefs: untyped + + CAPABILITIES: Hash[Symbol, String] + + attr_reader extensions: untyped + + def initialize: (?profile: untyped?, **untyped opts) -> void + + def add_extension: (untyped path) -> untyped + + def extensions=: (untyped extensions) -> untyped + + def add_encoded_extension: (untyped encoded) -> untyped + + def add_argument: (untyped arg) -> untyped + + def add_preference: (untyped name, untyped value) -> untyped + + def add_emulation: (**untyped opts) -> untyped + + def enable_android: (?package: String, ?serial_number: untyped?, ?use_running_app: untyped?, ?activity: untyped?) -> untyped + + def process_browser_options: (untyped browser_options) -> untyped? + + def binary_path: () -> untyped + + def encode_extension: (untyped path) -> untyped + + def validate_extension: (untyped path) -> untyped + + def camelize?: (untyped key) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/chromium/profile.rbs b/rb/sig/lib/selenium/webdriver/chromium/profile.rbs new file mode 100644 index 0000000000000..f74507161c993 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/chromium/profile.rbs @@ -0,0 +1,45 @@ +module Selenium + module WebDriver + module Chromium + class Profile + @model: untyped + + @extensions: untyped + + @encoded_extensions: untyped + + @directory: untyped + + @prefs: untyped + + include ProfileHelper + + def initialize: (?untyped? model) -> void + + def add_extension: (untyped path) -> untyped + + def add_encoded_extension: (untyped encoded) -> untyped + + def directory: () -> untyped + + def []=: (untyped key, untyped value) -> untyped + + def []: (untyped key) -> untyped + + def layout_on_disk: () -> untyped + + def as_json: (*untyped) -> untyped + + private + + def write_prefs_to: (untyped dir) -> untyped + + def prefs: () -> untyped + + def read_model_prefs: () -> (Hash[untyped, untyped] | untyped) + + def prefs_file_for: (untyped dir) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common.rbs b/rb/sig/lib/selenium/webdriver/common.rbs new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/rb/sig/lib/selenium/webdriver/common/action_builder.rbs b/rb/sig/lib/selenium/webdriver/common/action_builder.rbs index fecf0e2a94201..7f1f95fa71db6 100644 --- a/rb/sig/lib/selenium/webdriver/common/action_builder.rbs +++ b/rb/sig/lib/selenium/webdriver/common/action_builder.rbs @@ -19,13 +19,13 @@ module Selenium def initialize: (Remote::Bridge bridge, ?devices: Array[Interactions::InputDevice], ?async: bool, ?duration: ::Integer) -> void - def add_pointer_input: (Symbol kind, String name) -> Interactions::PointerInput + def add_pointer_input: (Symbol kind, String name) -> Interactions::InputDevice - def add_key_input: (String name) -> Interactions::KeyInput + def add_key_input: (String name) -> Interactions::InputDevice - def add_wheel_input: (String name) -> Interactions::WheelInput + def add_wheel_input: (String name) -> Interactions::InputDevice - def device: (?name: String?, ?type: String?) -> Selenium::WebDriver::Interactions::InputDevice? + def device: (?name: String?, ?type: String?) -> Interactions::InputDevice? def pointer_inputs: () -> Array[Interactions::InputDevice] @@ -39,15 +39,15 @@ module Selenium def perform: () -> nil - def clear_all_actions: () -> [] + def clear_all_actions: () -> Array[Selenium::WebDriver::Interactions::InputDevice] def release_actions: () -> untyped private - def tick: (*Interactions::InputDevice action_devices) -> (nil | Array[Interactions::InputDevice]) + def tick: (*Interactions::InputDevice action_devices) -> Array[Interactions::InputDevice]? - def add_input: (Interactions::InputDevice | Symbol device) -> Interactions::InputDevice + def add_input: (Interactions::InputDevice | Symbol | interned device) -> Interactions::InputDevice end end end diff --git a/rb/sig/lib/selenium/webdriver/common/alert.rbs b/rb/sig/lib/selenium/webdriver/common/alert.rbs new file mode 100644 index 0000000000000..8c39da43f026c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/alert.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + class Alert + @bridge: untyped + + def initialize: (untyped bridge) -> void + + def accept: () -> untyped + + def dismiss: () -> untyped + + def send_keys: (untyped keys) -> untyped + + def text: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/child_process.rbs b/rb/sig/lib/selenium/webdriver/common/child_process.rbs new file mode 100644 index 0000000000000..69785847b71eb --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/child_process.rbs @@ -0,0 +1,51 @@ +module Selenium + module WebDriver + class ChildProcess + @command: untyped + + @detach: untyped + + @pid: untyped + + @status: untyped + + @io: untyped + + TimeoutError: untyped + + SIGTERM: String + + SIGKILL: String + + POLL_INTERVAL: Float + + attr_accessor detach: untyped + + attr_writer io: untyped + + def self.build: (*untyped command) -> untyped + + def initialize: (*untyped command) -> void + + def io: () -> untyped + + def start: () -> untyped + + def stop: (?Integer timeout) -> untyped + + def alive?: () -> untyped + + def exited?: () -> (false | untyped) + + def poll_for_exit: (untyped timeout) -> untyped + + def wait: () -> (nil | untyped) + + private + + def terminate: (untyped pid) -> untyped + + def kill: (untyped pid) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver.rbs b/rb/sig/lib/selenium/webdriver/common/driver.rbs index 8fd17389f9ba8..67f2a9017680f 100644 --- a/rb/sig/lib/selenium/webdriver/common/driver.rbs +++ b/rb/sig/lib/selenium/webdriver/common/driver.rbs @@ -5,9 +5,15 @@ module Selenium include TakesScreenshot - def self.for: (Symbol browser, ?::Hash[Symbol, untyped] opts) -> Driver + @bidi: untyped + @devtools: untyped + @navigate: untyped - def initialize: (?bridge: Remote::Bridge? bridge, ?listener: Support::AbstractEventListener? listener, **untyped opts) -> void + @service_manager: untyped + + def self.for: (untyped browser, Hash[untyped, untyped] opts) -> untyped + + def initialize: (?bridge: Support::EventFiringBridge? bridge, ?listener: Support::AbstractEventListener? listener, **untyped opts) -> void def inspect: () -> String @@ -59,15 +65,15 @@ module Selenium private - attr_reader bridge: Remote::Bridge + attr_reader bridge: untyped - def create_bridge: (caps: untyped caps, url: String url, ?http_client: untyped? http_client) -> untyped + def create_bridge: (caps: untyped, url: untyped, ?http_client: untyped) -> untyped def service_url: (untyped service) -> untyped def screenshot: () -> untyped - def add_extensions: (Symbol browser) -> untyped + def add_extensions: (String browser) -> void end end end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/downloads_files.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/downloads_files.rbs new file mode 100644 index 0000000000000..6490820f43a88 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/downloads_files.rbs @@ -0,0 +1,9 @@ +module Selenium + module WebDriver + module DriverExtensions + module DownloadsFiles + def download_path=: (untyped path) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rbs new file mode 100644 index 0000000000000..afb3d4c5c5037 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rbs @@ -0,0 +1,15 @@ +module Selenium + module WebDriver + module DriverExtensions + module FullPageScreenshot + include _TakeScreenshot + + def save_full_page_screenshot: (untyped path) -> untyped + + private + + def full_screenshot: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_addons.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_addons.rbs new file mode 100644 index 0000000000000..667618c91b798 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_addons.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasAddons + def install_addon: (untyped path, ?untyped? temporary) -> untyped + + def uninstall_addon: (untyped id) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rbs new file mode 100644 index 0000000000000..8d6bf51643e4c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasApplePermissions + def permissions: () -> untyped + + def permissions=: (untyped permissions) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_authentication.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_authentication.rbs new file mode 100644 index 0000000000000..2a61f10486165 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_authentication.rbs @@ -0,0 +1,19 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasAuthentication + include _DevTools + + @auth_handlers: untyped + + def register: (username: untyped, password: untyped, ?uri: untyped) -> untyped + + private + + def auth_handlers: () -> untyped + + def authenticate: (untyped request_id, untyped url) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_bidi.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_bidi.rbs new file mode 100644 index 0000000000000..0fed760bfb9d4 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_bidi.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasBiDi + include _Driver + + @bidi: untyped + + def bidi: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_cdp.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_cdp.rbs new file mode 100644 index 0000000000000..ab2b148f55a91 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_cdp.rbs @@ -0,0 +1,9 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasCDP + def execute_cdp: (untyped cmd, **untyped params) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_context.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_context.rbs new file mode 100644 index 0000000000000..deb8d8b60be2e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_context.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasContext + def context=: (untyped value) -> untyped + + def context: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_debugger.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_debugger.rbs new file mode 100644 index 0000000000000..7539fa6849648 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_debugger.rbs @@ -0,0 +1,9 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasDebugger + def attach_debugger: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_devtools.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_devtools.rbs new file mode 100644 index 0000000000000..01c7994c57707 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_devtools.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasDevTools + include _Driver + + @devtools: untyped + + def devtools: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rbs new file mode 100644 index 0000000000000..c939c6eed4795 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rbs @@ -0,0 +1,19 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasFileDownloads + include _Driver + + def downloadable_files: () -> untyped + + def download_file: (untyped file_name, untyped target_directory) -> untyped + + def delete_downloadable_files: () -> untyped + + private + + def verify_enabled: () -> (nil | untyped) + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_log_events.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_log_events.rbs new file mode 100644 index 0000000000000..2b3ffbb073208 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_log_events.rbs @@ -0,0 +1,35 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasLogEvents + include _ExecuteScript + include _FindElements + include _DevTools + + @log_listeners: untyped + + @mutation_listener: untyped + + include Atoms + + KINDS: Array[Symbol] + + def on_log_event: (untyped kind) { () -> untyped } -> (nil | untyped) + + private + + def log_listeners: () -> untyped + + def log_console_events: () -> untyped + + def log_exception_events: () -> untyped + + def log_mutation_events: () -> untyped + + def log_mutation_event: (untyped params) -> (nil | untyped) + + def mutation_listener: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_logs.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_logs.rbs new file mode 100644 index 0000000000000..fd42be72f967a --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_logs.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasLogs + @logs: untyped + + def logs: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rbs new file mode 100644 index 0000000000000..bd77ff746b2f4 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasNetworkConditions + def network_conditions: () -> untyped + + def network_conditions=: (untyped conditions) -> untyped + + def delete_network_conditions: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rbs new file mode 100644 index 0000000000000..ed03f3d6bd504 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasNetworkInterception + include _DevTools + + @interceptor: untyped + + def intercept: () { () -> untyped } -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_permissions.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_permissions.rbs new file mode 100644 index 0000000000000..1bcb52ec121dd --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_permissions.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasPermissions + def add_permission: (untyped name, untyped value) -> untyped + + def add_permissions: (untyped opt) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rbs new file mode 100644 index 0000000000000..e8fd66b9a8fd0 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasPinnedScripts + include _DevTools + + @pinned_scripts: untyped + + def pinned_scripts: () -> untyped + + def pin_script: (untyped script) -> untyped + + def unpin_script: (untyped script) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_session_id.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_session_id.rbs new file mode 100644 index 0000000000000..77a051910d151 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_session_id.rbs @@ -0,0 +1,9 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasSessionId + def session_id: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rbs new file mode 100644 index 0000000000000..fa3c0a0cf64b5 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module HasWebStorage + def local_storage: () -> untyped + + def session_storage: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/prints_page.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/prints_page.rbs new file mode 100644 index 0000000000000..f2578dde05b16 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/prints_page.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module PrintsPage + def save_print_page: (untyped path, **untyped options) -> untyped + + def print_page: (**untyped options) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_extensions/uploads_files.rbs b/rb/sig/lib/selenium/webdriver/common/driver_extensions/uploads_files.rbs new file mode 100644 index 0000000000000..89681963b5dd7 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_extensions/uploads_files.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module DriverExtensions + module UploadsFiles + include _Driver + + def file_detector=: (untyped detector) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/driver_finder.rbs b/rb/sig/lib/selenium/webdriver/common/driver_finder.rbs new file mode 100644 index 0000000000000..d012a5ec38f3c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/driver_finder.rbs @@ -0,0 +1,7 @@ +module Selenium + module WebDriver + class DriverFinder + def self.path: (untyped options, untyped klass) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/element.rbs b/rb/sig/lib/selenium/webdriver/common/element.rbs index 1867302ae2c5c..84f27e732d833 100644 --- a/rb/sig/lib/selenium/webdriver/common/element.rbs +++ b/rb/sig/lib/selenium/webdriver/common/element.rbs @@ -7,7 +7,7 @@ module Selenium include TakesScreenshot - def initialize: (Remote::Bridge bridge, String id) -> void + def initialize: (Remote::Bridge | Support::EventFiringBridge bridge, String id) -> void def inspect: () -> untyped @@ -21,7 +21,7 @@ module Selenium def tag_name: () -> untyped - def attribute: (String name) -> String? + def attribute: (String | Symbol name) -> String? def dom_attribute: (String name) -> String? diff --git a/rb/sig/lib/selenium/webdriver/common/error.rbs b/rb/sig/lib/selenium/webdriver/common/error.rbs new file mode 100644 index 0000000000000..cf084eaa6a4c3 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/error.rbs @@ -0,0 +1,105 @@ +module Selenium + module WebDriver + module Error + def self.for_error: (untyped error) -> untyped + + SUPPORT_MSG: String + + ERROR_URL: String + + class WebDriverError < StandardError + end + + class NoSuchElementError < WebDriverError + def initialize: (?String msg) -> void + end + + class NoSuchFrameError < WebDriverError + end + + class UnknownCommandError < WebDriverError + end + + class StaleElementReferenceError < WebDriverError + def initialize: (?String msg) -> void + end + + class DetachedShadowRootError < WebDriverError + end + + class InvalidElementStateError < WebDriverError + end + + class UnknownError < WebDriverError + end + + class JavascriptError < WebDriverError + end + + class TimeoutError < WebDriverError + end + + class NoSuchWindowError < WebDriverError + end + + class NoSuchShadowRootError < WebDriverError + end + + class InvalidCookieDomainError < WebDriverError + end + + class UnableToSetCookieError < WebDriverError + end + + class NoSuchAlertError < WebDriverError + end + + class ScriptTimeoutError < WebDriverError + end + + class InvalidSelectorError < WebDriverError + def initialize: (?::String msg) -> void + end + + class SessionNotCreatedError < WebDriverError + end + + class MoveTargetOutOfBoundsError < WebDriverError + end + + class ElementNotInteractableError < WebDriverError + end + + class InsecureCertificateError < WebDriverError + end + + class InvalidArgumentError < WebDriverError + end + + class NoSuchCookieError < WebDriverError + end + + class UnableToCaptureScreenError < WebDriverError + end + + class InvalidSessionIdError < WebDriverError + end + + class UnexpectedAlertOpenError < WebDriverError + end + + class UnknownMethodError < WebDriverError + end + + class ElementClickInterceptedError < WebDriverError + end + + class UnsupportedOperationError < WebDriverError + end + + class NoSuchDriverError < WebDriverError + def initialize: (?String msg) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/file_reaper.rbs b/rb/sig/lib/selenium/webdriver/common/file_reaper.rbs new file mode 100644 index 0000000000000..2b23277ec6542 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/file_reaper.rbs @@ -0,0 +1,21 @@ +module Selenium + module WebDriver + module FileReaper + self.@reap: untyped + + self.@tmp_files: untyped + + attr_writer self.reap: untyped + + def self.reap?: () -> untyped + + def self.tmp_files: () -> untyped + + def self.<<: (untyped file) -> untyped + + def self.reap: (untyped file) -> untyped? + + def self.reap!: () -> bool + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/html5/local_storage.rbs b/rb/sig/lib/selenium/webdriver/common/html5/local_storage.rbs new file mode 100644 index 0000000000000..4c3fe90b16c0e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/html5/local_storage.rbs @@ -0,0 +1,25 @@ +module Selenium + module WebDriver + module HTML5 + class LocalStorage + @bridge: untyped + + include SharedWebStorage + + def initialize: (untyped bridge) -> void + + def []: (untyped key) -> untyped + + def []=: (untyped key, untyped value) -> untyped + + def delete: (untyped key) -> untyped + + def clear: () -> untyped + + def size: () -> untyped + + def keys: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/html5/session_storage.rbs b/rb/sig/lib/selenium/webdriver/common/html5/session_storage.rbs new file mode 100644 index 0000000000000..4c05020d0b60a --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/html5/session_storage.rbs @@ -0,0 +1,27 @@ +module Selenium + module WebDriver + module HTML5 + class SessionStorage + @bridge: untyped + + include Enumerable[untyped] + + include SharedWebStorage + + def []: (untyped key) -> untyped + + def []=: (untyped key, untyped value) -> untyped + + def delete: (untyped key) -> untyped + + def clear: () -> untyped + + def size: () -> untyped + + def keys: () -> untyped + + def initialize: (untyped bridge) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/html5/shared_web_storage.rbs b/rb/sig/lib/selenium/webdriver/common/html5/shared_web_storage.rbs new file mode 100644 index 0000000000000..85a59dc19453c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/html5/shared_web_storage.rbs @@ -0,0 +1,24 @@ +module Selenium + module WebDriver + module HTML5 + module SharedWebStorage + include Enumerable[untyped] + include _LocalStorage + + def key?: (untyped key) -> untyped + + alias member? key? + + alias has_key? key? + + def fetch: (untyped key) ?{ (untyped) -> untyped } -> untyped + + def empty?: () -> untyped + + def each: () ?{ (untyped, untyped) -> untyped } -> untyped + + def []: (untyped key) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/input_device.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/input_device.rbs index 153405f4f6edb..01e8e62c8db42 100644 --- a/rb/sig/lib/selenium/webdriver/common/interactions/input_device.rbs +++ b/rb/sig/lib/selenium/webdriver/common/interactions/input_device.rbs @@ -16,11 +16,11 @@ module Selenium def add_action: (Interaction action) -> Array[Interaction] - def clear_actions: () -> [] + def clear_actions: () -> Array[untyped] - def create_pause: (Integer duration) -> Array[Interaction] + def create_pause: (Float duration) -> Array[Interaction] - def encode: () -> ({ type: String, id: String, actions: Array[untyped] } | nil) + def encode: () -> untyped end end end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/interactions.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/interactions.rbs new file mode 100644 index 0000000000000..6268f4f803fd2 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/interactions.rbs @@ -0,0 +1,27 @@ +module Selenium + module WebDriver + module Interactions + KEY: Symbol + + POINTER: Symbol + + NONE: Symbol + + WHEEL: Symbol + + def self.key: (?untyped? name) -> untyped + + def self.pointer: (?Symbol kind, ?name: untyped?) -> untyped + + def self.mouse: (?name: untyped?) -> untyped + + def self.pen: (?name: untyped?) -> untyped + + def self.touch: (?name: untyped?) -> untyped + + def self.none: (?untyped? name) -> untyped + + def self.wheel: (?untyped? name) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/key_actions.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/key_actions.rbs index 56125a973160d..f66890728d9ca 100644 --- a/rb/sig/lib/selenium/webdriver/common/interactions/key_actions.rbs +++ b/rb/sig/lib/selenium/webdriver/common/interactions/key_actions.rbs @@ -1,11 +1,14 @@ module Selenium module WebDriver module KeyActions - def key_down: (*Symbol | String | Element args, ?device: Symbol | String?) -> self + include _ActionBuilder + include _Clickable - def key_up: (*Symbol | String | Element args, ?device: Symbol | String?) -> self + def key_down: (*Symbol | String | Element args, ?device: Symbol | String?) -> KeyActions - def send_keys: (*Symbol | String | Element args, ?device: Symbol | String?) -> self + def key_up: (*Symbol | String | Element args, ?device: Symbol | String?) -> KeyActions + + def send_keys: (*untyped args, ?device: Symbol | String?) -> self private diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/none_input.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/none_input.rbs new file mode 100644 index 0000000000000..703445eb1504e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/none_input.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module Interactions + class NoneInput < InputDevice + @type: untyped + + def initialize: (?untyped? name) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/pause.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/pause.rbs new file mode 100644 index 0000000000000..08fe06dead86d --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/pause.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Interactions + class Pause < Interaction + @duration: untyped + + @type: untyped + + def initialize: (untyped source, ?untyped? duration) -> void + + def assert_source: (untyped source) -> untyped? + + def encode: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_actions.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_actions.rbs index e5d64f4e1e073..902222930637b 100644 --- a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_actions.rbs +++ b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_actions.rbs @@ -1,41 +1,43 @@ module Selenium module WebDriver module PointerActions + include _ActionBuilder + @default_move_duration: untyped attr_writer default_move_duration: Integer def default_move_duration: () -> Integer - def pointer_down: (?Symbol button, ?device: String | Symbol?, **Symbol | String opts) -> self + def pointer_down: (?Symbol button, ?device: String | Symbol?, **Symbol | String opts) -> PointerActions - def pointer_up: (?Symbol button, ?device: String | Symbol?, **Symbol | String opts) -> self + def pointer_up: (?Symbol button, ?device: String | Symbol?, **Symbol | String opts) -> PointerActions - def move_to: (Element element, ?Integer? right_by, ?Integer? down_by, **Symbol | String opts) -> self + def move_to: (Element element, ?Integer? right_by, ?Integer? down_by, **Symbol | String | nil opts) -> PointerActions - def move_by: (Integer right_by, Integer down_by, ?device: Symbol | String?, ?duration: Integer, **Symbol | String opts) -> self + def move_by: (Integer right_by, Integer down_by, ?device: Symbol | String?, ?duration: Integer, **Symbol | String opts) -> PointerActions - def move_to_location: (Integer x, Integer y, ?device: Symbol | String?, ?duration: Integer, **Symbol | String opts) -> self + def move_to_location: (Integer x, Integer y, ?device: Symbol | String?, ?duration: Integer, **Symbol | String opts) -> PointerActions - def click_and_hold: (?Element ?element, ?button: Symbol?, ?device: Symbol | String?) -> self + def click_and_hold: (?Element ?element, ?button: Symbol?, ?device: Symbol | String?) -> PointerActions - def release: (?button: Symbol?, ?device: Symbol | String?) -> self + def release: (?button: Symbol?, ?device: Symbol | String?) -> PointerActions - def click: (?Element ?element, ?button: Symbol?, ?device: Symbol | String?) -> self + def click: (?Element ?element, ?button: Symbol?, ?device: Symbol | String?) -> PointerActions - def double_click: (?Element? element, ?device: Symbol | String?) -> self + def double_click: (?Element? element, ?device: Symbol | String?) -> PointerActions - def context_click: (?Element? element, ?device: Symbol | String?) -> self + def context_click: (?Element? element, ?device: Symbol | String?) -> PointerActions - def drag_and_drop: (Element source, Element target, ?device: Symbol | String?) -> self + def drag_and_drop: (Element source, Element target, ?device: Symbol | String?) -> PointerActions - def drag_and_drop_by: (Element source, Integer right_by, Integer down_by, ?device: Symbol | String?) -> self + def drag_and_drop_by: (Element source, Integer right_by, Integer down_by, ?device: Symbol | String?) -> PointerActions private - def button_action: (Symbol button, Symbol action, ?device: Symbol | String?, **Symbol | String opts) -> self + def button_action: (Symbol button, Symbol action, ?device: Symbol | String?, **Symbol | String opts) -> PointerActions - def pointer_input: (?Symbol | String? name) -> Interactions::InputDevice + def pointer_input: (?Symbol | String? name) -> untyped end end end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_cancel.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_cancel.rbs new file mode 100644 index 0000000000000..567b10ccf25ed --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_cancel.rbs @@ -0,0 +1,15 @@ +module Selenium + module WebDriver + module Interactions + class PointerCancel < Interaction + @type: untyped + + def initialize: (untyped source) -> void + + def assert_source: (untyped source) -> untyped? + + def encode: () -> Hash[Symbol, untyped] + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_event_properties.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_event_properties.rbs new file mode 100644 index 0000000000000..4d60b65b18976 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_event_properties.rbs @@ -0,0 +1,15 @@ +module Selenium + module WebDriver + module Interactions + module PointerEventProperties + VALID: untyped + + def process_opts: () -> untyped + + private + + def assert_number: (untyped, untyped, ?untyped) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_input.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_input.rbs index fe94f36fec3c8..1f8eefe9bd898 100644 --- a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_input.rbs +++ b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_input.rbs @@ -16,7 +16,7 @@ module Selenium def assert_kind: (untyped pointer) -> untyped - def create_pointer_move: (?duration: ::Integer, ?x: ::Integer, ?y: ::Integer, ?origin: untyped?, **untyped opts) -> untyped + def create_pointer_move: (?duration: Symbol | String | Integer, ?x: Integer, ?y: Integer, ?origin: untyped?, **untyped opts) -> untyped def create_pointer_down: (untyped button, **untyped opts) -> untyped diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_move.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_move.rbs new file mode 100644 index 0000000000000..dbaac9737a23e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_move.rbs @@ -0,0 +1,33 @@ +module Selenium + module WebDriver + module Interactions + class PointerMove < Interaction + @duration: untyped + + @x_offset: untyped + + @y_offset: untyped + + @origin: untyped + + @type: untyped + + @opts: untyped + + include PointerEventProperties + + VIEWPORT: Symbol + + POINTER: Symbol + + ORIGINS: Array[untyped] + + def initialize: (untyped source, untyped duration, untyped x, untyped y, **untyped opts) -> void + + def assert_source: (untyped source) -> (untyped | nil) + + def encode: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/pointer_press.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_press.rbs new file mode 100644 index 0000000000000..65282108b03ea --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/pointer_press.rbs @@ -0,0 +1,33 @@ +module Selenium + module WebDriver + module Interactions + class PointerPress < Interaction + @direction: untyped + + @button: untyped + + @type: untyped + + @opts: untyped + + include PointerEventProperties + + BUTTONS: untyped + + DIRECTIONS: Hash[Symbol, Symbol] + + def initialize: (untyped source, untyped direction, untyped button, **untyped opts) -> void + + def encode: () -> untyped + + private + + def assert_source: (untyped source) -> untyped? + + def assert_button: (untyped button) -> untyped + + def assert_direction: (untyped direction) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/scroll.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/scroll.rbs new file mode 100644 index 0000000000000..2bae225339d54 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/scroll.rbs @@ -0,0 +1,27 @@ +module Selenium + module WebDriver + module Interactions + class Scroll < Interaction + @type: untyped + + @duration: untyped + + @origin: untyped + + @x_offset: untyped + + @y_offset: untyped + + @delta_x: untyped + + @delta_y: untyped + + def initialize: (source: untyped, ?origin: Symbol, ?duration: Float, **untyped opts) -> void + + def assert_source: (untyped source) -> untyped? + + def encode: () -> Hash[String, untyped] + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/interactions/wheel_actions.rbs b/rb/sig/lib/selenium/webdriver/common/interactions/wheel_actions.rbs new file mode 100644 index 0000000000000..91128affcc9f3 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/interactions/wheel_actions.rbs @@ -0,0 +1,26 @@ +module Selenium + module WebDriver + module WheelActions + include _ActionBuilder + include _Driver + + @default_scroll_duration: untyped + + attr_writer default_scroll_duration: untyped + + def default_scroll_duration: () -> untyped + + def scroll_to: (untyped element, ?device: untyped?) -> untyped + + def scroll_by: (untyped delta_x, untyped delta_y, ?device: untyped?) -> untyped + + def scroll_from: (untyped scroll_origin, untyped delta_x, untyped delta_y, ?device: untyped?) -> untyped + + private + + def scroll: (**untyped opts) -> self + + def wheel_input: (?untyped? name) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/keys.rbs b/rb/sig/lib/selenium/webdriver/common/keys.rbs new file mode 100644 index 0000000000000..9cf2b197a8a3b --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/keys.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module Keys + KEYS: Hash[Symbol, String] + + def self.[]: (untyped key) -> untyped + + def self.encode: (untyped keys) -> untyped + + def self.encode_key: (untyped key) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/local_driver.rbs b/rb/sig/lib/selenium/webdriver/common/local_driver.rbs new file mode 100644 index 0000000000000..ef1ac98c8feb9 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/local_driver.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + module LocalDriver + include _Driver + + def initialize_local_driver: (untyped options, untyped service, untyped url) -> Array[untyped] + + def process_options: (untyped options, untyped service) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/logger.rbs b/rb/sig/lib/selenium/webdriver/common/logger.rbs index 37fe4622e723e..0b8f39a33ca76 100644 --- a/rb/sig/lib/selenium/webdriver/common/logger.rbs +++ b/rb/sig/lib/selenium/webdriver/common/logger.rbs @@ -1,7 +1,6 @@ module Selenium module WebDriver class Logger - extend Forwardable @allowed: Array[Symbol] @first_warning: bool @@ -21,21 +20,23 @@ module Selenium def allow: (*Symbol | Array[Symbol] ids) -> Array[Symbol] - def debug: (String message, ?id: Symbol | Array[Symbol] id) ?{ () -> void } -> void + def debug: (String ?message, ?id: Symbol | Array[Symbol] id) ?{ () -> void } -> void def info: (String message, ?id: Symbol | Array[Symbol] id) ?{ () -> void } -> void - def error: (String message, ?id: Symbol | Array[Symbol] id) { () -> void } -> void + def error: (String message, ?id: Symbol | Array[Symbol] id) ?{ () -> void } -> void - def warn: (String message, ?id: Symbol | Array[Symbol] id) { () -> void } -> void + def warn: (String message, ?id: Symbol | Array[Symbol] id) ?{ () -> void } -> void - def deprecate: (String old, ?String? new, ?id: Symbol | Array[Symbol] id, ?reference: ::String reference) { () -> void } -> (void) + def deprecate: (String old, ?String? new, ?id: Symbol | Array[Symbol] id, ?reference: String reference) { () -> void } -> (void) + + def debug?: () -> bool private def create_logger: (String name, level: Symbol level) -> ::Logger - def discard_or_log: (Symbol level, String message, (::Symbol | ::Array[::Symbol]) | [(::Symbol | ::Array[::Symbol])] id) ?{ () -> void } -> (void) + def discard_or_log: (Symbol level, String message, (Symbol | Array[::Symbol]) | [(Symbol | Array[Symbol])] id) ?{ () -> void } -> (void) end end end diff --git a/rb/sig/lib/selenium/webdriver/common/logs.rbs b/rb/sig/lib/selenium/webdriver/common/logs.rbs new file mode 100644 index 0000000000000..b5974bfd0299b --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/logs.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + class Logs + @bridge: untyped + + def initialize: (untyped bridge) -> void + + def get: (untyped type) -> untyped + + def available_types: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/manager.rbs b/rb/sig/lib/selenium/webdriver/common/manager.rbs index 2c040a329ada1..bf61f3e18c4b4 100644 --- a/rb/sig/lib/selenium/webdriver/common/manager.rbs +++ b/rb/sig/lib/selenium/webdriver/common/manager.rbs @@ -1,7 +1,7 @@ module Selenium module WebDriver class Manager - attr_reader bridge: untyped + attr_reader bridge: Remote::Bridge @timeouts: Timeouts @@ -9,15 +9,15 @@ module Selenium def initialize: (Remote::Bridge bridge) -> void - def add_cookie: (?Hash[Symbol, untyped] opts) -> untyped + def add_cookie: (?Hash[Symbol, untyped] opts) -> void - def cookie_named: (String name) -> Hash[untyped, untyped]? + def cookie_named: (String name) -> Hash[Symbol, untyped] def delete_cookie: (String name) -> String - def delete_all_cookies: () -> untyped + def delete_all_cookies: () -> void - def all_cookies: () -> Array[Hash[untyped, untyped]] + def all_cookies: () -> Array[Hash[Symbol, untyped]] def timeouts: () -> Timeouts @@ -25,15 +25,15 @@ module Selenium private - SECONDS_PER_DAY: ::Float + SECONDS_PER_DAY: Float def datetime_at: (Integer int) -> Date - def seconds_from: (Time | DateTime | Numeric obj) -> (Time | Date | Numeric) + def seconds_from: (Time | DateTime | Numeric obj) -> (Float | Numeric) - def strip_port: (String str) -> (Array[String] | nil) + def strip_port: (String str) -> String? - def convert_cookie: (untyped cookie) -> { name: untyped, value: untyped, path: untyped, domain: untyped, expires: untyped, same_site: untyped, http_only: untyped, secure: untyped } + def convert_cookie: (Hash[String, untyped] cookie) -> Hash[Symbol, untyped] end end end diff --git a/rb/sig/lib/selenium/webdriver/common/options.rbs b/rb/sig/lib/selenium/webdriver/common/options.rbs new file mode 100644 index 0000000000000..ccb419b4f7902 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/options.rbs @@ -0,0 +1,65 @@ +module Selenium + module WebDriver + class Options + @options: untyped + + W3C_OPTIONS: Array[Symbol] + + GRID_OPTIONS: Array[Symbol] + + BROWSER: untyped + + KEY: untyped + + CAPABILITIES: Hash[Symbol, String] + + attr_reader self.driver_path: untyped + + def self.chrome: (**untyped opts) -> untyped + + def self.firefox: (**untyped opts) -> untyped + + def self.ie: (**untyped opts) -> untyped + + alias self.internet_explorer self.ie + + def self.edge: (**untyped opts) -> untyped + + alias self.microsoftedge self.edge + + def self.safari: (**untyped opts) -> untyped + + def self.set_capabilities: () -> untyped + + attr_accessor options: untyped + + def initialize: (**untyped opts) -> void + + def add_option: (untyped name, ?untyped? value) -> untyped + + def ==: (untyped other) -> (false | untyped) + + alias eql? == + + def as_json: (*untyped) -> untyped + + private + + def w3c?: (untyped key) -> untyped + + def process_w3c_options: (untyped options) -> untyped + + def process_browser_options: (untyped _browser_options) -> nil + + def camelize?: (untyped _key) -> true + + def generate_as_json: (untyped value, ?camelize_keys: bool) -> untyped + + def process_json_hash: (untyped value, untyped camelize_keys) -> untyped + + def convert_json_key: (untyped key, ?camelize: bool) -> untyped + + def camel_case: (untyped str) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/platform.rbs b/rb/sig/lib/selenium/webdriver/common/platform.rbs new file mode 100644 index 0000000000000..294c6a5110aec --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/platform.rbs @@ -0,0 +1,62 @@ +module Selenium + module WebDriver + # @api private + module Platform + @home: untyped + + @engine: untyped + + @os: untyped + + def self?.home: () -> untyped + + def self?.engine: () -> untyped + + def self?.os: () -> untyped + + def self?.ci: () -> Symbol? + + def self?.jruby?: () -> untyped + + def self?.truffleruby?: () -> untyped + + def self?.ruby_version: () -> untyped + + def self?.windows?: () -> untyped + + def self?.mac?: () -> untyped + + def self?.linux?: () -> untyped + + def self?.wsl?: () -> untyped + + def self?.cygwin?: () -> untyped + + def self?.null_device: () -> untyped + + def self?.wrap_in_quotes_if_necessary: (untyped str) -> (String | untyped) + + def self?.cygwin_path: (untyped path, **untyped opts) -> untyped + + def self?.unix_path: (untyped path) -> untyped + + def self?.windows_path: (untyped path) -> untyped + + def self?.make_writable: (untyped file) -> untyped + + def self?.assert_file: (untyped path) -> untyped? + + def self?.assert_executable: (untyped path) -> untyped? + + def self?.exit_hook: () { () -> untyped } -> untyped + + def self?.localhost: () -> untyped + + def self?.ip: () -> untyped + + def self?.interfaces: () -> untyped + + def unix?: -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/port_prober.rbs b/rb/sig/lib/selenium/webdriver/common/port_prober.rbs new file mode 100644 index 0000000000000..1d45cd15321d7 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/port_prober.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + class PortProber + def self.above: (untyped port) -> untyped + + IGNORED_ERRORS: untyped + + def self.free?: (untyped port) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/profile_helper.rbs b/rb/sig/lib/selenium/webdriver/common/profile_helper.rbs new file mode 100644 index 0000000000000..e6d952c6d4eb4 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/profile_helper.rbs @@ -0,0 +1,31 @@ +module Selenium + module WebDriver + module ProfileHelper + include _Profile + + def self.included: (untyped base) -> untyped + + def self.decoded: (untyped json) -> untyped + + def encoded: () -> untyped + + def as_json: (*untyped) -> Hash[String, untyped] + + def to_json: (*untyped) -> untyped + + private + + def create_tmp_copy: (untyped directory) -> untyped + + def verify_model: (untyped model) -> untyped? + + module ClassMethods + def from_json: (untyped json) -> untyped + + def new: (untyped directory) -> untyped + + def decoded: (untyped json) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/proxy.rbs b/rb/sig/lib/selenium/webdriver/common/proxy.rbs new file mode 100644 index 0000000000000..7b6156691e04a --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/proxy.rbs @@ -0,0 +1,67 @@ +module Selenium + module WebDriver + class Proxy + include _Proxy + + @ftp: untyped + + @http: untyped + + @no_proxy: untyped + + @ssl: untyped + + @pac: untyped + + @auto_detect: untyped + + @socks: untyped + + @socks_username: untyped + + @socks_password: untyped + + @socks_version: untyped + + @type: untyped + + TYPES: Hash[Symbol, String] + + ALLOWED: Hash[Symbol, String] + + def self.json_create: (untyped data) -> untyped? + + def initialize: (?::Hash[untyped, untyped] opts) -> void + + def ==: (untyped other) -> untyped + + alias eql? == + + def ftp=: (untyped value) -> untyped + + def http=: (untyped value) -> untyped + + def no_proxy=: (untyped value) -> untyped + + def ssl=: (untyped value) -> untyped + + def pac=: (untyped url) -> untyped + + def auto_detect=: (untyped bool) -> untyped + + def socks=: (untyped value) -> untyped + + def socks_username=: (untyped value) -> untyped + + def socks_password=: (untyped value) -> untyped + + def socks_version=: (untyped value) -> untyped + + def type=: (untyped type) -> untyped + + def as_json: (*untyped) -> untyped + + def to_json: (*untyped) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/search_context.rbs b/rb/sig/lib/selenium/webdriver/common/search_context.rbs index 36b4b4e1f45dd..5f8f227156cb6 100644 --- a/rb/sig/lib/selenium/webdriver/common/search_context.rbs +++ b/rb/sig/lib/selenium/webdriver/common/search_context.rbs @@ -1,6 +1,8 @@ module Selenium module WebDriver module SearchContext + include _Driver + FINDERS: untyped def find_element: (*untyped args) -> untyped diff --git a/rb/sig/lib/selenium/webdriver/common/selenium_manager.rbs b/rb/sig/lib/selenium/webdriver/common/selenium_manager.rbs new file mode 100644 index 0000000000000..df526c798dbe0 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/selenium_manager.rbs @@ -0,0 +1,28 @@ +module Selenium + module WebDriver + class SeleniumManager + include _Platform + include Open3 + + self.@bin_path: untyped + + self.@binary: untyped + + attr_writer self.bin_path: untyped + + def self.bin_path: () -> untyped + + def self.driver_path: (untyped options) -> untyped + + private + + def self.generate_command: (untyped binary, untyped options) -> untyped + + def self.binary: () -> untyped + + def self.validate_location: (untyped location) -> untyped + + def self.run: (*untyped command) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/service.rbs b/rb/sig/lib/selenium/webdriver/common/service.rbs new file mode 100644 index 0000000000000..a6abee02e79d2 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/service.rbs @@ -0,0 +1,59 @@ +module Selenium + module WebDriver + class Service + SHUTDOWN_SUPPORTED: untyped + + DEFAULT_PORT: untyped + + self.@driver_path: untyped + + @executable_path: untyped + + @host: untyped + + @port: untyped + + @log: untyped + + @args: untyped + + attr_reader self.driver_path: untyped + + def self.chrome: (**untyped opts) -> untyped + + def self.firefox: (**untyped opts) -> untyped + + def self.ie: (**untyped opts) -> untyped + + alias self.internet_explorer self.ie + + def self.edge: (**untyped opts) -> untyped + + alias self.microsoftedge self.edge + + alias self.msedge self.edge + + def self.safari: (**untyped opts) -> untyped + + def self.driver_path=: (untyped path) -> untyped + + attr_accessor host: untyped + + attr_accessor executable_path: untyped + + attr_accessor port: untyped + + attr_accessor log: untyped + + attr_accessor args: untyped + + alias extra_args args + + def initialize: (?path: untyped?, ?port: untyped?, ?log: untyped?, ?args: untyped?) -> void + + def launch: () -> untyped + + def shutdown_supported: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/service_manager.rbs b/rb/sig/lib/selenium/webdriver/common/service_manager.rbs new file mode 100644 index 0000000000000..d677aa1e58fdc --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/service_manager.rbs @@ -0,0 +1,61 @@ +module Selenium + module WebDriver + class ServiceManager + @executable_path: untyped + + @host: untyped + + @port: untyped + + @io: untyped + + @extra_args: untyped + + @shutdown_supported: untyped + + @uri: untyped + + @process: untyped + + @socket_lock: untyped + + START_TIMEOUT: Integer + + SOCKET_LOCK_TIMEOUT: Integer + + STOP_TIMEOUT: Integer + + def initialize: (untyped config) -> void + + def start: () -> untyped + + def stop: () -> untyped + + def uri: () -> untyped + + private + + def build_process: (*untyped command) -> untyped + + def connect_to_server: () { (untyped) -> untyped } -> untyped + + def find_free_port: () -> untyped + + def start_process: () -> untyped + + def stop_process: () -> (nil | untyped) + + def stop_server: () -> untyped + + def process_running?: () -> untyped + + def process_exited?: () -> untyped + + def connect_until_stable: () -> untyped? + + def cannot_connect_error_text: () -> String + + def socket_lock: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/socket_lock.rbs b/rb/sig/lib/selenium/webdriver/common/socket_lock.rbs new file mode 100644 index 0000000000000..4a806f52f805e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/socket_lock.rbs @@ -0,0 +1,27 @@ +module Selenium + module WebDriver + class SocketLock + @port: untyped + + @server: untyped + + @timeout: untyped + + def initialize: (untyped port, untyped timeout) -> void + + def locked: () { () -> untyped } -> untyped + + private + + def lock: () -> untyped? + + def current_time: () -> untyped + + def release: () -> untyped + + def can_lock?: () -> untyped + + def did_lock?: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/socket_poller.rbs b/rb/sig/lib/selenium/webdriver/common/socket_poller.rbs new file mode 100644 index 0000000000000..631b443064a31 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/socket_poller.rbs @@ -0,0 +1,37 @@ +module Selenium + module WebDriver + class SocketPoller + @host: untyped + + @port: untyped + + @timeout: untyped + + @interval: untyped + + def initialize: (untyped host, untyped port, ?::Integer timeout, ?::Float interval) -> void + + def connected?: () -> untyped + + def closed?: () -> untyped + + private + + CONNECT_TIMEOUT: Integer + + NOT_CONNECTED_ERRORS: Array[singleton(::Errno::ECONNREFUSED) | singleton(::Errno::ENOTCONN) | singleton(::Errno::EPERM)] + + CONNECTED_ERRORS: Array[singleton(::Errno::EISCONN) | singleton(::Errno::EINVAL) | singleton(::Errno::EALREADY)] + + def listening?: () -> untyped + + def socket_writable?: (untyped sock) -> untyped + + def conn_completed?: (untyped sock) -> untyped + + def with_timeout: () { () -> untyped } -> bool + + def current_time: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/takes_screenshot.rbs b/rb/sig/lib/selenium/webdriver/common/takes_screenshot.rbs index 3623848c69596..723b68e5427d8 100644 --- a/rb/sig/lib/selenium/webdriver/common/takes_screenshot.rbs +++ b/rb/sig/lib/selenium/webdriver/common/takes_screenshot.rbs @@ -1,9 +1,11 @@ module Selenium module WebDriver module TakesScreenshot + include _FullPageScreenshot + def save_screenshot: (String png_path, ?full_page: bool full_page) -> untyped - def screenshot_as: (Symbol format, ?full_page: bool full_page) -> String + def screenshot_as: (Symbol format, ?full_page: bool full_page) -> untyped end end end diff --git a/rb/sig/lib/selenium/webdriver/common/target_locator.rbs b/rb/sig/lib/selenium/webdriver/common/target_locator.rbs index 8f648f245c3c5..609989c2ca3d8 100644 --- a/rb/sig/lib/selenium/webdriver/common/target_locator.rbs +++ b/rb/sig/lib/selenium/webdriver/common/target_locator.rbs @@ -9,7 +9,7 @@ module Selenium def new_window: (?::Symbol `type`) { (untyped) -> untyped } -> untyped - def window: (untyped id) { () -> untyped } -> untyped + def window: (untyped id) ?{ () -> untyped } -> untyped def active_element: () -> Element diff --git a/rb/sig/lib/selenium/webdriver/common/virtual_authenticator/credential.rbs b/rb/sig/lib/selenium/webdriver/common/virtual_authenticator/credential.rbs new file mode 100644 index 0000000000000..b80c99be9aa73 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/virtual_authenticator/credential.rbs @@ -0,0 +1,45 @@ +module Selenium + module WebDriver + class Credential + @id: untyped + + @resident_credential: untyped + + @rp_id: untyped + + @user_handle: untyped + + @private_key: untyped + + @sign_count: untyped + + def self.resident: (**untyped opts) -> Credential + + def self.non_resident: (**untyped opts) -> Credential + + def self.encode: (untyped byte_array) -> untyped + + def self.decode: (untyped base64) -> untyped + + def self.from_json: (untyped opts) -> Credential + + attr_reader id: untyped + + attr_reader resident_credential: untyped + + attr_reader rp_id: untyped + + attr_reader user_handle: untyped + + attr_reader private_key: untyped + + attr_reader sign_count: untyped + + alias resident_credential? resident_credential + + def initialize: (id: untyped, resident_credential: untyped, rp_id: untyped, private_key: untyped, **untyped opts) -> void + + def as_json: (*untyped) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rbs b/rb/sig/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rbs new file mode 100644 index 0000000000000..6d58c1771928f --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rbs @@ -0,0 +1,45 @@ +module Selenium + module WebDriver + class VirtualAuthenticatorOptions + @protocol: untyped + + @transport: untyped + + @resident_key: untyped + + @user_verification: untyped + + @user_consenting: untyped + + @user_verified: untyped + + PROTOCOL: Hash[Symbol, String] + + TRANSPORT: Hash[Symbol, String] + + attr_accessor protocol: untyped + + attr_accessor transport: untyped + + attr_accessor resident_key: untyped + + attr_accessor user_verification: untyped + + attr_accessor user_consenting: untyped + + attr_accessor user_verified: untyped + + alias resident_key? resident_key + + alias user_verification? user_verification + + alias user_consenting? user_consenting + + alias user_verified? user_verified + + def initialize: (**untyped opts) -> void + + def as_json: (*untyped) -> Hash[String, untyped] + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/wait.rbs b/rb/sig/lib/selenium/webdriver/common/wait.rbs new file mode 100644 index 0000000000000..1e1c888a9edf2 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/wait.rbs @@ -0,0 +1,25 @@ +module Selenium + module WebDriver + class Wait + @timeout: Numeric + + @interval: Numeric + + @message: String + + @ignored: Array[Exception] + + DEFAULT_TIMEOUT: Integer + + DEFAULT_INTERVAL: Float + + def initialize: (Hash[untyped, untyped] opts) -> void + + def until: () { () -> untyped } -> untyped + + private + + def current_time: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/websocket_connection.rbs b/rb/sig/lib/selenium/webdriver/common/websocket_connection.rbs new file mode 100644 index 0000000000000..411f09d91e948 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/websocket_connection.rbs @@ -0,0 +1,67 @@ +module Selenium + module WebDriver + class WebSocketConnection + include WebSocket + + @callback_threads: untyped + + @session_id: untyped + + @url: untyped + + @socket_thread: untyped + + @callbacks: untyped + + @messages: untyped + + @incoming_frame: untyped + + @wait: untyped + + @socket: untyped + + @ws: untyped + + @id: untyped + + CONNECTION_ERRORS: Array[untyped] + + RESPONSE_WAIT_TIMEOUT: Integer + + RESPONSE_WAIT_INTERVAL: Float + + MAX_LOG_MESSAGE_SIZE: Integer + + def initialize: (url: untyped) -> void + + def close: () -> untyped + + def callbacks: () -> untyped + + def send_cmd: (**untyped payload) -> untyped + + private + + def messages: () -> untyped + + def process_handshake: () -> untyped + + def attach_socket_listener: () -> untyped + + def incoming_frame: () -> untyped + + def process_frame: (untyped frame) -> (Hash[untyped, untyped] | untyped) + + def callback_thread: (untyped params) { (untyped) -> untyped } -> untyped + + def wait: () -> untyped + + def socket: () -> untyped + + def ws: () -> untyped + + def next_id: () -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/common/zipper.rbs b/rb/sig/lib/selenium/webdriver/common/zipper.rbs new file mode 100644 index 0000000000000..090f02a7d49f3 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/common/zipper.rbs @@ -0,0 +1,19 @@ +module Selenium + module WebDriver + module Zipper + EXTENSIONS: Array[String] + + def self.unzip: (untyped path) -> untyped + + def self.zip: (untyped path) -> untyped + + def self.zip_file: (untyped path) -> untyped + + private + + def self.with_tmp_zip: () { () -> untyped } -> untyped + + def self.add_zip_entry: (untyped zip, untyped file, untyped entry_name) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/devtools.rbs b/rb/sig/lib/selenium/webdriver/devtools.rbs new file mode 100644 index 0000000000000..44db3c460745f --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/devtools.rbs @@ -0,0 +1,30 @@ +module Selenium + module WebDriver + class DevTools + include _DefineMethod + include _Target + + @ws: untyped + + @session_id: untyped + + def initialize: (url: untyped) -> void + + def close: () -> untyped + + def callbacks: () -> untyped + + def send_cmd: (untyped method, **untyped params) -> untyped + + def method_missing: (untyped method, *untyped _args) -> untyped? + + def respond_to_missing?: (untyped method, *untyped _args) -> untyped + + private + + def start_session: () -> untyped + + def error_message: (untyped error) -> untyped + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/devtools/console_event.rbs b/rb/sig/lib/selenium/webdriver/devtools/console_event.rbs new file mode 100644 index 0000000000000..60cbaa68a11c4 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/devtools/console_event.rbs @@ -0,0 +1,21 @@ +module Selenium + module WebDriver + class DevTools + class ConsoleEvent + @type: untyped + + @timestamp: untyped + + @args: untyped + + attr_accessor type: untyped + + attr_accessor timestamp: untyped + + attr_accessor args: untyped + + def initialize: (type: untyped, timestamp: untyped, args: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/devtools/exception_event.rbs b/rb/sig/lib/selenium/webdriver/devtools/exception_event.rbs new file mode 100644 index 0000000000000..a4eac54cc06c9 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/devtools/exception_event.rbs @@ -0,0 +1,21 @@ +module Selenium + module WebDriver + class DevTools + class ExceptionEvent + @description: untyped + + @timestamp: untyped + + @stacktrace: untyped + + attr_accessor description: untyped + + attr_accessor timestamp: untyped + + attr_accessor stacktrace: untyped + + def initialize: (description: untyped, timestamp: untyped, stacktrace: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/devtools/mutation_event.rbs b/rb/sig/lib/selenium/webdriver/devtools/mutation_event.rbs new file mode 100644 index 0000000000000..5045962130077 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/devtools/mutation_event.rbs @@ -0,0 +1,25 @@ +module Selenium + module WebDriver + class DevTools + class MutationEvent + @element: untyped + + @attribute_name: untyped + + @current_value: untyped + + @old_value: untyped + + attr_accessor element: untyped + + attr_accessor attribute_name: untyped + + attr_accessor current_value: untyped + + attr_accessor old_value: untyped + + def initialize: (element: untyped, attribute_name: untyped, current_value: untyped, old_value: untyped) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/devtools/network_interceptor.rbs b/rb/sig/lib/selenium/webdriver/devtools/network_interceptor.rbs new file mode 100644 index 0000000000000..0e3333c40400f --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/devtools/network_interceptor.rbs @@ -0,0 +1,57 @@ +module Selenium + module WebDriver + class DevTools + class NetworkInterceptor + @devtools: untyped + + @lock: untyped + + @pending_response_requests: untyped + + @cancelled_requests: untyped + + CANNOT_GET_BODY_ON_REDIRECT_ERROR_CODE: String + + INVALID_INTERCEPTION_ID_ERROR_CODE: String + + def initialize: (untyped devtools) -> void + + def intercept: () { () -> untyped } -> untyped + + private + + attr_accessor devtools: untyped + + attr_accessor lock: untyped + + def pending_response_requests: () -> untyped + + def cancelled_requests: () -> untyped + + def track_cancelled_request: (untyped data) -> untyped? + + def request_paused: (untyped data) { () -> untyped } -> untyped + + def response?: (untyped params) -> untyped + + def intercept_request: (untyped id, untyped params) { () -> untyped } -> untyped + + def intercept_response: (untyped id, untyped params) ?{ (untyped) -> untyped } -> untyped + + def continue_request: (untyped id) -> untyped + + alias continue_response continue_request + + def mutate_request: (untyped request) -> untyped + + def mutate_response: (untyped response) -> untyped + + def fetch_response_body: (untyped id) -> untyped + + def with_cancellable_request: (untyped network_id) { () -> untyped } -> untyped + + def cancelled?: (untyped network_id) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/devtools/pinned_script.rbs b/rb/sig/lib/selenium/webdriver/devtools/pinned_script.rbs new file mode 100644 index 0000000000000..59416ef9f151d --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/devtools/pinned_script.rbs @@ -0,0 +1,25 @@ +module Selenium + module WebDriver + class DevTools + class PinnedScript + @key: untyped + + @script: untyped + + attr_accessor key: untyped + + attr_accessor devtools_identifier: untyped + + attr_accessor script: untyped + + def initialize: (untyped script) -> void + + def callable: () -> String + + def to_json: (*untyped) -> String + + def remove: () -> String + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/devtools/request.rbs b/rb/sig/lib/selenium/webdriver/devtools/request.rbs new file mode 100644 index 0000000000000..885928373d01d --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/devtools/request.rbs @@ -0,0 +1,35 @@ +module Selenium + module WebDriver + class DevTools + class Request + @id: untyped + + @url: untyped + + @method: untyped + + @headers: untyped + + @post_data: untyped + + attr_accessor url: untyped + + attr_accessor method: untyped + + attr_accessor headers: untyped + + attr_accessor post_data: untyped + + attr_reader id: untyped + + def self.from: (untyped id, untyped params) -> untyped + + def initialize: (id: untyped, url: untyped, method: untyped, headers: untyped, post_data: untyped) -> void + + def ==: (untyped other) -> untyped + + def inspect: () -> String + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/edge/driver.rbs b/rb/sig/lib/selenium/webdriver/edge/driver.rbs new file mode 100644 index 0000000000000..3f0886323a0ab --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/edge/driver.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Edge + class Driver < Chromium::Driver + include LocalDriver + + def initialize: (?options: untyped?, ?service: untyped?, ?url: untyped?, **untyped opts) -> void + + def browser: () -> :edge + + private + + def devtools_address: () -> String + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/edge/features.rbs b/rb/sig/lib/selenium/webdriver/edge/features.rbs index be01c16cf4ea7..accea1a33ad58 100644 --- a/rb/sig/lib/selenium/webdriver/edge/features.rbs +++ b/rb/sig/lib/selenium/webdriver/edge/features.rbs @@ -6,6 +6,10 @@ module Selenium EDGE_COMMANDS: Hash[Symbol, Array[Symbol | String]] + COMMANDS: untyped + + def command_list: -> untyped + def commands: (untyped command) -> untyped end end diff --git a/rb/sig/lib/selenium/webdriver/edge/options.rbs b/rb/sig/lib/selenium/webdriver/edge/options.rbs new file mode 100644 index 0000000000000..eac25a8adaccd --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/edge/options.rbs @@ -0,0 +1,19 @@ +module Selenium + module WebDriver + module Edge + class Options < Chromium::Options + KEY: String + + BROWSER: String + + def webview2!: () -> untyped + + private + + def enable_logging: (untyped browser_options) -> untyped + + def binary_path: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/edge/profile.rbs b/rb/sig/lib/selenium/webdriver/edge/profile.rbs new file mode 100644 index 0000000000000..89a91fe55fa8b --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/edge/profile.rbs @@ -0,0 +1,8 @@ +module Selenium + module WebDriver + module Edge + class Profile < Chromium::Profile + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/edge/service.rbs b/rb/sig/lib/selenium/webdriver/edge/service.rbs new file mode 100644 index 0000000000000..9723e6548efed --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/edge/service.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Edge + class Service < WebDriver::Service + @log: untyped + + DEFAULT_PORT: Integer + + EXECUTABLE: String + + SHUTDOWN_SUPPORTED: bool + + def log: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/firefox/driver.rbs b/rb/sig/lib/selenium/webdriver/firefox/driver.rbs new file mode 100644 index 0000000000000..7dd993e287aaf --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/firefox/driver.rbs @@ -0,0 +1,21 @@ +module Selenium + module WebDriver + module Firefox + class Driver < WebDriver::Driver + EXTENSIONS: Array[untyped] + + include LocalDriver + + def initialize: (?options: untyped?, ?service: untyped?, ?url: untyped?, **untyped opts) -> void + + def browser: () -> Symbol + + private + + def devtools_url: () -> untyped + + def devtools_version: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/firefox/extension.rbs b/rb/sig/lib/selenium/webdriver/firefox/extension.rbs new file mode 100644 index 0000000000000..0a4979c72b63c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/firefox/extension.rbs @@ -0,0 +1,31 @@ +module Selenium + module WebDriver + module Firefox + class Extension + @path: untyped + + @should_reap_root: untyped + + NAMESPACE: String + + def initialize: (untyped path) -> void + + def write_to: (untyped extensions_dir) -> untyped + + private + + def create_root: () -> untyped + + def read_id: (untyped directory) -> untyped + + def read_id_from_install_rdf: (untyped directory) -> untyped? + + def read_id_from_manifest_json: (untyped directory) -> untyped? + + def applications_gecko_id: (untyped manifest) -> untyped + + def name_and_version: (untyped manifest) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/firefox/features.rbs b/rb/sig/lib/selenium/webdriver/firefox/features.rbs index 8957c9215b0ab..c8d12b93d50c1 100644 --- a/rb/sig/lib/selenium/webdriver/firefox/features.rbs +++ b/rb/sig/lib/selenium/webdriver/firefox/features.rbs @@ -2,8 +2,12 @@ module Selenium module WebDriver module Firefox module Features + include _Bridge + COMMANDS: Hash[Symbol, Array[Symbol | String]] FIREFOX_COMMANDS: Hash[Symbol, Array[Symbol | String]] + def command_list: -> untyped + def commands: (untyped command) -> untyped def install_addon: (untyped path, untyped temporary) -> untyped diff --git a/rb/sig/lib/selenium/webdriver/firefox/options.rbs b/rb/sig/lib/selenium/webdriver/firefox/options.rbs new file mode 100644 index 0000000000000..d4087e414024c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/firefox/options.rbs @@ -0,0 +1,43 @@ +module Selenium + module WebDriver + module Firefox + class Options < WebDriver::Options + @debugger_address: untyped + + @profile: untyped + + attr_accessor debugger_address: untyped + + KEY: String + + CAPABILITIES: Hash[Symbol, String] + + BROWSER: String + + attr_reader profile: untyped + + def initialize: (?log_level: untyped?, **untyped opts) -> void + + def add_argument: (untyped arg) -> untyped + + def add_preference: (untyped name, untyped value) -> untyped + + def profile=: (untyped profile) -> untyped + + def log_level: () -> untyped + + def log_level=: (untyped level) -> untyped + + def enable_android: (?package: ::String, ?serial_number: untyped?, ?activity: untyped?, ?intent_arguments: untyped?) -> untyped + + private + + def process_browser_options: (untyped browser_options) -> untyped + + def process_profile: (untyped profile) -> untyped + + def camelize?: (untyped key) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/firefox/profile.rbs b/rb/sig/lib/selenium/webdriver/firefox/profile.rbs new file mode 100644 index 0000000000000..58b936249a5c0 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/firefox/profile.rbs @@ -0,0 +1,77 @@ +module Selenium + module WebDriver + module Firefox + class Profile + WEBDRIVER_PREFS: untyped + + self.@ini: untyped + + @model: untyped + + @additional_prefs: untyped + + @extensions: untyped + + @log_file: untyped + + include ProfileHelper + + VALID_PREFERENCE_TYPES: Array[untyped] + + DEFAULT_PREFERENCES: Hash[String, bool | String] + + LOCK_FILES: Array[String] + + attr_reader name: untyped + + attr_reader log_file: untyped + + attr_writer secure_ssl: untyped + + attr_writer load_no_focus_lib: untyped + + def self.ini: () -> untyped + + def self.from_name: (untyped name) -> untyped + + def self.decoded: (untyped json) -> untyped + + def initialize: (?untyped? model) -> void + + def layout_on_disk: () -> untyped + + def []=: (untyped key, untyped value) -> untyped + + def port=: (untyped port) -> untyped + + def log_file=: (untyped file) -> untyped + + def add_extension: (untyped path, ?untyped name) -> untyped + + def proxy=: (untyped proxy) -> untyped + + alias as_json encoded + + private + + def set_manual_proxy_preference: (untyped key, untyped value) -> untyped? + + def install_extensions: (untyped directory) -> untyped + + def read_model_prefs: () -> (Hash[untyped, untyped] | untyped) + + def delete_extensions_cache: (untyped directory) -> untyped + + def delete_lock_files: (untyped directory) -> untyped + + def extension_name_for: (untyped path) -> untyped + + def update_user_prefs_in: (untyped directory) -> untyped + + def read_user_prefs: (untyped path) -> untyped + + def write_prefs: (untyped prefs, untyped path) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/firefox/profiles_ini.rbs b/rb/sig/lib/selenium/webdriver/firefox/profiles_ini.rbs new file mode 100644 index 0000000000000..09c93bd8bd597 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/firefox/profiles_ini.rbs @@ -0,0 +1,23 @@ +module Selenium + module WebDriver + module Firefox + class ProfilesIni + @ini_path: untyped + + @profile_paths: untyped + + def initialize: () -> void + + def []: (untyped name) -> untyped + + def refresh: () -> untyped + + private + + def parse: () -> untyped + + def path_for: (untyped name, untyped is_relative, untyped path) -> untyped? + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/firefox/service.rbs b/rb/sig/lib/selenium/webdriver/firefox/service.rbs new file mode 100644 index 0000000000000..85073c264be3c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/firefox/service.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module Firefox + class Service < WebDriver::Service + DEFAULT_PORT: 4444 + + EXECUTABLE: "geckodriver" + + SHUTDOWN_SUPPORTED: false + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/firefox/util.rbs b/rb/sig/lib/selenium/webdriver/firefox/util.rbs new file mode 100644 index 0000000000000..42b3b6d458022 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/firefox/util.rbs @@ -0,0 +1,12 @@ +module Selenium + module WebDriver + module Firefox + # @api private + module Util + def self?.app_data_path: () -> untyped + + def self?.stringified?: (untyped str) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/ie.rbs b/rb/sig/lib/selenium/webdriver/ie.rbs new file mode 100644 index 0000000000000..eb522c21b17be --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/ie.rbs @@ -0,0 +1,6 @@ +module Selenium + module WebDriver + module IE + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/ie/driver.rbs b/rb/sig/lib/selenium/webdriver/ie/driver.rbs new file mode 100644 index 0000000000000..53e9dbec58810 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/ie/driver.rbs @@ -0,0 +1,15 @@ +module Selenium + module WebDriver + module IE + class Driver < WebDriver::Driver + EXTENSIONS: Array[untyped] + + include LocalDriver + + def initialize: (?options: untyped?, ?service: untyped?, ?url: untyped?, **untyped opts) -> void + + def browser: () -> Symbol + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/ie/features.rbs b/rb/sig/lib/selenium/webdriver/ie/features.rbs new file mode 100644 index 0000000000000..301366c839b20 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/ie/features.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module IE + module Features + COMMANDS: untyped + + def command_list: () -> untyped + + def commands: (untyped command) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/ie/options.rbs b/rb/sig/lib/selenium/webdriver/ie/options.rbs new file mode 100644 index 0000000000000..da1a303265adf --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/ie/options.rbs @@ -0,0 +1,29 @@ +module Selenium + module WebDriver + module IE + class Options < WebDriver::Options + @args: untyped + + KEY: String + + SCROLL_TOP: Integer + + SCROLL_BOTTOM: Integer + + CAPABILITIES: Hash[Symbol, String] + + BROWSER: String + + attr_reader args: untyped + + def initialize: (**untyped opts) -> void + + def add_argument: (untyped arg) -> untyped + + private + + def process_browser_options: (untyped browser_options) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/ie/service.rbs b/rb/sig/lib/selenium/webdriver/ie/service.rbs new file mode 100644 index 0000000000000..94f9d492a292f --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/ie/service.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module IE + class Service < WebDriver::Service + DEFAULT_PORT: Integer + + EXECUTABLE: String + + SHUTDOWN_SUPPORTED: bool + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/bridge.rbs b/rb/sig/lib/selenium/webdriver/remote/bridge.rbs index 936c06ca4b54e..a303ec5316006 100644 --- a/rb/sig/lib/selenium/webdriver/remote/bridge.rbs +++ b/rb/sig/lib/selenium/webdriver/remote/bridge.rbs @@ -2,6 +2,9 @@ module Selenium module WebDriver module Remote class Bridge + include _CommandList + include _Features + @http: untyped @file_detector: untyped @@ -226,7 +229,7 @@ module Selenium private - def execute: (untyped command, ?::Hash[untyped, untyped] opts, ?untyped? command_hash) -> untyped + def execute: (untyped command, ?::Hash[untyped, untyped] opts, ?untyped? command_hash) -> WebDriver::Remote::Response def escaper: () -> untyped diff --git a/rb/sig/lib/selenium/webdriver/remote/bridge/commands.rbs b/rb/sig/lib/selenium/webdriver/remote/bridge/commands.rbs new file mode 100644 index 0000000000000..35ea169749162 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/bridge/commands.rbs @@ -0,0 +1,9 @@ +module Selenium + module WebDriver + module Remote + class Bridge + COMMANDS: Hash[Symbol, Array[Symbol | String]] + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/capabilities.rbs b/rb/sig/lib/selenium/webdriver/remote/capabilities.rbs new file mode 100644 index 0000000000000..d562c1ee76dc1 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/capabilities.rbs @@ -0,0 +1,71 @@ +module Selenium + module WebDriver + module Remote + class Capabilities + @capabilities: untyped + + KNOWN: Array[Symbol] + + def self.always_match: (untyped capabilities) -> untyped + + def self.first_match: (*untyped capabilities) -> untyped + + def self.json_create: (untyped data) -> untyped + + def self.camel_case: (untyped str_or_sym) -> untyped + + private + + def self.process_timeouts: (untyped caps, untyped timeouts) -> untyped? + + public + + def initialize: (?::Hash[untyped, untyped] opts) -> void + + def []=: (untyped key, untyped value) -> untyped + + def []: (untyped key) -> untyped + + def merge!: (untyped other) -> untyped + + def proxy: () -> untyped + + def proxy=: (untyped proxy) -> untyped + + def timeouts: () -> untyped + + def timeouts=: (untyped timeouts) -> untyped + + def implicit_timeout: () -> untyped + + def implicit_timeout=: (untyped timeout) -> untyped + + def page_load_timeout: () -> untyped + + def page_load_timeout=: (untyped timeout) -> untyped + + def script_timeout: () -> untyped + + def script_timeout=: (untyped timeout) -> untyped + + def as_json: (*untyped) -> untyped + + def to_json: (*untyped) -> untyped + + def ==: (untyped other) -> (bool | untyped) + + alias eql? == + + attr_reader capabilities: untyped + + private + + def process_capabilities: (untyped key, untyped value, untyped hash) -> untyped + + def convert_key: (untyped key) -> untyped + + def convert_value: (untyped key, untyped value) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/driver.rbs b/rb/sig/lib/selenium/webdriver/remote/driver.rbs new file mode 100644 index 0000000000000..09a7f48693a3e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/driver.rbs @@ -0,0 +1,25 @@ +module Selenium + module WebDriver + module Remote + class Driver < WebDriver::Driver + include DriverExtensions::UploadsFiles + + include DriverExtensions::HasSessionId + + include DriverExtensions::HasFileDownloads + + def initialize: (?capabilities: untyped?, ?options: untyped?, ?service: untyped?, ?url: untyped?, **untyped opts) -> void + + private + + def devtools_url: () -> untyped + + def devtools_version: () -> untyped + + def process_options: (untyped options, untyped capabilities) -> untyped + + def generate_capabilities: (untyped capabilities) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/features.rbs b/rb/sig/lib/selenium/webdriver/remote/features.rbs new file mode 100644 index 0000000000000..88034663b568b --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/features.rbs @@ -0,0 +1,29 @@ +module Selenium + module WebDriver + module Remote + module Features + include _Bridge + + @command_list: untyped + + REMOTE_COMMANDS: Hash[Symbol, Array[Symbol | String]] + + def add_commands: (untyped commands) -> untyped + + def command_list: () -> Hash[Symbol, Array[Symbol | String]] + + def commands: (Symbol command) -> Array[Symbol | String]? + + def upload: (untyped local_file) -> untyped + + def upload_if_necessary: (untyped keys) -> untyped + + def downloadable_files: () -> untyped + + def download_file: (untyped name) -> untyped + + def delete_downloadable_files: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/http/common.rbs b/rb/sig/lib/selenium/webdriver/remote/http/common.rbs new file mode 100644 index 0000000000000..3e1e2ecc26be3 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/http/common.rbs @@ -0,0 +1,31 @@ +module Selenium + module WebDriver + module Remote + module Http + class Common + MAX_REDIRECTS: Integer + + CONTENT_TYPE: String + + DEFAULT_HEADERS: Hash[String, untyped] + + attr_writer server_url: untyped + + def quit_errors: () -> Array[untyped] + + def close: () -> untyped + + def call: (untyped verb, untyped url, untyped command_hash) -> untyped + + private + + def server_url: () -> untyped + + def request: (*untyped) -> untyped + + def create_response: (untyped code, untyped body, untyped content_type) -> untyped + end + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/http/curb.rbs b/rb/sig/lib/selenium/webdriver/remote/http/curb.rbs new file mode 100644 index 0000000000000..03e3e6e025b53 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/http/curb.rbs @@ -0,0 +1,19 @@ +module Selenium + module WebDriver + module Remote + module Http + class Curb < Common + @client: untyped + + def quit_errors: () -> untyped + + private + + def request: (untyped verb, untyped url, untyped headers, untyped payload) -> untyped + + def client: () -> untyped + end + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/http/default.rbs b/rb/sig/lib/selenium/webdriver/remote/http/default.rbs new file mode 100644 index 0000000000000..7fb7a41c9ac7a --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/http/default.rbs @@ -0,0 +1,48 @@ +module Selenium + module WebDriver + module Remote + module Http + # @api private + class Default < Common + @open_timeout: untyped + + @read_timeout: untyped + + @http: untyped + + @proxy: untyped + + attr_writer proxy: untyped + + attr_accessor open_timeout: untyped + + attr_accessor read_timeout: untyped + + def initialize: (?open_timeout: untyped?, ?read_timeout: untyped?) -> void + + def close: () -> untyped + + private + + def http: () -> untyped + + def start: (untyped http) -> untyped + + MAX_RETRIES: Integer + + def request: (untyped verb, untyped url, untyped headers, untyped payload, ?::Integer redirects) -> untyped + + def new_request_for: (untyped verb, untyped url, untyped headers, untyped payload) -> untyped + + def response_for: (untyped request) -> untyped + + def new_http_client: () -> untyped + + def proxy: () -> untyped + + def use_proxy?: () -> untyped + end + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/remote/response.rbs b/rb/sig/lib/selenium/webdriver/remote/response.rbs index 92a6c08abcedb..2fb2cb8756483 100644 --- a/rb/sig/lib/selenium/webdriver/remote/response.rbs +++ b/rb/sig/lib/selenium/webdriver/remote/response.rbs @@ -22,9 +22,9 @@ module Selenium def add_backtrace: (untyped ex, untyped server_trace) -> (nil | untyped) - def backtrace_from_remote: (untyped server_trace) -> Array[untyped] + def backtrace_from_remote: (untyped server_trace) -> String - def process_error: () -> (nil | ::Array[untyped]) + def process_error: () -> (nil | untyped) end end end diff --git a/rb/sig/lib/selenium/webdriver/remote/server_error.rbs b/rb/sig/lib/selenium/webdriver/remote/server_error.rbs new file mode 100644 index 0000000000000..a0287c25a786e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/remote/server_error.rbs @@ -0,0 +1,9 @@ +module Selenium + module WebDriver + module Error + class ServerError < StandardError + def initialize: (untyped response) -> void + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/safari/driver.rbs b/rb/sig/lib/selenium/webdriver/safari/driver.rbs new file mode 100644 index 0000000000000..5d26b33854dc2 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/safari/driver.rbs @@ -0,0 +1,15 @@ +module Selenium + module WebDriver + module Safari + class Driver < WebDriver::Driver + EXTENSIONS: Array[untyped] + + include LocalDriver + + def initialize: (?options: untyped?, ?service: untyped?, ?url: untyped?, **untyped opts) -> void + + def browser: () -> Symbol + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/safari/features.rbs b/rb/sig/lib/selenium/webdriver/safari/features.rbs index e4dc1c06ed25e..30e3d2d269de6 100644 --- a/rb/sig/lib/selenium/webdriver/safari/features.rbs +++ b/rb/sig/lib/selenium/webdriver/safari/features.rbs @@ -2,8 +2,14 @@ module Selenium module WebDriver module Safari module Features + include _Bridge + SAFARI_COMMANDS: Hash[Symbol, Array[Symbol | String]] + COMMANDS: untyped + + def command_list: -> untyped + def commands: (untyped command) -> untyped def permissions: () -> untyped diff --git a/rb/sig/lib/selenium/webdriver/safari/options.rbs b/rb/sig/lib/selenium/webdriver/safari/options.rbs new file mode 100644 index 0000000000000..6ae1af64afe5f --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/safari/options.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Safari + class Options < WebDriver::Options + attr_accessor options: untyped + + CAPABILITIES: Hash[Symbol, String] + + BROWSER: untyped + + def add_option: (untyped name, ?untyped? value) -> untyped + + def as_json: (*untyped) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/safari/service.rbs b/rb/sig/lib/selenium/webdriver/safari/service.rbs new file mode 100644 index 0000000000000..e75e317682014 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/safari/service.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Safari + class Service < WebDriver::Service + DEFAULT_PORT: Integer + + EXECUTABLE: String + + SHUTDOWN_SUPPORTED: bool + + def initialize: (?path: untyped?, ?port: untyped?, ?log: untyped?, ?args: untyped?) -> void + + def log=: (*untyped) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support.rbs b/rb/sig/lib/selenium/webdriver/support.rbs new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/rb/sig/lib/selenium/webdriver/support/block_event_listener.rbs b/rb/sig/lib/selenium/webdriver/support/block_event_listener.rbs new file mode 100644 index 0000000000000..8ea1651817e23 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/block_event_listener.rbs @@ -0,0 +1,13 @@ +module Selenium + module WebDriver + module Support + class BlockEventListener + @callback: untyped + + def initialize: (untyped callback) -> void + + def method_missing: (untyped meth, *untyped args) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/color.rbs b/rb/sig/lib/selenium/webdriver/support/color.rbs new file mode 100644 index 0000000000000..6d9c03ea294aa --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/color.rbs @@ -0,0 +1,59 @@ +module Selenium + module WebDriver + module Support + class Color + @red: untyped + + @green: untyped + + @blue: untyped + + @alpha: untyped + + RGB_PATTERN: Regexp + + RGB_PCT_PATTERN: Regexp + + RGBA_PATTERN: Regexp + + RGBA_PCT_PATTERN: Regexp + + HEX_PATTERN: Regexp + + HEX3_PATTERN: Regexp + + HSL_PATTERN: Regexp + + HSLA_PATTERN: Regexp + + attr_reader red: untyped + + attr_reader green: untyped + + attr_reader blue: untyped + + attr_reader alpha: untyped + + def self.from_string: (String str) -> untyped + + def self.from_hsl: (untyped h, untyped s, untyped l, untyped a) -> untyped + + def self.hue_to_rgb: (untyped lum1, untyped lum2, untyped hue) -> untyped + + def initialize: (String red, String green, String blue, Float | Integer | String ?alpha, *untyped args) -> void + + def ==: (untyped other) -> untyped + + alias eql? == + + def hash: () -> untyped + + def rgb: () -> String + + def rgba: () -> String + + def hex: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/escaper.rbs b/rb/sig/lib/selenium/webdriver/support/escaper.rbs new file mode 100644 index 0000000000000..6c91f6d65a094 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/escaper.rbs @@ -0,0 +1,9 @@ +module Selenium + module WebDriver + module Support + module Escaper + def self.escape: (untyped str) -> String + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/event_firing_bridge.rbs b/rb/sig/lib/selenium/webdriver/support/event_firing_bridge.rbs new file mode 100644 index 0000000000000..43cb36c868df1 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/event_firing_bridge.rbs @@ -0,0 +1,47 @@ +module Selenium + module WebDriver + module Support + class EventFiringBridge + @delegate: untyped + + @listener: untyped + + @driver: untyped + + def initialize: (untyped delegate, untyped listener) -> void + + def get: (untyped url) -> untyped + + def go_forward: () -> untyped + + def go_back: () -> untyped + + def click_element: (untyped ref) -> untyped + + def clear_element: (untyped ref) -> untyped + + def send_keys_to_element: (untyped ref, untyped keys) -> untyped + + def find_element_by: (untyped how, untyped what, ?untyped? parent) -> untyped + + def find_elements_by: (untyped how, untyped what, ?untyped? parent) -> untyped + + def execute_script: (untyped script, *untyped args) -> untyped + + def quit: () -> untyped + + def close: () -> untyped + + private + + def create_element: (untyped ref) -> untyped + + def driver: () -> untyped + + def dispatch: (untyped name, *untyped args) { () -> untyped } -> untyped + + def method_missing: (untyped meth, *untyped args) { () -> untyped } -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/guards.rbs b/rb/sig/lib/selenium/webdriver/support/guards.rbs new file mode 100644 index 0000000000000..2f7c90896426d --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/guards.rbs @@ -0,0 +1,41 @@ +module Selenium + module WebDriver + module Support + class Guards + @example: untyped + + @bug_tracker: untyped + + @guard_conditions: untyped + + @guards: untyped + + @messages: untyped + + GUARD_TYPES: Array[Symbol] + + attr_reader messages: untyped + + attr_accessor bug_tracker: untyped + + def initialize: (untyped example, ?bug_tracker: String, ?conditions: untyped?) -> void + + def add_condition: (untyped name, ?untyped? condition) { () -> untyped } -> untyped + + def add_message: (untyped name, untyped message) -> untyped + + def disposition: () -> Array[untyped]? + + def satisfied?: (untyped guard) -> untyped + + private + + def collect_example_guards: () -> untyped + + def skipping_guard: () -> untyped + + def pending_guard: () -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/guards/guard.rbs b/rb/sig/lib/selenium/webdriver/support/guards/guard.rbs new file mode 100644 index 0000000000000..d5e312b9ee43f --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/guards/guard.rbs @@ -0,0 +1,39 @@ +module Selenium + module WebDriver + module Support + class Guards + class Guard + @guarded: untyped + + @tracker: untyped + + @messages: untyped + + @type: untyped + + @reason: untyped + + attr_reader guarded: untyped + + attr_reader type: untyped + + attr_reader messages: untyped + + attr_reader reason: untyped + + def initialize: (untyped guarded, untyped type, ?untyped? guards) -> void + + def message: () -> untyped + + def except?: () -> untyped + + def only?: () -> untyped + + def exclude?: () -> untyped + + def exclusive?: () -> untyped + end + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/guards/guard_condition.rbs b/rb/sig/lib/selenium/webdriver/support/guards/guard_condition.rbs new file mode 100644 index 0000000000000..f7f0d50690a24 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/guards/guard_condition.rbs @@ -0,0 +1,21 @@ +module Selenium + module WebDriver + module Support + class Guards + class GuardCondition + @name: untyped + + @execution: untyped + + attr_accessor name: untyped + + attr_accessor execution: untyped + + def initialize: (untyped name, ?untyped? condition) ?{ () -> untyped } -> void + + def satisfied?: (untyped guard) -> untyped + end + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/relative_locator.rbs b/rb/sig/lib/selenium/webdriver/support/relative_locator.rbs new file mode 100644 index 0000000000000..e84b3d9127f10 --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/relative_locator.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Support + class RelativeLocator + @filters: untyped + + @root: untyped + + KEYS: Array[String] + + def initialize: (untyped locator) -> void + + def as_json: () -> Hash[Symbol, untyped] + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/support/select.rbs b/rb/sig/lib/selenium/webdriver/support/select.rbs new file mode 100644 index 0000000000000..d6372ca21871e --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/support/select.rbs @@ -0,0 +1,57 @@ +module Selenium + module WebDriver + module Support + class Select + @element: untyped + + @multi: untyped + + def initialize: (untyped element) -> void + + def multiple?: () -> untyped + + def options: () -> untyped + + def selected_options: () -> untyped + + def first_selected_option: () -> untyped + + def select_by: (untyped how, untyped what) -> untyped + + def deselect_by: (untyped how, untyped what) -> untyped + + def select_all: () -> untyped + + def deselect_all: () -> untyped + + private + + def select_by_text: (untyped text) -> untyped + + def select_by_index: (untyped index) -> untyped + + def select_by_value: (untyped value) -> untyped + + def deselect_by_text: (untyped text) -> untyped + + def deselect_by_value: (untyped value) -> untyped + + def deselect_by_index: (untyped index) -> untyped + + def select_option: (untyped option) -> untyped + + def deselect_option: (untyped option) -> untyped? + + def select_options: (untyped opts) -> untyped + + def deselect_options: (untyped opts) -> untyped + + def find_by_text: (untyped text) -> untyped + + def find_by_index: (untyped index) -> untyped + + def find_by_value: (untyped value) -> untyped + end + end + end +end diff --git a/rb/sig/lib/selenium/webdriver/version.rbs b/rb/sig/lib/selenium/webdriver/version.rbs new file mode 100644 index 0000000000000..f03fa7d1cf26c --- /dev/null +++ b/rb/sig/lib/selenium/webdriver/version.rbs @@ -0,0 +1,5 @@ +module Selenium + module WebDriver + VERSION: String + end +end diff --git a/rb/sig/lib/selenium_webdriver.rbs b/rb/sig/lib/selenium_webdriver.rbs new file mode 100644 index 0000000000000..e69de29bb2d1d