From ec59a1e285fa58874eb7707de0d17fabd9769194 Mon Sep 17 00:00:00 2001 From: aguspe Date: Tue, 19 Mar 2024 20:16:59 +0100 Subject: [PATCH 01/11] Update atoms.rb signature types --- rb/sig/lib/selenium/webdriver/atoms.rbs | 4 ++-- rb/sig/lib/selenium/webdriver/bidi.rbs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/atoms.rbs b/rb/sig/lib/selenium/webdriver/atoms.rbs index eacbd40132411..e825969f918c5 100644 --- a/rb/sig/lib/selenium/webdriver/atoms.rbs +++ b/rb/sig/lib/selenium/webdriver/atoms.rbs @@ -4,13 +4,13 @@ module Selenium include _Bridge include _ExecuteScript - def atom_script: (untyped) -> untyped + def atom_script: (Symbol) -> String private def read_atom: (Symbol function) -> String - def execute_atom: (Symbol function_name, *untyped arguments) -> untyped + def execute_atom: (Symbol function_name, [Element | String | Symbol] arguments) -> [Element | Integer | Float | bool | nil | String | Array[untyped]] end end end diff --git a/rb/sig/lib/selenium/webdriver/bidi.rbs b/rb/sig/lib/selenium/webdriver/bidi.rbs index e37040f4d9061..82527a1169bae 100644 --- a/rb/sig/lib/selenium/webdriver/bidi.rbs +++ b/rb/sig/lib/selenium/webdriver/bidi.rbs @@ -15,7 +15,7 @@ module Selenium def send_cmd: (untyped method, **untyped params) -> untyped - def error_message: (untyped message) -> ::String + def error_message: (untyped message) -> String end end end From 38cea9c94628c91624787a02e9de8ee0b62df022 Mon Sep 17 00:00:00 2001 From: aguspe Date: Wed, 20 Mar 2024 22:26:23 +0100 Subject: [PATCH 02/11] Start adding bidi types --- rb/sig/lib/selenium/webdriver/bidi.rbs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/bidi.rbs b/rb/sig/lib/selenium/webdriver/bidi.rbs index 82527a1169bae..109b658bca24b 100644 --- a/rb/sig/lib/selenium/webdriver/bidi.rbs +++ b/rb/sig/lib/selenium/webdriver/bidi.rbs @@ -1,21 +1,21 @@ module Selenium module WebDriver class BiDi - @ws: untyped + @ws: WebSocketConnection - @session: untyped + @session: Session - def initialize: (url: untyped) -> void + def initialize: (url: String) -> void - def close: () -> untyped + def close: () -> nil - def callbacks: () -> untyped + def callbacks: () -> Hash[untyped, untyped] - def session: () -> untyped + def session: () -> Session def send_cmd: (untyped method, **untyped params) -> untyped - def error_message: (untyped message) -> String + def error_message: (Hash[String,String] message) -> String end end end From 0c3188d14e8c959387045dda4f631053c7bd5fae Mon Sep 17 00:00:00 2001 From: aguspe Date: Thu, 21 Mar 2024 17:47:26 +0100 Subject: [PATCH 03/11] Extended types of devtools and edge --- rb/sig/lib/selenium/webdriver/devtools.rbs | 4 ++-- rb/sig/lib/selenium/webdriver/edge.rbs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/devtools.rbs b/rb/sig/lib/selenium/webdriver/devtools.rbs index 44db3c460745f..892e89bc4c8dd 100644 --- a/rb/sig/lib/selenium/webdriver/devtools.rbs +++ b/rb/sig/lib/selenium/webdriver/devtools.rbs @@ -10,7 +10,7 @@ module Selenium def initialize: (url: untyped) -> void - def close: () -> untyped + def close: () -> nil def callbacks: () -> untyped @@ -24,7 +24,7 @@ module Selenium def start_session: () -> untyped - def error_message: (untyped error) -> untyped + def error_message: (Hash[untyped, untyped] error) -> String end end end diff --git a/rb/sig/lib/selenium/webdriver/edge.rbs b/rb/sig/lib/selenium/webdriver/edge.rbs index fea64d68b81e6..e357f141b0061 100644 --- a/rb/sig/lib/selenium/webdriver/edge.rbs +++ b/rb/sig/lib/selenium/webdriver/edge.rbs @@ -1,11 +1,11 @@ module Selenium module WebDriver module Edge - self.@path: untyped + @path: String? - def self.path=: (untyped path) -> untyped + def self.path=: (String path) -> String - def self.path: () -> untyped + def self.path: () -> String? end end end From 74c600013680232ba1dfccfdf4dcd8b98ebff62b Mon Sep 17 00:00:00 2001 From: aguspe Date: Tue, 26 Mar 2024 21:54:55 +0100 Subject: [PATCH 04/11] Added firefox and safari types and removed unused signature --- rb/sig/lib/selenium/webdriver/firefox.rbs | 6 +++--- rb/sig/lib/selenium/webdriver/safari.rbs | 15 +++++++-------- rb/sig/lib/selenium/webdriver/support.rbs | 0 3 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 rb/sig/lib/selenium/webdriver/support.rbs diff --git a/rb/sig/lib/selenium/webdriver/firefox.rbs b/rb/sig/lib/selenium/webdriver/firefox.rbs index 9d25371c0f786..790ac05f42dbd 100644 --- a/rb/sig/lib/selenium/webdriver/firefox.rbs +++ b/rb/sig/lib/selenium/webdriver/firefox.rbs @@ -1,7 +1,7 @@ module Selenium module WebDriver module Firefox - self.@path: untyped + @path: String? DEFAULT_PORT: Integer @@ -13,9 +13,9 @@ module Selenium DEVTOOLS_VERSION: Integer - def self.path=: (untyped path) -> untyped + def self.path=: (String path) -> String - def self.path: () -> untyped + def self.path: () -> String? end end end diff --git a/rb/sig/lib/selenium/webdriver/safari.rbs b/rb/sig/lib/selenium/webdriver/safari.rbs index 80bfbd7a4b4a1..3f778338de717 100644 --- a/rb/sig/lib/selenium/webdriver/safari.rbs +++ b/rb/sig/lib/selenium/webdriver/safari.rbs @@ -1,21 +1,20 @@ module Selenium module WebDriver module Safari - self.@use_technology_preview: untyped + @use_technology_preview: bool? + @path: String? - self.@path: untyped - - attr_accessor self.use_technology_preview: untyped + attr_accessor use_technology_preview: bool? def self.technology_preview: () -> String - def self.technology_preview!: () -> untyped + def self.technology_preview!: () -> bool - def self.technology_preview?: () -> untyped + def self.technology_preview?: () -> bool? - def self.path=: (untyped path) -> untyped + def self.path=: (String) -> String - def self.path: () -> untyped + def self.path: () -> String end end end diff --git a/rb/sig/lib/selenium/webdriver/support.rbs b/rb/sig/lib/selenium/webdriver/support.rbs deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 6cb1ecaee9d8117889c17284ccc82b4b4456dd56 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sat, 30 Mar 2024 19:45:35 +0100 Subject: [PATCH 05/11] Update chrome features with type and remove Safari error --- rb/sig/lib/selenium/webdriver/chrome/features.rbs | 6 +++--- rb/sig/lib/selenium/webdriver/safari.rbs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/chrome/features.rbs b/rb/sig/lib/selenium/webdriver/chrome/features.rbs index a4523edc32d4b..ab3e9c85707e4 100644 --- a/rb/sig/lib/selenium/webdriver/chrome/features.rbs +++ b/rb/sig/lib/selenium/webdriver/chrome/features.rbs @@ -4,10 +4,10 @@ module Selenium module Features include WebDriver::Chromium::Features - CHROME_COMMANDS: untyped - COMMANDS: Array[Symbol | String] + CHROME_COMMANDS: Hash[Symbol, Array[Symbol | String]] + COMMANDS: Hash[Symbol, Array[Symbol | String]] - def command_list: -> untyped + def command_list: -> Hash[Symbol, Array[Symbol | String]] def commands: (Symbol command) -> Array[Symbol | String] end diff --git a/rb/sig/lib/selenium/webdriver/safari.rbs b/rb/sig/lib/selenium/webdriver/safari.rbs index 3f778338de717..7159df25cc89f 100644 --- a/rb/sig/lib/selenium/webdriver/safari.rbs +++ b/rb/sig/lib/selenium/webdriver/safari.rbs @@ -4,13 +4,13 @@ module Selenium @use_technology_preview: bool? @path: String? - attr_accessor use_technology_preview: bool? + attr_accessor self.use_technology_preview: bool def self.technology_preview: () -> String def self.technology_preview!: () -> bool - def self.technology_preview?: () -> bool? + def self.technology_preview?: () -> bool def self.path=: (String) -> String From 77563a704f641a75885f2b4ba9c7a6daecc29708 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 31 Mar 2024 22:54:39 +0200 Subject: [PATCH 06/11] Update server and remove unused signature --- rb/sig/lib/selenium/server.rbs | 6 +++--- rb/sig/lib/selenium/webdriver/common/target_locator.rbs | 4 ++-- rb/sig/lib/selenium_webdriver.rbs | 0 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 rb/sig/lib/selenium_webdriver.rbs diff --git a/rb/sig/lib/selenium/server.rbs b/rb/sig/lib/selenium/server.rbs index 4ae361debc94b..5cbb4d18df579 100644 --- a/rb/sig/lib/selenium/server.rbs +++ b/rb/sig/lib/selenium/server.rbs @@ -31,9 +31,9 @@ module Selenium CL_RESET: untyped - def self.get: (?Symbol required_version, ?Hash[untyped, untyped] opts) -> untyped + def self.get: (Symbol | String required_version, ?Hash[untyped, untyped] opts) -> Server - def self.download: (?Symbol required_version) -> untyped + def self.download: (Symbol | String required_version) -> String def self.latest: () -> untyped @@ -55,7 +55,7 @@ module Selenium attr_accessor log: untyped - def initialize: (untyped jar, ?Hash[untyped, untyped] opts) -> void + def initialize: (String jar, ?Hash[String | Symbol, Integer | bool] opts) -> void def start: () -> untyped diff --git a/rb/sig/lib/selenium/webdriver/common/target_locator.rbs b/rb/sig/lib/selenium/webdriver/common/target_locator.rbs index 609989c2ca3d8..2e650495a40ff 100644 --- a/rb/sig/lib/selenium/webdriver/common/target_locator.rbs +++ b/rb/sig/lib/selenium/webdriver/common/target_locator.rbs @@ -7,9 +7,9 @@ module Selenium def parent_frame: () -> void - def new_window: (?::Symbol `type`) { (untyped) -> untyped } -> untyped + def new_window: (Symbol type) { (untyped) -> untyped } -> untyped - def window: (untyped id) ?{ () -> untyped } -> untyped + def window: (Integer id) ?{ () -> untyped } -> untyped def active_element: () -> Element diff --git a/rb/sig/lib/selenium_webdriver.rbs b/rb/sig/lib/selenium_webdriver.rbs deleted file mode 100644 index e69de29bb2d1d..0000000000000 From b0295dec13f68884cca7479e5010191662a1da14 Mon Sep 17 00:00:00 2001 From: aguspe Date: Fri, 5 Apr 2024 15:12:26 +0200 Subject: [PATCH 07/11] Expand Server type signature --- rb/sig/lib/selenium/server.rbs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rb/sig/lib/selenium/server.rbs b/rb/sig/lib/selenium/server.rbs index 5cbb4d18df579..10020d85851f0 100644 --- a/rb/sig/lib/selenium/server.rbs +++ b/rb/sig/lib/selenium/server.rbs @@ -4,27 +4,27 @@ module Selenium self.@available_assets: untyped - @jar: untyped + @jar: String - @host: untyped + @host: String - @role: untyped + @role: String - @port: untyped + @port: Integer - @timeout: untyped + @timeout: Integer - @background: untyped + @background: bool - @additional_args: untyped + @additional_args: Integer | bool | Array[untyped] - @log: untyped + @log: String | bool @log_file: untyped @process: untyped - @socket: untyped + @socket: WebDriver::SocketPoller class Error < StandardError end From e8195925c35f87627c0e1733eaac23a1e5cbc4eb Mon Sep 17 00:00:00 2001 From: aguspe Date: Wed, 10 Apr 2024 17:21:34 +0200 Subject: [PATCH 08/11] expanding type support on options --- rb/sig/lib/selenium/webdriver/common/options.rbs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/common/options.rbs b/rb/sig/lib/selenium/webdriver/common/options.rbs index ccb419b4f7902..1beb314177ac0 100644 --- a/rb/sig/lib/selenium/webdriver/common/options.rbs +++ b/rb/sig/lib/selenium/webdriver/common/options.rbs @@ -7,27 +7,27 @@ module Selenium GRID_OPTIONS: Array[Symbol] - BROWSER: untyped + BROWSER: Symbol KEY: untyped CAPABILITIES: Hash[Symbol, String] - attr_reader self.driver_path: untyped + attr_reader self.driver_path: String - def self.chrome: (**untyped opts) -> untyped + def self.chrome: (**String | Symbol | Integer | bool opts) -> Chrome::Options - def self.firefox: (**untyped opts) -> untyped + def self.firefox: (**String | Symbol | Integer | bool opts) -> Firefox::Options - def self.ie: (**untyped opts) -> untyped + def self.ie: (**String | Symbol | Integer | bool opts) -> IE::Options alias self.internet_explorer self.ie - def self.edge: (**untyped opts) -> untyped + def self.edge: (**String | Symbol | Integer | bool opts) -> Edge::Options alias self.microsoftedge self.edge - def self.safari: (**untyped opts) -> untyped + def self.safari: (**String | Symbol | Integer | bool opts) -> Safari::Options def self.set_capabilities: () -> untyped From 66a8e62f2b1be18f908c4d87d28b04f3d5d7fb35 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sat, 13 Apr 2024 22:32:15 +0200 Subject: [PATCH 09/11] Expand options types --- rb/sig/lib/selenium/webdriver/common/options.rbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/common/options.rbs b/rb/sig/lib/selenium/webdriver/common/options.rbs index 1beb314177ac0..0972ba12bc07b 100644 --- a/rb/sig/lib/selenium/webdriver/common/options.rbs +++ b/rb/sig/lib/selenium/webdriver/common/options.rbs @@ -35,9 +35,9 @@ module Selenium def initialize: (**untyped opts) -> void - def add_option: (untyped name, ?untyped? value) -> untyped + def add_option: (String | Symbol name, bool | String | Integer? value) -> untyped - def ==: (untyped other) -> (false | untyped) + def ==: (untyped other) -> bool alias eql? == From 68757f00d2868628a9edf3850305271c90d3fab3 Mon Sep 17 00:00:00 2001 From: aguspe Date: Fri, 19 Apr 2024 22:21:14 +0200 Subject: [PATCH 10/11] add extra options support --- rb/sig/lib/selenium/webdriver/common/options.rbs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/common/options.rbs b/rb/sig/lib/selenium/webdriver/common/options.rbs index 0972ba12bc07b..dec8488984697 100644 --- a/rb/sig/lib/selenium/webdriver/common/options.rbs +++ b/rb/sig/lib/selenium/webdriver/common/options.rbs @@ -1,7 +1,7 @@ module Selenium module WebDriver class Options - @options: untyped + @options: Hash[String | Symbol, String | Numeric | bool?] W3C_OPTIONS: Array[Symbol] @@ -11,7 +11,7 @@ module Selenium KEY: untyped - CAPABILITIES: Hash[Symbol, String] + CAPABILITIES: Hash[String | Symbol, String | Numeric | bool?] attr_reader self.driver_path: String @@ -31,11 +31,11 @@ module Selenium def self.set_capabilities: () -> untyped - attr_accessor options: untyped + attr_accessor options: Hash[String | Symbol, String | Numeric | bool?] - def initialize: (**untyped opts) -> void + def initialize: (Hash[String | Symbol, String | Numeric | bool] opts) -> void - def add_option: (String | Symbol name, bool | String | Integer? value) -> untyped + def add_option: (String | Symbol name, String | Numeric | bool? value) -> (String | Numeric | bool)? def ==: (untyped other) -> bool From 7bcf60bc3fa1680539f04c4f865fe203831b52cd Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 21 Apr 2024 23:23:43 +0200 Subject: [PATCH 11/11] Expand options support --- rb/sig/lib/selenium/webdriver/common/options.rbs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rb/sig/lib/selenium/webdriver/common/options.rbs b/rb/sig/lib/selenium/webdriver/common/options.rbs index dec8488984697..adf1b2bb473c7 100644 --- a/rb/sig/lib/selenium/webdriver/common/options.rbs +++ b/rb/sig/lib/selenium/webdriver/common/options.rbs @@ -53,13 +53,14 @@ module Selenium def camelize?: (untyped _key) -> true - def generate_as_json: (untyped value, ?camelize_keys: bool) -> untyped + def generate_as_json: (Array[untyped] | Hash[untyped, untyped] | String | Symbol value, ?camelize_keys: bool) + -> (Array[untyped] | Hash[untyped, untyped] | String | Symbol) - def process_json_hash: (untyped value, untyped camelize_keys) -> untyped + def process_json_hash: (Hash[untyped, untyped] value, bool camelize_keys) -> Hash[untyped, untyped] - def convert_json_key: (untyped key, ?camelize: bool) -> untyped + def convert_json_key: (String | Symbol key, camelize: bool) -> String - def camel_case: (untyped str) -> untyped + def camel_case: (String str) -> String end end end