Skip to content

Commit

Permalink
[rb] Add missing RBS methods (#14621)
Browse files Browse the repository at this point in the history
  • Loading branch information
aguspe authored Oct 25, 2024
1 parent c5fbdd6 commit 798f3f9
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 15 deletions.
2 changes: 1 addition & 1 deletion rb/sig/lib/selenium/webdriver/bidi.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Selenium

def callbacks: () -> Hash[untyped, untyped]

def remove_callback: -> Array[Integer]
def remove_callback: (String event, Integer id) -> Error::WebDriverError?

def session: () -> Session

Expand Down
6 changes: 3 additions & 3 deletions rb/sig/lib/selenium/webdriver/bidi/log_handler.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ module Selenium

def add_message_handler: (String type) { (untyped) -> untyped } -> Integer

def remove_message_handler: (Integer id) -> false
def remove_message_handler: (Integer id) -> bool

private

def subscribe_log_entry: () -> false
def subscribe_log_entry: () -> bool

def unsubscribe_log_entry: () -> false
def unsubscribe_log_entry: () -> bool
end
end
end
Expand Down
17 changes: 17 additions & 0 deletions rb/sig/lib/selenium/webdriver/common/driver_finder.rbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
module Selenium
module WebDriver
class DriverFinder
@options: untyped

@paths: untyped
@service: untyped

def initialize: (untyped options,untyped service) -> void

def self.path: (untyped options, untyped klass) -> untyped

def browser_path: -> untyped

def browser_path?: -> untyped

def driver_path: -> untyped

private

def paths: -> untyped
end
end
end
4 changes: 4 additions & 0 deletions rb/sig/lib/selenium/webdriver/common/search_context.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module Selenium

FINDERS: untyped

attr_accessor self.extra_finders: untyped

def self.finders: -> untyped

def find_element: (*untyped args) -> untyped

def find_elements: (*untyped args) -> untyped
Expand Down
4 changes: 3 additions & 1 deletion rb/sig/lib/selenium/webdriver/common/service.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ module Selenium

attr_accessor args: untyped

def env_path: -> String
def env_path: -> String?

alias extra_args args

def initialize: (?path: untyped?, ?port: untyped?, ?log: untyped?, ?args: untyped?) -> void

def find_driver_path: -> untyped

def launch: () -> untyped

def shutdown_supported: () -> untyped
Expand Down
4 changes: 4 additions & 0 deletions rb/sig/lib/selenium/webdriver/common/websocket_connection.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ module Selenium

def initialize: (url: untyped) -> void

def add_callback: (untyped event, untyped id) -> untyped

def close: () -> untyped

def callbacks: () -> untyped

def remove_callback: (untyped event, untyped id) -> untyped

def send_cmd: (**untyped payload) -> untyped

private
Expand Down
2 changes: 2 additions & 0 deletions rb/sig/lib/selenium/webdriver/fedcm/dialog.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Selenium

@bridge: Remote::Bridge

def initialize: (Remote::Bridge bridge) -> void

def accounts: -> Array[Account]

def cancel: -> Remote::Response?
Expand Down
2 changes: 2 additions & 0 deletions rb/sig/lib/selenium/webdriver/firefox/options.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module Selenium

@profile: untyped

@options: Hash[Symbol, untyped]

attr_accessor debugger_address: untyped

KEY: String
Expand Down
18 changes: 14 additions & 4 deletions rb/sig/lib/selenium/webdriver/remote/http/common.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,31 @@ module Selenium

DEFAULT_HEADERS: Hash[String, untyped]

attr_writer server_url: untyped
@common_headers: Hash[String, untyped]

attr_accessor self.extra_headers: Hash[String, untyped]

attr_writer self.user_agent: String

def self.user_agent: -> String

attr_writer server_url: String

def quit_errors: () -> Array[untyped]

def close: () -> untyped
def close: () -> nil

def call: (untyped verb, untyped url, untyped command_hash) -> untyped

private

def server_url: () -> untyped
def common_headers: -> Hash[String, untyped]

def server_url: () -> String

def request: (*untyped) -> untyped

def create_response: (untyped code, untyped body, untyped content_type) -> untyped
def create_response: (Integer code, Hash[String, untyped] body, String content_type) -> Remote::Response
end
end
end
Expand Down
1 change: 1 addition & 0 deletions rb/sig/lib/selenium/webdriver/support/guards/guard.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Selenium

attr_reader guarded: untyped

attr_reader tracker: String
attr_reader type: untyped

attr_reader messages: untyped
Expand Down
12 changes: 6 additions & 6 deletions rb/sig/selenium/web_driver/script.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ module Selenium
@bidi: BiDi
@log_entry_subscribed: bool

def add_console_message_handler: -> untyped
@log_handler: BiDi::LogHandler

def add_javascript_error_handler: -> untyped
def initialize: (BiDi bidi) -> void

def remove_console_message_handler: -> untyped
def add_console_message_handler: -> Integer

alias remove_javascript_error_handler remove_console_message_handler
def add_javascript_error_handler: -> Integer

private
def remove_console_message_handler: (Integer id) -> bool

def subscribe_log_entry: -> untyped
alias remove_javascript_error_handler remove_console_message_handler
end
end
end

0 comments on commit 798f3f9

Please sign in to comment.