From afdc4ca552c918238da10a343abc69c61f410f3d Mon Sep 17 00:00:00 2001 From: aguspe Date: Sat, 3 Aug 2024 20:23:57 +0200 Subject: [PATCH 01/17] Take down steep issues from 522 to 427 --- .ruby-version | 1 + sig/gems/selenium/atoms.rbs | 16 + sig/gems/selenium/bidi/browsing_context.rbs | 27 ++ .../selenium/bidi/browsing_context_info.rbs | 25 ++ sig/gems/selenium/bidi/log_inspector.rbs | 33 +++ sig/gems/selenium/bidi/navigate_result.rbs | 17 ++ sig/gems/selenium/bidi/session.rbs | 19 ++ sig/gems/selenium/bridge.rbs | 275 ++++++++++++++++++ sig/gems/selenium/chrome/features.rbs | 16 + sig/gems/selenium/chromium/features.rbs | 42 +++ sig/gems/selenium/edge/features.rbs | 17 ++ sig/gems/selenium/firefox/driver.rbs | 21 ++ sig/gems/selenium/firefox/extension.rbs | 31 ++ sig/gems/selenium/firefox/features.rbs | 25 ++ sig/gems/selenium/firefox/options.rbs | 8 + sig/gems/selenium/firefox/profile.rbs | 77 +++++ sig/gems/selenium/firefox/profiles_ini.rbs | 23 ++ sig/gems/selenium/firefox/service.rbs | 6 + sig/gems/selenium/firefox/util.rbs | 12 + sig/gems/selenium/ie/features.rbs | 13 + sig/gems/selenium/interfaces/bridge.rbs | 3 + sig/gems/selenium/interfaces/commands.rbs | 3 + .../selenium/interfaces/commands_list.rbs | 3 + sig/gems/selenium/interfaces/devtools.rbs | 11 + sig/gems/selenium/interfaces/driver.rbs | 17 ++ sig/gems/selenium/interfaces/features.rbs | 3 + sig/gems/selenium/local_driver.rbs | 11 + sig/gems/selenium/profile_helper.rbs | 6 + .../bridge/commands.rbs} | 5 +- .../selenium/{ => remote}/capabilities.rbs | 4 +- sig/gems/selenium/remote/http/common.rbs | 31 ++ sig/gems/selenium/remote/http/default.rbs | 48 +++ .../{common.rbs => remote/response.rbs} | 4 +- sig/gems/selenium/safari/features.rbs | 23 ++ .../appium_lib_core/common/base/bridge.rbs | 206 +++++++++++++ .../common/device/app_management.rbs | 27 ++ .../common/device/app_state.rbs | 13 + .../appium_lib_core/common/device/context.rbs | 17 ++ .../appium_lib_core/common/device/device.rbs | 13 + .../common/device/device_lock.rbs | 15 + .../common/device/execute_driver.rbs | 23 ++ .../common/device/file_management.rbs | 15 + .../common/device/image_comparison.rbs | 99 +++++++ .../common/device/ime_actions.rbs | 19 ++ .../common/device/keyboard.rbs | 13 + .../common/device/keyevent.rbs | 16 + .../common/device/orientation.rbs | 13 + .../common/device/screen_record.rbs | 23 ++ .../appium_lib_core/common/device/setting.rbs | 13 + 49 files changed, 1393 insertions(+), 8 deletions(-) create mode 100644 .ruby-version create mode 100644 sig/gems/selenium/atoms.rbs create mode 100644 sig/gems/selenium/bidi/browsing_context.rbs create mode 100644 sig/gems/selenium/bidi/browsing_context_info.rbs create mode 100644 sig/gems/selenium/bidi/log_inspector.rbs create mode 100644 sig/gems/selenium/bidi/navigate_result.rbs create mode 100644 sig/gems/selenium/bidi/session.rbs create mode 100644 sig/gems/selenium/bridge.rbs create mode 100644 sig/gems/selenium/chrome/features.rbs create mode 100644 sig/gems/selenium/chromium/features.rbs create mode 100644 sig/gems/selenium/edge/features.rbs create mode 100644 sig/gems/selenium/firefox/driver.rbs create mode 100644 sig/gems/selenium/firefox/extension.rbs create mode 100644 sig/gems/selenium/firefox/features.rbs create mode 100644 sig/gems/selenium/firefox/options.rbs create mode 100644 sig/gems/selenium/firefox/profile.rbs create mode 100644 sig/gems/selenium/firefox/profiles_ini.rbs create mode 100644 sig/gems/selenium/firefox/service.rbs create mode 100644 sig/gems/selenium/firefox/util.rbs create mode 100644 sig/gems/selenium/ie/features.rbs create mode 100644 sig/gems/selenium/interfaces/bridge.rbs create mode 100644 sig/gems/selenium/interfaces/commands.rbs create mode 100644 sig/gems/selenium/interfaces/commands_list.rbs create mode 100644 sig/gems/selenium/interfaces/devtools.rbs create mode 100644 sig/gems/selenium/interfaces/driver.rbs create mode 100644 sig/gems/selenium/interfaces/features.rbs create mode 100644 sig/gems/selenium/local_driver.rbs create mode 100644 sig/gems/selenium/profile_helper.rbs rename sig/gems/selenium/{default.rbs => remote/bridge/commands.rbs} (52%) rename sig/gems/selenium/{ => remote}/capabilities.rbs (64%) create mode 100644 sig/gems/selenium/remote/http/common.rbs create mode 100644 sig/gems/selenium/remote/http/default.rbs rename sig/gems/selenium/{common.rbs => remote/response.rbs} (61%) create mode 100644 sig/gems/selenium/safari/features.rbs create mode 100644 sig/lib/appium_lib_core/common/base/bridge.rbs create mode 100644 sig/lib/appium_lib_core/common/device/app_management.rbs create mode 100644 sig/lib/appium_lib_core/common/device/app_state.rbs create mode 100644 sig/lib/appium_lib_core/common/device/context.rbs create mode 100644 sig/lib/appium_lib_core/common/device/device.rbs create mode 100644 sig/lib/appium_lib_core/common/device/device_lock.rbs create mode 100644 sig/lib/appium_lib_core/common/device/execute_driver.rbs create mode 100644 sig/lib/appium_lib_core/common/device/file_management.rbs create mode 100644 sig/lib/appium_lib_core/common/device/image_comparison.rbs create mode 100644 sig/lib/appium_lib_core/common/device/ime_actions.rbs create mode 100644 sig/lib/appium_lib_core/common/device/keyboard.rbs create mode 100644 sig/lib/appium_lib_core/common/device/keyevent.rbs create mode 100644 sig/lib/appium_lib_core/common/device/orientation.rbs create mode 100644 sig/lib/appium_lib_core/common/device/screen_record.rbs create mode 100644 sig/lib/appium_lib_core/common/device/setting.rbs diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..15a27998 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.0 diff --git a/sig/gems/selenium/atoms.rbs b/sig/gems/selenium/atoms.rbs new file mode 100644 index 00000000..e825969f --- /dev/null +++ b/sig/gems/selenium/atoms.rbs @@ -0,0 +1,16 @@ +module Selenium + module WebDriver + module Atoms + include _Bridge + include _ExecuteScript + + def atom_script: (Symbol) -> String + + private + + def read_atom: (Symbol function) -> String + + def execute_atom: (Symbol function_name, [Element | String | Symbol] arguments) -> [Element | Integer | Float | bool | nil | String | Array[untyped]] + end + end +end diff --git a/sig/gems/selenium/bidi/browsing_context.rbs b/sig/gems/selenium/bidi/browsing_context.rbs new file mode 100644 index 00000000..a690a382 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/bidi/browsing_context_info.rbs b/sig/gems/selenium/bidi/browsing_context_info.rbs new file mode 100644 index 00000000..1e0d1214 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/bidi/log_inspector.rbs b/sig/gems/selenium/bidi/log_inspector.rbs new file mode 100644 index 00000000..565ec3aa --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/bidi/navigate_result.rbs b/sig/gems/selenium/bidi/navigate_result.rbs new file mode 100644 index 00000000..54b4737e --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/bidi/session.rbs b/sig/gems/selenium/bidi/session.rbs new file mode 100644 index 00000000..99b94c52 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/bridge.rbs b/sig/gems/selenium/bridge.rbs new file mode 100644 index 00000000..4e06cbd6 --- /dev/null +++ b/sig/gems/selenium/bridge.rbs @@ -0,0 +1,275 @@ +module Selenium + module WebDriver + module Remote + class Bridge + include _CommandList + include _Features + + @bidi: WebDriver::BiDi + @http: untyped + + @file_detector: untyped + + @session_id: untyped + + @capabilities: untyped + + @browser: untyped + + @manage: untyped + + @escaper: untyped + + include Atoms + + PORT: Integer + + attr_accessor http: untyped + + attr_accessor file_detector: untyped + + attr_reader capabilities: untyped + + def initialize: (url: String | URI, ?http_client: untyped?) -> void + + def cancel_fedcm_dialog: -> nil + + def click_fedcm_dialog_button: -> nil + + def create_session: (untyped capabilities) -> untyped + + extend WebDriver::Chrome::Features + + extend WebDriver::Firefox::Features + + extend WebDriver::Edge::Features + + extend WebDriver::Safari::Features + + def fedcm_account_list: -> [FedCM::Account] + + def fedcm_dialog_type: -> String + + def fedcm_subtitle: -> String? + + def fedcm_title: -> String + + def reset_fedcm_cooldown: -> nil + + def select_fedcm_account: -> nil + + def session_id: () -> untyped + + def browser: () -> untyped + + def fedcm_delay: -> bool + + def status: () -> untyped + + def get: (untyped url) -> untyped + + def timeouts: () -> untyped + + def timeouts=: (untyped timeouts) -> untyped + + def accept_alert: () -> untyped + + def dismiss_alert: () -> untyped + + def alert=: (untyped keys) -> untyped + + def alert_text: () -> untyped + + def go_back: () -> untyped + + def go_forward: () -> untyped + + def url: () -> untyped + + def title: () -> untyped + + def page_source: () -> untyped + + def new_window: (untyped type) -> untyped + + def switch_to_window: (untyped name) -> untyped + + def switch_to_frame: (untyped id) -> untyped + + def switch_to_parent_frame: () -> untyped + + def switch_to_default_content: () -> untyped + + QUIT_ERRORS: ::Array[untyped] + + def quit: () -> untyped + + def close: () -> untyped + + def refresh: () -> untyped + + def window_handles: () -> untyped + + def window_handle: () -> untyped + + def resize_window: (untyped width, untyped height, ?::Symbol handle) -> untyped + + def window_size: (?::Symbol handle) -> untyped + + def minimize_window: () -> untyped + + def maximize_window: (?::Symbol handle) -> untyped + + def full_screen_window: () -> untyped + + def reposition_window: (untyped x, untyped y) -> untyped + + def window_position: () -> untyped + + def set_window_rect: (?x: untyped?, ?y: untyped?, ?width: untyped?, ?height: untyped?) -> untyped + + def window_rect: () -> untyped + + def screenshot: () -> untyped + + def element_screenshot: (untyped element) -> untyped + + def local_storage_item: (untyped key, ?untyped? value) -> untyped + + def remove_local_storage_item: (untyped key) -> untyped + + def local_storage_keys: () -> untyped + + def clear_local_storage: () -> untyped + + def local_storage_size: () -> untyped + + def session_storage_item: (untyped key, ?untyped? value) -> untyped + + def remove_session_storage_item: (untyped key) -> untyped + + def session_storage_keys: () -> untyped + + def clear_session_storage: () -> untyped + + def session_storage_size: () -> untyped + + def execute_script: (untyped script, *untyped args) -> untyped + + def execute_async_script: (untyped script, *untyped args) -> untyped + + def manage: () -> untyped + + def add_cookie: (untyped cookie) -> untyped + + def delete_cookie: (untyped name) -> untyped + + def cookie: (untyped name) -> untyped + + def cookies: () -> untyped + + def delete_all_cookies: () -> untyped + + def action: (?async: bool, ?devices: untyped, ?duration: ::Integer) -> untyped + + alias actions action + + def send_actions: (untyped data) -> untyped + + def release_actions: () -> untyped + + def print_page: (?::Hash[untyped, untyped] options) -> untyped + + def click_element: (untyped element) -> untyped + + def send_keys_to_element: (untyped element, untyped keys) -> untyped + + def upload: (untyped local_file) -> untyped + + def clear_element: (untyped element) -> untyped + + def submit_element: (untyped element) -> untyped + + def element_tag_name: (untyped element) -> untyped + + def element_attribute: (untyped element, untyped name) -> untyped + + def element_dom_attribute: (untyped element, untyped name) -> untyped + + def element_property: (untyped element, untyped name) -> untyped + + def element_aria_role: (untyped element) -> untyped + + def element_aria_label: (untyped element) -> untyped + + def element_value: (untyped element) -> untyped + + def element_text: (untyped element) -> untyped + + def element_location: (untyped element) -> untyped + + def element_rect: (untyped element) -> untyped + + def element_location_once_scrolled_into_view: (untyped element) -> untyped + + def element_size: (untyped element) -> untyped + + def element_enabled?: (untyped element) -> untyped + + def element_selected?: (untyped element) -> untyped + + def element_displayed?: (untyped element) -> untyped + + def element_value_of_css_property: (untyped element, untyped prop) -> untyped + + def active_element: () -> untyped + + alias switch_to_active_element active_element + + def find_element_by: (untyped how, untyped what, ?untyped parent_ref) -> untyped + + def find_elements_by: (untyped how, untyped what, ?untyped parent_ref) -> untyped + + def shadow_root: (untyped element) -> untyped + + def add_virtual_authenticator: (untyped options) -> untyped + + def remove_virtual_authenticator: (untyped id) -> untyped + + def add_credential: (untyped credential, untyped id) -> untyped + + def credentials: (untyped authenticator_id) -> untyped + + def remove_credential: (untyped credential_id, untyped authenticator_id) -> untyped + + def remove_all_credentials: (untyped authenticator_id) -> untyped + + def user_verified: (untyped verified, untyped authenticator_id) -> untyped + + private + + def execute: (untyped command, ?::Hash[untyped, untyped] opts, ?untyped? command_hash) -> WebDriver::Remote::Response + + def escaper: () -> untyped + + def commands: (untyped command) -> untyped + + def unwrap_script_result: (untyped arg) -> untyped + + def element_id_from: (untyped id) -> untyped + + def shadow_root_id_from: (untyped id) -> untyped + + def prepare_capabilities_payload: (untyped capabilities) -> { capabilities: untyped } + + def convert_locator: (untyped how, untyped what) -> ::Array[untyped] + + ESCAPE_CSS_REGEXP: ::Regexp + + UNICODE_CODE_POINT: 30 + + def escape_css: (untyped string) -> untyped + end + end + end +end diff --git a/sig/gems/selenium/chrome/features.rbs b/sig/gems/selenium/chrome/features.rbs new file mode 100644 index 00000000..ab3e9c85 --- /dev/null +++ b/sig/gems/selenium/chrome/features.rbs @@ -0,0 +1,16 @@ +module Selenium + module WebDriver + module Chrome + module Features + include WebDriver::Chromium::Features + + CHROME_COMMANDS: Hash[Symbol, Array[Symbol | String]] + COMMANDS: Hash[Symbol, Array[Symbol | String]] + + def command_list: -> Hash[Symbol, Array[Symbol | String]] + + def commands: (Symbol command) -> Array[Symbol | String] + end + end + end +end diff --git a/sig/gems/selenium/chromium/features.rbs b/sig/gems/selenium/chromium/features.rbs new file mode 100644 index 00000000..a48cca64 --- /dev/null +++ b/sig/gems/selenium/chromium/features.rbs @@ -0,0 +1,42 @@ +module Selenium + module WebDriver + module Chromium + module Features + include _Bridge + + CHROMIUM_COMMANDS: Hash[Symbol, Array[Symbol | String]] + + def commands: (Symbol command) -> Array[Symbol | String] + + def launch_app: (String id) -> String + + def cast_sinks: () -> Array[String] + + def cast_sink_to_use=: (String name) -> untyped + + def cast_issue_message: () -> String + + def start_cast_tab_mirroring: (String name) -> untyped + + def start_cast_desktop_mirroring: (String name) -> untyped + + def stop_casting: (String name) -> untyped + + def set_permission: (String name, String value) -> untyped + + def network_conditions: () -> Hash[untyped, untyped] + + def network_conditions=: (Hash[Symbol | String, Integer | bool] conditions) -> untyped + + def delete_network_conditions: () -> untyped + + def send_command: (Hash[String | Symbol, untyped] command_params) -> untyped + + def available_log_types: () -> Array[Symbol] + + def log: (Symbol type) -> Array[Hash[String, untyped]] | + (Symbol type) -> Array[LogEntry] + end + end + end +end diff --git a/sig/gems/selenium/edge/features.rbs b/sig/gems/selenium/edge/features.rbs new file mode 100644 index 00000000..accea1a3 --- /dev/null +++ b/sig/gems/selenium/edge/features.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module Edge + module Features + include WebDriver::Chromium::Features + + EDGE_COMMANDS: Hash[Symbol, Array[Symbol | String]] + + COMMANDS: untyped + + def command_list: -> untyped + + def commands: (untyped command) -> untyped + end + end + end +end diff --git a/sig/gems/selenium/firefox/driver.rbs b/sig/gems/selenium/firefox/driver.rbs new file mode 100644 index 00000000..7dd993e2 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/firefox/extension.rbs b/sig/gems/selenium/firefox/extension.rbs new file mode 100644 index 00000000..0a4979c7 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/firefox/features.rbs b/sig/gems/selenium/firefox/features.rbs new file mode 100644 index 00000000..c8d12b93 --- /dev/null +++ b/sig/gems/selenium/firefox/features.rbs @@ -0,0 +1,25 @@ +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 + + def uninstall_addon: (untyped id) -> untyped + + def full_screenshot: () -> untyped + + def context=: (untyped context) -> untyped + + def context: () -> untyped + end + end + end +end diff --git a/sig/gems/selenium/firefox/options.rbs b/sig/gems/selenium/firefox/options.rbs new file mode 100644 index 00000000..57be5cd1 --- /dev/null +++ b/sig/gems/selenium/firefox/options.rbs @@ -0,0 +1,8 @@ +module Selenium + module WebDriver + module Firefox + class Options + end + end + end +end diff --git a/sig/gems/selenium/firefox/profile.rbs b/sig/gems/selenium/firefox/profile.rbs new file mode 100644 index 00000000..58b93624 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/firefox/profiles_ini.rbs b/sig/gems/selenium/firefox/profiles_ini.rbs new file mode 100644 index 00000000..09c93bd8 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/firefox/service.rbs b/sig/gems/selenium/firefox/service.rbs new file mode 100644 index 00000000..288a1a43 --- /dev/null +++ b/sig/gems/selenium/firefox/service.rbs @@ -0,0 +1,6 @@ +module Selenium + module WebDriver + module Firefox + end + end +end diff --git a/sig/gems/selenium/firefox/util.rbs b/sig/gems/selenium/firefox/util.rbs new file mode 100644 index 00000000..42b3b6d4 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/ie/features.rbs b/sig/gems/selenium/ie/features.rbs new file mode 100644 index 00000000..301366c8 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/interfaces/bridge.rbs b/sig/gems/selenium/interfaces/bridge.rbs new file mode 100644 index 00000000..65b90124 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/interfaces/commands.rbs b/sig/gems/selenium/interfaces/commands.rbs new file mode 100644 index 00000000..87653989 --- /dev/null +++ b/sig/gems/selenium/interfaces/commands.rbs @@ -0,0 +1,3 @@ +interface _Commands + def commands: (untyped command) -> untyped +end diff --git a/sig/gems/selenium/interfaces/commands_list.rbs b/sig/gems/selenium/interfaces/commands_list.rbs new file mode 100644 index 00000000..356b9272 --- /dev/null +++ b/sig/gems/selenium/interfaces/commands_list.rbs @@ -0,0 +1,3 @@ +interface _CommandList + def command_list: () -> untyped +end diff --git a/sig/gems/selenium/interfaces/devtools.rbs b/sig/gems/selenium/interfaces/devtools.rbs new file mode 100644 index 00000000..01b4ce39 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/interfaces/driver.rbs b/sig/gems/selenium/interfaces/driver.rbs new file mode 100644 index 00000000..4089947d --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/interfaces/features.rbs b/sig/gems/selenium/interfaces/features.rbs new file mode 100644 index 00000000..42d59006 --- /dev/null +++ b/sig/gems/selenium/interfaces/features.rbs @@ -0,0 +1,3 @@ +interface _Features + def upload_if_necessary: (untyped keys) -> untyped +end diff --git a/sig/gems/selenium/local_driver.rbs b/sig/gems/selenium/local_driver.rbs new file mode 100644 index 00000000..ef1ac98c --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/profile_helper.rbs b/sig/gems/selenium/profile_helper.rbs new file mode 100644 index 00000000..f81c65d3 --- /dev/null +++ b/sig/gems/selenium/profile_helper.rbs @@ -0,0 +1,6 @@ +module Selenium + module WebDriver + module ProfileHelper + end + end +end diff --git a/sig/gems/selenium/default.rbs b/sig/gems/selenium/remote/bridge/commands.rbs similarity index 52% rename from sig/gems/selenium/default.rbs rename to sig/gems/selenium/remote/bridge/commands.rbs index 5177998f..35ea1697 100644 --- a/sig/gems/selenium/default.rbs +++ b/sig/gems/selenium/remote/bridge/commands.rbs @@ -1,9 +1,8 @@ module Selenium module WebDriver module Remote - module Http - class Default - end + class Bridge + COMMANDS: Hash[Symbol, Array[Symbol | String]] end end end diff --git a/sig/gems/selenium/capabilities.rbs b/sig/gems/selenium/remote/capabilities.rbs similarity index 64% rename from sig/gems/selenium/capabilities.rbs rename to sig/gems/selenium/remote/capabilities.rbs index 1f86f726..b5dc63fa 100644 --- a/sig/gems/selenium/capabilities.rbs +++ b/sig/gems/selenium/remote/capabilities.rbs @@ -1,8 +1,8 @@ module Selenium module WebDriver module Remote - class Capabilities - end + class Capabilities + end end end end diff --git a/sig/gems/selenium/remote/http/common.rbs b/sig/gems/selenium/remote/http/common.rbs new file mode 100644 index 00000000..3e1e2ecc --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/remote/http/default.rbs b/sig/gems/selenium/remote/http/default.rbs new file mode 100644 index 00000000..7fb7a41c --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/common.rbs b/sig/gems/selenium/remote/response.rbs similarity index 61% rename from sig/gems/selenium/common.rbs rename to sig/gems/selenium/remote/response.rbs index d8843d9a..c0fd1990 100644 --- a/sig/gems/selenium/common.rbs +++ b/sig/gems/selenium/remote/response.rbs @@ -1,9 +1,7 @@ module Selenium module WebDriver module Remote - module Http - class Common - end + class Response end end end diff --git a/sig/gems/selenium/safari/features.rbs b/sig/gems/selenium/safari/features.rbs new file mode 100644 index 00000000..30e3d2d2 --- /dev/null +++ b/sig/gems/selenium/safari/features.rbs @@ -0,0 +1,23 @@ +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 + + def permissions=: (untyped permissions) -> untyped + + def attach_debugger: () -> untyped + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/base/bridge.rbs b/sig/lib/appium_lib_core/common/base/bridge.rbs new file mode 100644 index 00000000..35714957 --- /dev/null +++ b/sig/lib/appium_lib_core/common/base/bridge.rbs @@ -0,0 +1,206 @@ +module Appium + module Core + class Base + class LocatorConverter + def convert: (untyped how, untyped what) -> ::Array[untyped] + end + + class Bridge < ::Selenium::WebDriver::Remote::Bridge + @browser: untyped + + @available_commands: untyped + + @session_id: untyped + + # generate a dummy capabilities instance which only has the given platformName and automationName + @capabilities: untyped + + include Device::DeviceLock + + include Device::Keyboard + + include Device::ImeActions + + include Device::Setting + + include Device::Context + + include Device::FileManagement + + include Device::KeyEvent + + include Device::ImageComparison + + include Device::AppManagement + + include Device::AppState + + include Device::ScreenRecord::Command + + include Device::Device + + include Device::ExecuteDriver + + include Device::Orientation + + # Prefix for extra capability defined by W3C + APPIUM_PREFIX: "appium:" + + # No 'browserName' means the session is native appium connection + APPIUM_NATIVE_BROWSER_NAME: "appium" + + attr_reader available_commands: untyped + + def browser: () -> untyped + + # Appium only. + # Attach to an existing session. + # + # @param [String] The session id to attach to. + # @param [String] platform_name The platform name to keep in the dummy capabilities + # @param [String] platform_name The automation name to keep in the dummy capabilities + # @return [::Appium::Core::Base::Capabilities] + # + # @example + # + # new_driver = ::Appium::Core::Driver.attach_to( + # driver.session_id, + # url: 'http://127.0.0.1:4723/wd/hub', automation_name: 'UiAutomator2', platform_name: 'Android' + # ) + # + def attach_to: (untyped session_id, untyped platform_name, untyped automation_name) -> untyped + + # Override + # Creates session handling. + # + # @param [::Appium::Core::Base::Capabilities, Hash] capabilities A capability + # @return [::Appium::Core::Base::Capabilities] + # + # @example + # + # opts = { + # caps: { + # platformName: :ios, + # automationName: 'XCUITest', + # app: 'test/functional/app/UICatalog.app.zip', + # platformVersion: '11.4', + # deviceName: 'iPhone Simulator', + # useNewWDA: true, + # }, + # appium_lib: { + # wait: 30 + # } + # } + # core = ::Appium::Core.for(caps) + # driver = core.start_driver + # + def create_session: (untyped capabilities) -> untyped + + # Append +appium:+ prefix for Appium following W3C spec + # https://www.w3.org/TR/webdriver/#dfn-validate-capabilities + # + # @param [::Appium::Core::Base::Capabilities, Hash] capabilities A capability + # @return [::Appium::Core::Base::Capabilities] + def add_appium_prefix: (untyped capabilities) -> untyped + + private + + def camel_case: (untyped str_or_sym) -> untyped + + def extension_prefix?: (untyped capability_name) -> untyped + + def json_create: (untyped value) -> untyped + + public + + def add_command: (method: untyped, url: untyped, name: untyped) { (?) -> untyped } -> untyped + + def commands: (untyped command) -> untyped + + def status: () -> untyped + + # Perform 'touch' actions for W3C module. + # Generate +touch+ pointer action here and users can use this via +driver.action+ + # - https://www.selenium.dev/documentation/webdriver/actions_api/ + # - https://www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/ActionBuilder.html + # - https://www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/PointerActions.html + # - https://www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/KeyActions.html + # + # The pointer type is 'touch' by default in the Appium Ruby client. + # + # @example + # + # element = @driver.find_element(:id, "some id") + # @driver.action.click(element).perform # The 'click' is a part of 'PointerActions' + # + def action: (?untyped? _deprecated_async, ?async: bool, ?devices: untyped?) -> untyped + + # Port from MJSONWP + def get_timeouts: () -> untyped + + # For Appium + # override + def element_displayed?: (untyped element) -> untyped + + # For Appium + # override + def element_attribute: (untyped element, untyped name) -> untyped + + # For Appium + alias switch_to_active_element active_element + + # For Appium + # @param [Hash] id The id which can get as a response from server + # @return [::Appium::Core::Element] + def convert_to_element: (untyped id) -> untyped + + # For Appium + # override + # called in 'extend DriverExtensions::HasNetworkConnection' + def network_connection: () -> untyped + + # For Appium + # override + # called in 'extend DriverExtensions::HasNetworkConnection' + def network_connection=: (untyped type) -> untyped + + # For Appium + # No implementation for W3C webdriver module + # called in 'extend DriverExtensions::HasLocation' + def location: () -> untyped + + # For Appium + # No implementation for W3C webdriver module + def set_location: (untyped lat, untyped lon, ?::Float alt, ?speed: untyped?, ?satellites: untyped?) -> untyped + + # + # logs + # + # For Appium + # No implementation for W3C webdriver module + def available_log_types: () -> untyped + + # For Appium + # No implementation for W3C webdriver module + def log: (untyped type) -> untyped + + # For Appium + def log_event: (untyped vendor, untyped event) -> untyped + + # For Appium + def log_events: (?untyped? type) -> untyped + + def viewport_screenshot: () -> untyped + + def element_screenshot: (untyped element_id) -> untyped + + # for selenium-webdriver compatibility in chrome browser session. + # This may be needed in selenium-webdriver 4.8 or over? (around the version) + # when a session starts browserName: 'chrome' for bridge. + # This method is not only for Android, but also chrome desktop browser as well. + # So this bridge itself does not restrict the target module. + def send_command: (untyped command_params) -> untyped + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/app_management.rbs b/sig/lib/appium_lib_core/common/device/app_management.rbs new file mode 100644 index 00000000..1814fc03 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/app_management.rbs @@ -0,0 +1,27 @@ +module Appium + module Core + class Base + module Device + module AppManagement + def app_strings: (?untyped? language) -> untyped + + def background_app: (?::Integer duration) -> untyped + + def install_app: (untyped path, ?::Hash[untyped, untyped] options) -> untyped + + def remove_app: (untyped id, ?keep_data: untyped?, ?timeout: untyped?) -> untyped + + def app_installed?: (untyped app_id) -> untyped + + def activate_app: (untyped app_id) -> untyped + + def terminate_app: (untyped app_id, ?timeout: untyped?) -> untyped + + private + + def options?: (*untyped args) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/app_state.rbs b/sig/lib/appium_lib_core/common/device/app_state.rbs new file mode 100644 index 00000000..3a3fd3d5 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/app_state.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + class Base + module Device + module AppState + STATUS: ::Array[:not_installed | :not_running | :running_in_background_suspended | :running_in_background | :running_in_foreground] + + def app_state: (untyped app_id) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/context.rbs b/sig/lib/appium_lib_core/common/device/context.rbs new file mode 100644 index 00000000..5529e7ec --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/context.rbs @@ -0,0 +1,17 @@ +module Appium + module Core + class Base + module Device + module Context + def within_context: (untyped context) ?{ () -> untyped } -> untyped + + def current_context: () -> untyped + + def available_contexts: () -> untyped + + def set_context: (?untyped? context) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/device.rbs b/sig/lib/appium_lib_core/common/device/device.rbs new file mode 100644 index 00000000..24d661d2 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/device.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + class Base + module Device + module Device + def shake: () -> untyped + + def device_time: (?untyped? format) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/device_lock.rbs b/sig/lib/appium_lib_core/common/device/device_lock.rbs new file mode 100644 index 00000000..41f7d6e5 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/device_lock.rbs @@ -0,0 +1,15 @@ +module Appium + module Core + class Base + module Device + module DeviceLock + def lock: (?untyped? duration) -> untyped + + def device_locked?: () -> untyped + + def unlock: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/execute_driver.rbs b/sig/lib/appium_lib_core/common/device/execute_driver.rbs new file mode 100644 index 00000000..734d5166 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/execute_driver.rbs @@ -0,0 +1,23 @@ +module Appium + module Core + class Base + module Device + module ExecuteDriver + class Result + @result: untyped + + @logs: untyped + + attr_reader result: untyped + + attr_reader logs: untyped + + def initialize: (untyped response) -> void + end + + def execute_driver: (?script: ::String, ?type: ::String, ?timeout_ms: untyped?) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/file_management.rbs b/sig/lib/appium_lib_core/common/device/file_management.rbs new file mode 100644 index 00000000..5b60f325 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/file_management.rbs @@ -0,0 +1,15 @@ +module Appium + module Core + class Base + module Device + module FileManagement + def push_file: (untyped path, untyped filedata) -> untyped + + def pull_file: (untyped path) -> untyped + + def pull_folder: (untyped path) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/image_comparison.rbs b/sig/lib/appium_lib_core/common/device/image_comparison.rbs new file mode 100644 index 00000000..6cbcc357 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/image_comparison.rbs @@ -0,0 +1,99 @@ +module Appium + module Core + class Base + module Device + module ImageComparison + MODE: ::Array[:matchFeatures | :getSimilarity | :matchTemplate] + + MATCH_FEATURES: { detector_name: ::Array["AKAZE" | "AGAST" | "BRISK" | "FAST" | "GFTT" | "KAZE" | "MSER" | "SIFT" | "ORB"], match_func: ::Array["FlannBased" | "BruteForce" | "BruteForceL1" | "BruteForceHamming" | "BruteForceHammingLut" | "BruteForceSL2"], goodMatchesFactor: nil, visualize: ::Array[true | false] } + + MATCH_TEMPLATE: { visualize: ::Array[true | false] } + + GET_SIMILARITY: { visualize: ::Array[true | false] } + + # Performs images matching by features with default options. + # Read {https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_matcher/py_matcher.html py_matcher} + # for more details on this topic. + # + # @param [String] first_image An image data. All image formats, that OpenCV library itself accepts, are supported. + # @param [String] second_image An image data. All image formats, that OpenCV library itself accepts, are supported. + # @param [String] detector_name Sets the detector name for features matching + # algorithm. Some of these detectors (FAST, AGAST, GFTT, FAST, SIFT and MSER) are + # not available in the default OpenCV installation and have to be enabled manually + # before library compilation. The default detector name is 'ORB'. + # @param [String] match_func The name of the matching function. The default one is 'BruteForce'. + # @param [String, nil] good_matches_factor The maximum count of "good" matches (e. g. with minimal distances). + # The default one is nil. + # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of + # the corresponding picture matching operation. This option is disabled by default. + # + # @example + # @driver.match_images_features first_image: "image data 1", second_image: "image data 2" + # + # visual = @@driver.match_images_features first_image: image1, second_image: image2, visualize: true + # File.write 'match_images_visual.png', Base64.decode64(visual['visualization']) # if the image is PNG + # + def match_images_features: (first_image: untyped, second_image: untyped, ?detector_name: ::String, ?match_func: ::String, ?good_matches_factor: untyped?, ?visualize: bool) -> untyped + + # Performs images matching by template to find possible occurrence of the partial image + # in the full image with default options. Read + # {https://docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/template_matching/template_matching.html + # template_matching} + # for more details on this topic. + # + # @param [String] full_image A full image data. + # @param [String] partial_image A partial image data. All image formats, that OpenCV library itself accepts, + # are supported. + # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of + # the corresponding picture matching operation. This option is disabled by default. + # @param [Float, nil] threshold [0.5] At what normalized threshold to reject + # @param [bool, nil] multiple Whether to enable the support of multiple image occurrences @since Appium 1.21.0. + # @param [integer, nil] match_neighbour_threshold The pixel distance between matches we consider to be part of + # the same template match @since Appium 1.21.0. + # This option is only considered if multiple matches mode is enabled. + # 10 pixels by default. + # + # @example + # @driver.find_image_occurrence full_image: "image data 1", partial_image: "image data 2" + # + # visual = @@driver.find_image_occurrence full_image: image1, partial_image: image2, visualize: true + # File.write 'find_result_visual.png', Base64.decode64(visual['visualization']) # if the image is PNG + # + def find_image_occurrence: (full_image: untyped, partial_image: untyped, ?visualize: bool, ?threshold: untyped?, ?multiple: untyped?, ?match_neighbour_threshold: untyped?) -> untyped + + # Performs images matching to calculate the similarity score between them + # with default options. The flow there is similar to the one used in +find_image_occurrence+ + # but it is mandatory that both images are of equal size. + # + # @param [String] first_image An image data. All image formats, that OpenCV library itself accepts, are supported. + # @param [String] second_image An image data. All image formats, that OpenCV library itself accepts, are supported. + # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of + # the corresponding picture matching operation. This option is disabled by default. + # + # @example + # @driver.get_images_similarity first_image: "image data 1", second_image: "image data 2" + # + # visual = @@driver.get_images_similarity first_image: image1, second_image: image2, visualize: true + # File.write 'images_similarity_visual.png', Base64.decode64(visual['visualization']) # if the image is PNG + # + def get_images_similarity: (first_image: untyped, second_image: untyped, ?visualize: bool) -> untyped + + # Performs images comparison using OpenCV framework features. + # It is expected that both OpenCV framework and opencv4nodejs + # module are installed on the machine where Appium server is running. + # + # @param [Symbol] mode One of possible comparison modes: +:matchFeatures+, +:getSimilarity+, +:matchTemplate+. + # +:matchFeatures is by default. + # @param [String] first_image An image data. All image formats, that OpenCV library itself accepts, are supported. + # @param [String] second_image An image data. All image formats, that OpenCV library itself accepts, are supported. + # @param [Hash, nil] options The content of this dictionary depends on the actual +mode+ value. + # See the documentation on +appium-support+ module for more details. + # @return [Hash] The content of the resulting dictionary depends on the actual +mode+ and +options+ values. + # See the documentation on +appium-support+ module for more details. + # + def compare_images: (first_image: untyped, second_image: untyped, ?mode: ::Symbol, ?options: untyped?) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/ime_actions.rbs b/sig/lib/appium_lib_core/common/device/ime_actions.rbs new file mode 100644 index 00000000..14bdb050 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/ime_actions.rbs @@ -0,0 +1,19 @@ +module Appium + module Core + class Base + module Device + module ImeActions + def ime_activate: (untyped ime_name) -> untyped + + def ime_available_engines: () -> untyped + + def ime_active_engine: () -> untyped + + def ime_activated: () -> untyped + + def ime_deactivate: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/keyboard.rbs b/sig/lib/appium_lib_core/common/device/keyboard.rbs new file mode 100644 index 00000000..03862b97 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/keyboard.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + class Base + module Device + module Keyboard + def hide_keyboard: (?untyped? close_key, ?untyped? strategy) -> untyped + + def is_keyboard_shown: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/keyevent.rbs b/sig/lib/appium_lib_core/common/device/keyevent.rbs new file mode 100644 index 00000000..ab0304b5 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/keyevent.rbs @@ -0,0 +1,16 @@ +module Appium + module Core + class Base + module Device + module KeyEvent + # Only for Selendroid + def keyevent: (untyped key, ?untyped? metastate) -> untyped + + def press_keycode: (untyped key, ?metastate: untyped, ?flags: untyped) -> untyped + + def long_press_keycode: (untyped key, ?metastate: untyped, ?flags: untyped) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/orientation.rbs b/sig/lib/appium_lib_core/common/device/orientation.rbs new file mode 100644 index 00000000..76425744 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/orientation.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + class Base + module Device + module Orientation + def screen_orientation=: (untyped orientation) -> untyped + + def screen_orientation: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/screen_record.rbs b/sig/lib/appium_lib_core/common/device/screen_record.rbs new file mode 100644 index 00000000..40200222 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/screen_record.rbs @@ -0,0 +1,23 @@ +module Appium + module Core + class Base + module Device + class ScreenRecord + @upload_option: untyped + + attr_reader upload_option: untyped + + METHOD: ::Array["POST" | "PUT"] + + def initialize: (?remote_path: untyped?, ?user: untyped?, ?pass: untyped?, ?method: ::String, ?file_field_name: untyped?, ?form_fields: untyped?, ?headers: untyped?, ?force_restart: untyped?) -> void + + module Command + def stop_recording_screen: (?remote_path: untyped?, ?user: untyped?, ?pass: untyped?, ?method: ::String, ?file_field_name: untyped?, ?form_fields: untyped?, ?headers: untyped?) -> untyped + + def stop_and_save_recording_screen: (untyped file_path) -> untyped + end + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/setting.rbs b/sig/lib/appium_lib_core/common/device/setting.rbs new file mode 100644 index 00000000..4cef3611 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/setting.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + class Base + module Device + module Setting + def get_settings: () -> untyped + + def update_settings: (untyped settings) -> untyped + end + end + end + end +end From 2093701254d72314e6e2c7cd93519e0e14daa5e4 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 4 Aug 2024 17:12:38 +0200 Subject: [PATCH 02/17] Small type update done --- sig/gems/selenium/interfaces/devtools.rbs | 8 -------- sig/lib/appium_lib_core/common/device/app_management.rbs | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/sig/gems/selenium/interfaces/devtools.rbs b/sig/gems/selenium/interfaces/devtools.rbs index 01b4ce39..4c65a129 100644 --- a/sig/gems/selenium/interfaces/devtools.rbs +++ b/sig/gems/selenium/interfaces/devtools.rbs @@ -1,11 +1,3 @@ -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/sig/lib/appium_lib_core/common/device/app_management.rbs b/sig/lib/appium_lib_core/common/device/app_management.rbs index 1814fc03..20662975 100644 --- a/sig/lib/appium_lib_core/common/device/app_management.rbs +++ b/sig/lib/appium_lib_core/common/device/app_management.rbs @@ -5,9 +5,9 @@ module Appium module AppManagement def app_strings: (?untyped? language) -> untyped - def background_app: (?::Integer duration) -> untyped + def background_app: (Integer? duration) -> untyped - def install_app: (untyped path, ?::Hash[untyped, untyped] options) -> untyped + def install_app: (untyped path, Hash[untyped, untyped]? options) -> untyped def remove_app: (untyped id, ?keep_data: untyped?, ?timeout: untyped?) -> untyped From 1ee9b23cd9effe25db6e90f9c6b7da53f44de3aa Mon Sep 17 00:00:00 2001 From: aguspe Date: Sat, 14 Sep 2024 14:23:50 +0200 Subject: [PATCH 03/17] Take down steep issues from 522 to 304 --- sig/gems/selenium/common/element.rbs | 65 +++++++++++++++++++ sig/{gems/selenium => }/interfaces/bridge.rbs | 0 sig/lib/appium_lib_core/android/device.rbs | 11 ++++ .../android/device/auth_finger_print.rbs | 11 ++++ .../android/device/clipboard.rbs | 11 ++++ .../android/device/emulator.rbs | 21 ++++++ .../android/device/network.rbs | 11 ++++ .../android/device/performance.rbs | 11 ++++ .../appium_lib_core/android/device/screen.rbs | 11 ++++ .../common/device/app_management.rbs | 2 + sig/lib/appium_lib_core/common/error.rbs | 26 ++++++++ sig/lib/appium_lib_core/common/log.rbs | 19 ++++++ sig/lib/appium_lib_core/common/logger.rbs | 13 ++++ sig/lib/appium_lib_core/common/wait/timer.rbs | 15 +++++ sig/lib/appium_lib_core/element.rbs | 24 +++++++ 15 files changed, 251 insertions(+) create mode 100644 sig/gems/selenium/common/element.rbs rename sig/{gems/selenium => }/interfaces/bridge.rbs (100%) create mode 100644 sig/lib/appium_lib_core/android/device.rbs create mode 100644 sig/lib/appium_lib_core/android/device/auth_finger_print.rbs create mode 100644 sig/lib/appium_lib_core/android/device/clipboard.rbs create mode 100644 sig/lib/appium_lib_core/android/device/emulator.rbs create mode 100644 sig/lib/appium_lib_core/android/device/network.rbs create mode 100644 sig/lib/appium_lib_core/android/device/performance.rbs create mode 100644 sig/lib/appium_lib_core/android/device/screen.rbs create mode 100644 sig/lib/appium_lib_core/common/error.rbs create mode 100644 sig/lib/appium_lib_core/common/log.rbs create mode 100644 sig/lib/appium_lib_core/common/logger.rbs create mode 100644 sig/lib/appium_lib_core/common/wait/timer.rbs create mode 100644 sig/lib/appium_lib_core/element.rbs diff --git a/sig/gems/selenium/common/element.rbs b/sig/gems/selenium/common/element.rbs new file mode 100644 index 00000000..c534b1e0 --- /dev/null +++ b/sig/gems/selenium/common/element.rbs @@ -0,0 +1,65 @@ +module Selenium + module WebDriver + class Element + ELEMENT_KEY: ::String + + def inspect: () -> untyped + + def ==: (untyped other) -> bool + + alias eql? == + + def hash: () -> Integer + + def click: () -> untyped + + def tag_name: () -> untyped + + def attribute: (String | Symbol name) -> String? + + def dom_attribute: (String name) -> String? + + def property: (String name) -> String? + + def aria_role: () -> String + + def accessible_name: () -> String + + def text: () -> String + + def send_keys: (*untyped args) -> untyped + + alias send_key send_keys + + def clear: () -> bool + + def enabled?: () -> bool + + def selected?: () -> bool + + def displayed?: () -> bool + + def submit: () -> untyped + + def css_value: (String prop) -> untyped + + alias style css_value + + alias [] attribute + + def ref: () -> ::Array[:element | untyped] + + def to_json: () -> untyped + + def as_json: () -> untyped + + private + + attr_reader bridge: Remote::Bridge + + def selectable?: () -> bool + + def screenshot: () -> untyped + end + end +end diff --git a/sig/gems/selenium/interfaces/bridge.rbs b/sig/interfaces/bridge.rbs similarity index 100% rename from sig/gems/selenium/interfaces/bridge.rbs rename to sig/interfaces/bridge.rbs diff --git a/sig/lib/appium_lib_core/android/device.rbs b/sig/lib/appium_lib_core/android/device.rbs new file mode 100644 index 00000000..1c8962be --- /dev/null +++ b/sig/lib/appium_lib_core/android/device.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Device + extend Forwardable + + def self.extended: (untyped _mod) -> (nil | untyped) + end + end + end +end diff --git a/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs b/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs new file mode 100644 index 00000000..e6ceb5e7 --- /dev/null +++ b/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Device + module Authentication + def self.add_methods: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/android/device/clipboard.rbs b/sig/lib/appium_lib_core/android/device/clipboard.rbs new file mode 100644 index 00000000..bfda9654 --- /dev/null +++ b/sig/lib/appium_lib_core/android/device/clipboard.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Device + module Clipboard + def self.add_methods: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/android/device/emulator.rbs b/sig/lib/appium_lib_core/android/device/emulator.rbs new file mode 100644 index 00000000..d307bcc3 --- /dev/null +++ b/sig/lib/appium_lib_core/android/device/emulator.rbs @@ -0,0 +1,21 @@ +module Appium + module Core + module Android + module Device + module Emulator + GSM_CALL_ACTIONS: ::Array[:call | :accept | :cancel | :hold] + + GSM_VOICE_STATES: ::Array[:on | :off | :denied | :searching | :roaming | :home | :unregistered] + + GSM_SIGNALS: { none_or_unknown: 0, poor: 1, moderate: 2, good: 3, great: 4 } + + NET_SPEED: ::Array[:gsm | :scsd | :gprs | :edge | :umts | :hsdpa | :lte | :evdo | :full] + + POWER_AC_STATE: ::Array[:on | :off] + + def self.add_methods: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/android/device/network.rbs b/sig/lib/appium_lib_core/android/device/network.rbs new file mode 100644 index 00000000..54e74b65 --- /dev/null +++ b/sig/lib/appium_lib_core/android/device/network.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Device + module Network + def self.add_methods: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/android/device/performance.rbs b/sig/lib/appium_lib_core/android/device/performance.rbs new file mode 100644 index 00000000..11c9a704 --- /dev/null +++ b/sig/lib/appium_lib_core/android/device/performance.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Device + module Performance + def self.add_methods: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/android/device/screen.rbs b/sig/lib/appium_lib_core/android/device/screen.rbs new file mode 100644 index 00000000..9199fbd1 --- /dev/null +++ b/sig/lib/appium_lib_core/android/device/screen.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Device + module Screen + def self.add_methods: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/app_management.rbs b/sig/lib/appium_lib_core/common/device/app_management.rbs index 20662975..fa0acef0 100644 --- a/sig/lib/appium_lib_core/common/device/app_management.rbs +++ b/sig/lib/appium_lib_core/common/device/app_management.rbs @@ -3,6 +3,8 @@ module Appium class Base module Device module AppManagement + include _Bridge + def app_strings: (?untyped? language) -> untyped def background_app: (Integer? duration) -> untyped diff --git a/sig/lib/appium_lib_core/common/error.rbs b/sig/lib/appium_lib_core/common/error.rbs new file mode 100644 index 00000000..0338dfcf --- /dev/null +++ b/sig/lib/appium_lib_core/common/error.rbs @@ -0,0 +1,26 @@ +module Appium + module Core + module Error + class CoreError < StandardError + end + + class NotSupportedAppiumServer < CoreError + end + + class NoSuchElementError < CoreError + end + + class UnsupportedOperationError < CoreError + end + + class ServerError < CoreError + end + + class SessionNotCreatedError < CoreError + end + + class ArgumentError < CoreError + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/log.rbs b/sig/lib/appium_lib_core/common/log.rbs new file mode 100644 index 00000000..9a3eec6d --- /dev/null +++ b/sig/lib/appium_lib_core/common/log.rbs @@ -0,0 +1,19 @@ +module Appium + module Core + class Logs + @bridge: untyped + + def initialize: (untyped bridge) -> void + + def get: (untyped type) -> untyped + + def available_types: () -> untyped + + def event: (vendor: untyped, event: untyped) -> untyped + + def event=: (untyped log_event) -> untyped + + def events: (?untyped? type) -> untyped + end + end +end diff --git a/sig/lib/appium_lib_core/common/logger.rbs b/sig/lib/appium_lib_core/common/logger.rbs new file mode 100644 index 00000000..39a06fcf --- /dev/null +++ b/sig/lib/appium_lib_core/common/logger.rbs @@ -0,0 +1,13 @@ +module Appium + module Logger + self.@logger: untyped + + extend Forwardable + + attr_writer self.logger: untyped + + private + + def self.logger: () -> untyped + end +end diff --git a/sig/lib/appium_lib_core/common/wait/timer.rbs b/sig/lib/appium_lib_core/common/wait/timer.rbs new file mode 100644 index 00000000..d47ab02b --- /dev/null +++ b/sig/lib/appium_lib_core/common/wait/timer.rbs @@ -0,0 +1,15 @@ +module Appium + module Core + module Wait + class Timer + @end_time: untyped + + def initialize: (Numeric timeout) -> void + + def timeout?: () -> bool + + def current_time: () -> Float + end + end + end +end diff --git a/sig/lib/appium_lib_core/element.rbs b/sig/lib/appium_lib_core/element.rbs new file mode 100644 index 00000000..42c1f37e --- /dev/null +++ b/sig/lib/appium_lib_core/element.rbs @@ -0,0 +1,24 @@ +module Appium + module Core + class Element < ::Selenium::WebDriver::Element + include ::Appium::Core::Base::TakesScreenshot + + attr_reader id: untyped + + def method_missing: (untyped method_name, *untyped args) { (?) -> untyped } -> (nil | untyped) + + def respond_to_missing?: (*untyped) -> true + + # Alias for type + alias type send_keys + + def location_rel: (untyped driver) -> untyped + + def screenshot: () -> untyped + + def screenshot_as: (untyped format) -> untyped + + def save_screenshot: (untyped png_path) -> untyped + end + end +end From 845177afdb4202d7ca8e36d37d65337153f7e80a Mon Sep 17 00:00:00 2001 From: aguspe Date: Sat, 14 Sep 2024 14:26:29 +0200 Subject: [PATCH 04/17] Take down steep issues from 522 to 286 --- .../appium_lib_core/common/base/search_context.rbs | 1 + sig/lib/appium_lib_core/ios/device/clipboard.rbs | 11 +++++++++++ sig/lib/appium_lib_core/mac2/device.rbs | 11 +++++++++++ sig/lib/appium_lib_core/mac2/device/screen.rbs | 11 +++++++++++ 4 files changed, 34 insertions(+) create mode 100644 sig/lib/appium_lib_core/common/base/search_context.rbs create mode 100644 sig/lib/appium_lib_core/ios/device/clipboard.rbs create mode 100644 sig/lib/appium_lib_core/mac2/device.rbs create mode 100644 sig/lib/appium_lib_core/mac2/device/screen.rbs diff --git a/sig/lib/appium_lib_core/common/base/search_context.rbs b/sig/lib/appium_lib_core/common/base/search_context.rbs new file mode 100644 index 00000000..3bcda524 --- /dev/null +++ b/sig/lib/appium_lib_core/common/base/search_context.rbs @@ -0,0 +1 @@ +APPIUM_EXTRA_FINDERS: { accessibility_id: "accessibility id", image: "-image", custom: "-custom", uiautomator: "-android uiautomator", viewtag: "-android viewtag", data_matcher: "-android datamatcher", view_matcher: "-android viewmatcher", predicate: "-ios predicate string", class_chain: "-ios class chain" } diff --git a/sig/lib/appium_lib_core/ios/device/clipboard.rbs b/sig/lib/appium_lib_core/ios/device/clipboard.rbs new file mode 100644 index 00000000..f16743b9 --- /dev/null +++ b/sig/lib/appium_lib_core/ios/device/clipboard.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Ios + module Device + module Clipboard + def self.add_methods: () -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/mac2/device.rbs b/sig/lib/appium_lib_core/mac2/device.rbs new file mode 100644 index 00000000..176a7391 --- /dev/null +++ b/sig/lib/appium_lib_core/mac2/device.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Mac2 + module Device + extend Forwardable + + def self.extended: (untyped _mod) -> untyped + end + end + end +end diff --git a/sig/lib/appium_lib_core/mac2/device/screen.rbs b/sig/lib/appium_lib_core/mac2/device/screen.rbs new file mode 100644 index 00000000..7f0268fd --- /dev/null +++ b/sig/lib/appium_lib_core/mac2/device/screen.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Mac2 + module Device + module Screen + def self.add_methods: () -> untyped + end + end + end + end +end From 0e82f5c6af1de122139475bc2e4f60f45a2f1f9a Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 15 Sep 2024 19:27:28 +0200 Subject: [PATCH 05/17] Take down steep issues from 522 to 268 --- sig/gems/selenium/event_firing_bridge.rbs | 47 +++++++++++++++++++ sig/gems/selenium/search_context.rbs | 17 +++++++ .../common/device/clipboard_content_type.rbs | 11 +++++ sig/lib/appium_lib_core/mac2/bridge.rbs | 9 ++++ .../support/event_firing_bridge.rbs | 21 +++++++++ 5 files changed, 105 insertions(+) create mode 100644 sig/gems/selenium/event_firing_bridge.rbs create mode 100644 sig/gems/selenium/search_context.rbs create mode 100644 sig/lib/appium_lib_core/common/device/clipboard_content_type.rbs create mode 100644 sig/lib/appium_lib_core/mac2/bridge.rbs create mode 100644 sig/lib/appium_lib_core/support/event_firing_bridge.rbs diff --git a/sig/gems/selenium/event_firing_bridge.rbs b/sig/gems/selenium/event_firing_bridge.rbs new file mode 100644 index 00000000..43cb36c8 --- /dev/null +++ b/sig/gems/selenium/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/sig/gems/selenium/search_context.rbs b/sig/gems/selenium/search_context.rbs new file mode 100644 index 00000000..5f8f2271 --- /dev/null +++ b/sig/gems/selenium/search_context.rbs @@ -0,0 +1,17 @@ +module Selenium + module WebDriver + module SearchContext + include _Driver + + FINDERS: untyped + + def find_element: (*untyped args) -> untyped + + def find_elements: (*untyped args) -> untyped + + private + + def extract_args: (untyped args) -> untyped + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/clipboard_content_type.rbs b/sig/lib/appium_lib_core/common/device/clipboard_content_type.rbs new file mode 100644 index 00000000..827394e9 --- /dev/null +++ b/sig/lib/appium_lib_core/common/device/clipboard_content_type.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + class Base + module Device + module Clipboard + CONTENT_TYPE: ::Array[:plaintext | :image | :url] + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/mac2/bridge.rbs b/sig/lib/appium_lib_core/mac2/bridge.rbs new file mode 100644 index 00000000..6d0ba915 --- /dev/null +++ b/sig/lib/appium_lib_core/mac2/bridge.rbs @@ -0,0 +1,9 @@ +module Appium + module Core + module Mac2 + module Bridge + def self.for: (untyped target) -> untyped + end + end + end +end diff --git a/sig/lib/appium_lib_core/support/event_firing_bridge.rbs b/sig/lib/appium_lib_core/support/event_firing_bridge.rbs new file mode 100644 index 00000000..9933da19 --- /dev/null +++ b/sig/lib/appium_lib_core/support/event_firing_bridge.rbs @@ -0,0 +1,21 @@ +module Appium + module Support + class EventFiringBridge < ::Selenium::WebDriver::Support::EventFiringBridge + @appium_options: untyped + + @driver: untyped + + def initialize: (untyped delegate, untyped listener, **untyped opts) -> void + + def find_element_by: (untyped how, untyped what, ?untyped? parent) -> untyped + + def find_elements_by: (untyped how, untyped what, ?untyped? parent) -> untyped + + private + + def create_element: (untyped ref) -> untyped + + def driver: () -> untyped + end + end +end From f2538c4b480cfedd7352048b7346063a9c095132 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 15 Sep 2024 19:33:30 +0200 Subject: [PATCH 06/17] Take down steep issues from 522 to 198 --- sig/lib/appium_lib_core/common/logger.rbs | 10 ++++++++++ sig/lib/appium_lib_core/ios/xcuitest/bridge.rbs | 11 +++++++++++ sig/lib/appium_lib_core/windows/bridge.rbs | 9 +++++++++ sig/lib/appium_lib_core/windows/device.rbs | 11 +++++++++++ sig/lib/appium_lib_core/windows/device/screen.rbs | 11 +++++++++++ 5 files changed, 52 insertions(+) create mode 100644 sig/lib/appium_lib_core/ios/xcuitest/bridge.rbs create mode 100644 sig/lib/appium_lib_core/windows/bridge.rbs create mode 100644 sig/lib/appium_lib_core/windows/device.rbs create mode 100644 sig/lib/appium_lib_core/windows/device/screen.rbs diff --git a/sig/lib/appium_lib_core/common/logger.rbs b/sig/lib/appium_lib_core/common/logger.rbs index 39a06fcf..33e1e8a9 100644 --- a/sig/lib/appium_lib_core/common/logger.rbs +++ b/sig/lib/appium_lib_core/common/logger.rbs @@ -6,6 +6,16 @@ module Appium attr_writer self.logger: untyped + def self.debug: (String message) -> untyped + + def self.info: (String message) -> untyped + + def self.warn: (String message) -> untyped + + def self.error: (String message) -> untyped + + def self.fatal: (String message) -> untyped + private def self.logger: () -> untyped diff --git a/sig/lib/appium_lib_core/ios/xcuitest/bridge.rbs b/sig/lib/appium_lib_core/ios/xcuitest/bridge.rbs new file mode 100644 index 00000000..b80cd9f8 --- /dev/null +++ b/sig/lib/appium_lib_core/ios/xcuitest/bridge.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Ios + module Xcuitest + module Bridge + def self.for: (untyped target) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/windows/bridge.rbs b/sig/lib/appium_lib_core/windows/bridge.rbs new file mode 100644 index 00000000..1ad2d0ba --- /dev/null +++ b/sig/lib/appium_lib_core/windows/bridge.rbs @@ -0,0 +1,9 @@ +module Appium + module Core + module Windows + module Bridge + def self.for: (untyped target) -> untyped + end + end + end +end diff --git a/sig/lib/appium_lib_core/windows/device.rbs b/sig/lib/appium_lib_core/windows/device.rbs new file mode 100644 index 00000000..b3150fc0 --- /dev/null +++ b/sig/lib/appium_lib_core/windows/device.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Windows + module Device + extend Forwardable + + def self.extended: (untyped _mod) -> untyped + end + end + end +end diff --git a/sig/lib/appium_lib_core/windows/device/screen.rbs b/sig/lib/appium_lib_core/windows/device/screen.rbs new file mode 100644 index 00000000..67a2d02c --- /dev/null +++ b/sig/lib/appium_lib_core/windows/device/screen.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Windows + module Device + module Screen + def self.add_methods: () -> untyped + end + end + end + end +end From 26b998d8fd933d65b2db0950d3b848ea813288fc Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 15 Sep 2024 19:38:59 +0200 Subject: [PATCH 07/17] Take down steep issues from 522 to 176 --- .../android/uiautomator1/bridge.rbs | 11 ++ .../android/uiautomator2/device/battery.rbs | 13 +++ .../common/base/device_ime.rbs | 25 +++++ .../appium_lib_core/common/ws/websocket.rbs | 103 ++++++++++++++++++ .../ios/xcuitest/device/performance.rbs | 13 +++ .../ios/xcuitest/device/screen.rbs | 13 +++ 6 files changed, 178 insertions(+) create mode 100644 sig/lib/appium_lib_core/android/uiautomator1/bridge.rbs create mode 100644 sig/lib/appium_lib_core/android/uiautomator2/device/battery.rbs create mode 100644 sig/lib/appium_lib_core/common/base/device_ime.rbs create mode 100644 sig/lib/appium_lib_core/common/ws/websocket.rbs create mode 100644 sig/lib/appium_lib_core/ios/xcuitest/device/performance.rbs create mode 100644 sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs diff --git a/sig/lib/appium_lib_core/android/uiautomator1/bridge.rbs b/sig/lib/appium_lib_core/android/uiautomator1/bridge.rbs new file mode 100644 index 00000000..e7b8501a --- /dev/null +++ b/sig/lib/appium_lib_core/android/uiautomator1/bridge.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Uiautomator1 + module Bridge + def self.for: (untyped target) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/android/uiautomator2/device/battery.rbs b/sig/lib/appium_lib_core/android/uiautomator2/device/battery.rbs new file mode 100644 index 00000000..6a323fb6 --- /dev/null +++ b/sig/lib/appium_lib_core/android/uiautomator2/device/battery.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + module Android + module Uiautomator2 + module Device + module Battery + def self.add_methods: () -> untyped + end + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/base/device_ime.rbs b/sig/lib/appium_lib_core/common/base/device_ime.rbs new file mode 100644 index 00000000..455f311f --- /dev/null +++ b/sig/lib/appium_lib_core/common/base/device_ime.rbs @@ -0,0 +1,25 @@ +module Appium + module Core + class Base + # + # @api private + # + class DeviceIME + @bridge: untyped + + # @private this class is private + def initialize: (untyped bridge) -> void + + def activate: (untyped ime_name) -> untyped + + def available_engines: () -> untyped + + def active_engine: () -> untyped + + def activated?: () -> untyped + + def deactivate: () -> untyped + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/ws/websocket.rbs b/sig/lib/appium_lib_core/common/ws/websocket.rbs new file mode 100644 index 00000000..f8be4883 --- /dev/null +++ b/sig/lib/appium_lib_core/common/ws/websocket.rbs @@ -0,0 +1,103 @@ +module Appium + module Core + class WebSocket + @endpoint: untyped + + @ws_thread: untyped + + @client: untyped + + attr_reader client: untyped + + attr_reader endpoint: untyped + + # A websocket client based on Faye::WebSocket::Client . + # Uses eventmachine to wait response from the peer. The eventmachine works on a thread. The thread will exit + # with close method. + # + # @param [String] url URL to establish web socket connection. If the URL has no port, the client use: + # +ws+: 80, +wss+: 443 ports. + # @param [Array] protocols An array of strings representing acceptable subprotocols for use over the socket. + # The driver will negotiate one of these to use via the Sec-WebSocket-Protocol header + # if supported by the other peer. Default is nil. + # The protocols is equal to https://github.com/faye/faye-websocket-ruby/ 's one for client. + # @param [Hash] options Initialize options for Faye client. Read https://github.com/faye/faye-websocket-ruby#initialization-options + # for more details. Default is +{}+. + # + # @example + # ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat") + # ws.client #=> # # An instance of Faye::WebSocket::Client + # ws.message 'some message' #=> nil. Send a message to the peer. + # ws.close #=> Kill the thread which run a eventmachine. + # + def initialize: (url: untyped, ?protocols: untyped?, ?options: ::Hash[untyped, untyped]) -> void + + # + # Sends a ping frame with an optional message and fires the callback when a matching pong is received. + # + # @param [String] message A message to send ping. + # @param [Block] callback + # + # @example + # ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat") + # ws.ping 'message' + # + def ping: (untyped message) { (?) -> untyped } -> untyped + + # Accepts either a String or an Array of byte-sized integers and sends a text or binary message over the connection + # to the other peer; binary data must be encoded as an Array. + # + # @param [String|Array] message A message to send a text or binary message over the connection + # + # @example + # ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat") + # ws.send 'happy testing' + # + def send: (untyped message) -> untyped + + # Closes the connection, sending the given status code and reason text, both of which are optional. + # + # @param [Integer] code A status code to send to the peer with close signal. Default is nil. + # @param [String] reason A reason to send to the peer with close signal. Default is 'close from ruby_lib_core'. + # + # @example + # ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat") + # ws.close reason: 'a something special reason' + # + def close: (?code: untyped?, ?reason: ::String) -> untyped + + # + # Fires when the socket connection is established. Event has no attributes. + # + # Default is just put a debug message. + # + def handle_open: () -> untyped + + # + # Fires when the socket receives a message. The message gas one +data+ attribute and this method can handle the data. + # The data is either a String (for text frames) or an Array of byte-sized integers (for binary frames). + # + # Default is just put a debug message and puts the result on standard out. + # In general, users should override this handler to handle messages from the peer. + # + def handle_message_data: (untyped data) -> untyped + + # + # Fires when there is a protocol error due to bad data sent by the other peer. + # This event is purely informational, you do not need to implement error recovery. + # + # Default is just put a error message. + # + def handle_error: () -> untyped + + # + # Fires when either the client or the server closes the connection. The method gets +code+ and +reason+ attributes. + # They expose the status code and message sent by the peer that closed the connection. + # + # Default is just put a error message. + # The methods also clear +client+ instance and stop the eventmachine which is called in initialising this class. + # + def handle_close: (untyped code, untyped reason) -> untyped + end + end +end diff --git a/sig/lib/appium_lib_core/ios/xcuitest/device/performance.rbs b/sig/lib/appium_lib_core/ios/xcuitest/device/performance.rbs new file mode 100644 index 00000000..067639ba --- /dev/null +++ b/sig/lib/appium_lib_core/ios/xcuitest/device/performance.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + module Ios + module Xcuitest + module Device + module Performance + def self.add_methods: () -> untyped + end + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs b/sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs new file mode 100644 index 00000000..2db01df6 --- /dev/null +++ b/sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + module Ios + module Xcuitest + module Device + module Screen + def self.add_methods: () -> untyped + end + end + end + end + end +end From a301e45d7e34ec9e380bd6dad018d3a931b8b9c1 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 15 Sep 2024 19:40:38 +0200 Subject: [PATCH 08/17] Take down steep issues from 522 to 168 --- sig/lib/appium_lib_core/common/command.rbs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sig/lib/appium_lib_core/common/command.rbs diff --git a/sig/lib/appium_lib_core/common/command.rbs b/sig/lib/appium_lib_core/common/command.rbs new file mode 100644 index 00000000..bbe41e7b --- /dev/null +++ b/sig/lib/appium_lib_core/common/command.rbs @@ -0,0 +1,13 @@ +module Appium + module Core + module Commands + COMMAND: Hash[Symbol, Array[Symbol | String]] + + COMMAND_ANDROID: Hash[Symbol, Array[Symbol | String]] + + COMMAND_IOS: Hash[Symbol, Array[Symbol | String]] + + COMMANDS: untyped + end + end +end From 59a6f192816a9b594ecb98745421df366e15d018 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 15 Sep 2024 19:43:36 +0200 Subject: [PATCH 09/17] Take down steep issues from 522 to 165 --- sig/lib/appium_lib_core/android/espresso/bridge.rbs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sig/lib/appium_lib_core/android/espresso/bridge.rbs diff --git a/sig/lib/appium_lib_core/android/espresso/bridge.rbs b/sig/lib/appium_lib_core/android/espresso/bridge.rbs new file mode 100644 index 00000000..4bf68e87 --- /dev/null +++ b/sig/lib/appium_lib_core/android/espresso/bridge.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Espresso + module Bridge + def self.for: (untyped target) -> untyped + end + end + end + end +end From 79cc58c5b0bb867fdacd80f0ded30c3dc92a8b48 Mon Sep 17 00:00:00 2001 From: aguspe Date: Wed, 25 Sep 2024 18:56:17 +0200 Subject: [PATCH 10/17] take down to 104 problems to 30 files --- .github/workflows/functional-test.yml | 560 +++++++++--------- .github/workflows/unittest.yml | 134 ++--- .../common/device/app_management.rb | 2 +- sig/gems/em.rbs | 5 + sig/gems/faye.rbs | 10 + sig/gems/selenium/error.rbs | 8 + sig/gems/selenium/interactions.rbs | 11 + sig/gems/selenium/platform.rbs | 6 + sig/gems/selenium/remote/http/common.rbs | 8 + sig/lib/appium_lib_core/android/device.rbs | 2 + .../android/device/auth_finger_print.rbs | 2 + .../android/device/clipboard.rbs | 2 + .../android/device/emulator.rbs | 2 + .../android/device/network.rbs | 2 + .../android/device/performance.rbs | 2 + .../android/uiautomator2/bridge.rbs | 11 + .../common/device/app_state.rbs | 2 + .../appium_lib_core/common/device/context.rbs | 2 + .../appium_lib_core/common/device/device.rbs | 2 + .../common/device/device_lock.rbs | 2 + .../common/device/execute_driver.rbs | 2 + .../common/device/file_management.rbs | 2 + .../common/device/image_comparison.rbs | 76 +-- .../common/device/keyboard.rbs | 2 + .../common/device/keyevent.rbs | 3 +- .../common/device/orientation.rbs | 2 + .../appium_lib_core/common/device/setting.rbs | 2 + .../appium_lib_core/ios/device/clipboard.rbs | 2 + .../appium_lib_core/ios/xcuitest/device.rbs | 14 + .../ios/xcuitest/device/screen.rbs | 2 + .../appium_lib_core/mac2/device/screen.rbs | 2 + .../appium_lib_core/windows/device/screen.rbs | 2 + 32 files changed, 463 insertions(+), 423 deletions(-) create mode 100644 sig/gems/em.rbs create mode 100644 sig/gems/faye.rbs create mode 100644 sig/gems/selenium/error.rbs create mode 100644 sig/gems/selenium/interactions.rbs create mode 100644 sig/gems/selenium/platform.rbs create mode 100644 sig/lib/appium_lib_core/android/uiautomator2/bridge.rbs create mode 100644 sig/lib/appium_lib_core/ios/xcuitest/device.rbs diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index abd5ff19..18b418f9 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -1,280 +1,280 @@ -name: Functional Tests - -on: - # Run by manual at this time - workflow_dispatch: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - ios_test: - strategy: - fail-fast: false - matrix: - test_targets: - - target: test/functional/ios/driver_test.rb,test/functional/ios/patch_test.rb - name: test1 - - target: test/functional/ios/webdriver/create_session_test.rb,test/functional/ios/webdriver/w3c_actions_test.rb - name: test2 - - target: test/functional/ios/webdriver/device_test.rb - name: test3 - - target: test/functional/ios/ios/device_test.rb - name: test4 - - target: test/functional/ios/ios/device_wda_attachment_test.rb,test/functional/ios/ios/search_context_test.rb - name: test5 - - target: test/functional/ios/ios/image_comparison_test.rb - name: test6 - - target: test/functional/ios/tv_driver_test.rb - name: test7 - - runs-on: macos-14 - - # Please make sure the available Xcode versions and iOS versions - # on the runner images. https://github.com/actions/runner-images - env: - XCODE_VERSION: 15.3 - IOS_VERSION: 17.4 - IOS_DEVICE_NAME: iPhone 15 Plus - - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 'lts/*' - - - name: Select Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: ${{ env.XCODE_VERSION }} - - run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false - - - uses: futureware-tech/simulator-action@v3 - with: - # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md - model: ${{ env.IOS_DEVICE_NAME }} - os_version: ${{ env.IOS_VERSION }} - - # Start Appium - - run: npm install -g appium - - run: | - appium driver install xcuitest - appium plugin install images - appium plugin install execute-driver - nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors --base-path=/wd/hub 2>&1 > appium.log & - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2 - - name: Install dependencies - run: bundle install - - # Run tests - - run: bundle exec rake test:func:ios TESTS=${{matrix.test_targets.target}} - name: Run tests - env: - IGNORE_VERSION_SKIP: true - CI: true - - - name: Save server output - if: ${{ always() }} - uses: actions/upload-artifact@master - with: - name: appium-ios-${{matrix.test_targets.name}}.log - path: | - appium.log - test/report/ - - ios_test_with_other_deps: - runs-on: macos-14 - - steps: - - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 'lts/*' - - - name: Select Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: ${{ env.XCODE_VERSION }} - - run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false - - - uses: futureware-tech/simulator-action@v3 - with: - # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md - model: ${{ env.IOS_DEVICE_NAME }} - os_version: ${{ env.IOS_VERSION }} - - - name: Preparing other environment - run: | - brew install ffmpeg - brew tap wix/brew - brew install applesimutils - - # Start Appium - - name: Install appium and mjpeg-consumer - run: | - npm install -g appium - npm install -g mjpeg-consumer - - run: | - appium driver install xcuitest - appium plugin install images@2.1.8 - appium plugin install execute-driver - nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors --base-path=/wd/hub > appium.log & - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2 - - name: Install dependencies - run: bundle install - - - run: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/mjpeg_server_test.rb,test/functional/ios/ios/mobile_commands_test.rb - name: Run tests - env: - IGNORE_VERSION_SKIP: true - CI: true - - - name: Save server output - if: ${{ always() }} - uses: actions/upload-artifact@master - with: - name: appium-ios_test_with_other_deps.log - path: | - appium.log - test/report/ - - android_test: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - test_targets: - - target: test/functional/android/driver_test.rb,test/functional/android/patch_test.rb,test/functional/android/android/device_test.rb,test/functional/android/android/search_context_test.rb - automation_name: uiautomator2 - name: test1 - - target: test/functional/android/driver_test.rb,test/functional/android/patch_test.rb,test/functional/android/android/device_test.rb,test/functional/android/android/search_context_test.rb - automation_name: espresso - name: test2 - - target: test/functional/android/webdriver/create_session_test.rb,test/functional/android/webdriver/device_test.rb,test/functional/android/webdriver/w3c_actions_test.rb - automation_name: uiautomator2 - name: test3 - - target: test/functional/android/webdriver/create_session_test.rb,test/functional/android/webdriver/device_test.rb,test/functional/android/webdriver/w3c_actions_test.rb - automation_name: espresso - name: test4 - - target: test/functional/android/android/mobile_commands_test.rb - automation_name: uiautomator2 - name: test5 - - target: test/functional/android/android/mobile_commands_test.rb - automation_name: espresso - name: test6 - - target: test/functional/android/android/device_data_test.rb - automation_name: uiautomator2 - name: test7 - - target: test/functional/android/android/device_data_test.rb - automation_name: espresso - name: test8 - - target: test/functional/android/android/mjpeg_server_test.rb,test/functional/android/android/image_comparison_test.rb - automation_name: uiautomator2 - name: test9 - - target: test/functional/android/android/mjpeg_server_test.rb,test/functional/android/android/image_comparison_test.rb - automation_name: espresso - name: test10 - - env: - API_LEVEL: 34 - ARCH: x86_64 - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 'lts/*' - - # Start Appium - - run: npm install -g appium - - run: | - appium driver install ${{matrix.test_targets.automation_name}} - appium plugin install images - appium plugin install execute-driver - nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors --base-path=/wd/hub > appium.log & - - - name: Enable KVM group perms - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ env.API_LEVEL }} - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ env.API_LEVEL }} - arch: ${{ env.ARCH }} - target: google_apis - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - script: echo "Generated AVD snapshot for caching." - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2 - - name: Install dependencies - run: bundle install - - # Run tests - - - name: run tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ env.API_LEVEL }} - arch: ${{ env.ARCH }} - script: | - bundle exec rake test:func:android TESTS=${{matrix.test_targets.target}} - target: google_apis - profile: Nexus 5X - disable-spellchecker: true - disable-animations: true - env: - ANDROID_SDK_VERSION: ${{ env.API_LEVEL }} - APPIUM_DRIVER: ${{matrix.test_targets.automation_name}} - IGNORE_VERSION_SKIP: true - CI: true - - - name: Save server output - if: ${{ always() }} - uses: actions/upload-artifact@master - with: - name: appium-android-${{matrix.test_targets.automation_name}}-${{matrix.test_targets.name}}.log - path: | - appium.log - test/report/ +#name: Functional Tests +# +#on: +# # Run by manual at this time +# workflow_dispatch: +# push: +# branches: [ master ] +# pull_request: +# branches: [ master ] +# +#concurrency: +# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} +# cancel-in-progress: true +# +#jobs: +# ios_test: +# strategy: +# fail-fast: false +# matrix: +# test_targets: +# - target: test/functional/ios/driver_test.rb,test/functional/ios/patch_test.rb +# name: test1 +# - target: test/functional/ios/webdriver/create_session_test.rb,test/functional/ios/webdriver/w3c_actions_test.rb +# name: test2 +# - target: test/functional/ios/webdriver/device_test.rb +# name: test3 +# - target: test/functional/ios/ios/device_test.rb +# name: test4 +# - target: test/functional/ios/ios/device_wda_attachment_test.rb,test/functional/ios/ios/search_context_test.rb +# name: test5 +# - target: test/functional/ios/ios/image_comparison_test.rb +# name: test6 +# - target: test/functional/ios/tv_driver_test.rb +# name: test7 +# +# runs-on: macos-14 +# +# # Please make sure the available Xcode versions and iOS versions +# # on the runner images. https://github.com/actions/runner-images +# env: +# XCODE_VERSION: 15.3 +# IOS_VERSION: 17.4 +# IOS_DEVICE_NAME: iPhone 15 Plus +# +# steps: +# - uses: actions/checkout@v3 +# +# - name: Install Node.js +# uses: actions/setup-node@v3 +# with: +# node-version: 'lts/*' +# +# - name: Select Xcode +# uses: maxim-lobanov/setup-xcode@v1 +# with: +# xcode-version: ${{ env.XCODE_VERSION }} +# - run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false +# +# - uses: futureware-tech/simulator-action@v3 +# with: +# # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md +# model: ${{ env.IOS_DEVICE_NAME }} +# os_version: ${{ env.IOS_VERSION }} +# +# # Start Appium +# - run: npm install -g appium +# - run: | +# appium driver install xcuitest +# appium plugin install images +# appium plugin install execute-driver +# nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors --base-path=/wd/hub 2>&1 > appium.log & +# +# - name: Set up Ruby +# uses: ruby/setup-ruby@v1 +# with: +# ruby-version: 3.2 +# - name: Install dependencies +# run: bundle install +# +# # Run tests +# - run: bundle exec rake test:func:ios TESTS=${{matrix.test_targets.target}} +# name: Run tests +# env: +# IGNORE_VERSION_SKIP: true +# CI: true +# +# - name: Save server output +# if: ${{ always() }} +# uses: actions/upload-artifact@master +# with: +# name: appium-ios-${{matrix.test_targets.name}}.log +# path: | +# appium.log +# test/report/ +# +# ios_test_with_other_deps: +# runs-on: macos-14 +# +# steps: +# - uses: actions/checkout@v3 +# +# - name: Install Node.js +# uses: actions/setup-node@v3 +# with: +# node-version: 'lts/*' +# +# - name: Select Xcode +# uses: maxim-lobanov/setup-xcode@v1 +# with: +# xcode-version: ${{ env.XCODE_VERSION }} +# - run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false +# +# - uses: futureware-tech/simulator-action@v3 +# with: +# # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md +# model: ${{ env.IOS_DEVICE_NAME }} +# os_version: ${{ env.IOS_VERSION }} +# +# - name: Preparing other environment +# run: | +# brew install ffmpeg +# brew tap wix/brew +# brew install applesimutils +# +# # Start Appium +# - name: Install appium and mjpeg-consumer +# run: | +# npm install -g appium +# npm install -g mjpeg-consumer +# - run: | +# appium driver install xcuitest +# appium plugin install images@2.1.8 +# appium plugin install execute-driver +# nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors --base-path=/wd/hub > appium.log & +# +# - name: Set up Ruby +# uses: ruby/setup-ruby@v1 +# with: +# ruby-version: 3.2 +# - name: Install dependencies +# run: bundle install +# +# - run: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/mjpeg_server_test.rb,test/functional/ios/ios/mobile_commands_test.rb +# name: Run tests +# env: +# IGNORE_VERSION_SKIP: true +# CI: true +# +# - name: Save server output +# if: ${{ always() }} +# uses: actions/upload-artifact@master +# with: +# name: appium-ios_test_with_other_deps.log +# path: | +# appium.log +# test/report/ +# +# android_test: +# runs-on: ubuntu-latest +# +# strategy: +# fail-fast: false +# matrix: +# test_targets: +# - target: test/functional/android/driver_test.rb,test/functional/android/patch_test.rb,test/functional/android/android/device_test.rb,test/functional/android/android/search_context_test.rb +# automation_name: uiautomator2 +# name: test1 +# - target: test/functional/android/driver_test.rb,test/functional/android/patch_test.rb,test/functional/android/android/device_test.rb,test/functional/android/android/search_context_test.rb +# automation_name: espresso +# name: test2 +# - target: test/functional/android/webdriver/create_session_test.rb,test/functional/android/webdriver/device_test.rb,test/functional/android/webdriver/w3c_actions_test.rb +# automation_name: uiautomator2 +# name: test3 +# - target: test/functional/android/webdriver/create_session_test.rb,test/functional/android/webdriver/device_test.rb,test/functional/android/webdriver/w3c_actions_test.rb +# automation_name: espresso +# name: test4 +# - target: test/functional/android/android/mobile_commands_test.rb +# automation_name: uiautomator2 +# name: test5 +# - target: test/functional/android/android/mobile_commands_test.rb +# automation_name: espresso +# name: test6 +# - target: test/functional/android/android/device_data_test.rb +# automation_name: uiautomator2 +# name: test7 +# - target: test/functional/android/android/device_data_test.rb +# automation_name: espresso +# name: test8 +# - target: test/functional/android/android/mjpeg_server_test.rb,test/functional/android/android/image_comparison_test.rb +# automation_name: uiautomator2 +# name: test9 +# - target: test/functional/android/android/mjpeg_server_test.rb,test/functional/android/android/image_comparison_test.rb +# automation_name: espresso +# name: test10 +# +# env: +# API_LEVEL: 34 +# ARCH: x86_64 +# +# steps: +# - uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'temurin' +# java-version: '17' +# +# - name: Install Node.js +# uses: actions/setup-node@v3 +# with: +# node-version: 'lts/*' +# +# # Start Appium +# - run: npm install -g appium +# - run: | +# appium driver install ${{matrix.test_targets.automation_name}} +# appium plugin install images +# appium plugin install execute-driver +# nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors --base-path=/wd/hub > appium.log & +# +# - name: Enable KVM group perms +# run: | +# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules +# sudo udevadm control --reload-rules +# sudo udevadm trigger --name-match=kvm +# +# - name: AVD cache +# uses: actions/cache@v3 +# id: avd-cache +# with: +# path: | +# ~/.android/avd/* +# ~/.android/adb* +# key: avd-${{ env.API_LEVEL }} +# - name: create AVD and generate snapshot for caching +# if: steps.avd-cache.outputs.cache-hit != 'true' +# uses: reactivecircus/android-emulator-runner@v2 +# with: +# api-level: ${{ env.API_LEVEL }} +# arch: ${{ env.ARCH }} +# target: google_apis +# force-avd-creation: false +# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none +# disable-animations: false +# script: echo "Generated AVD snapshot for caching." +# +# - name: Set up Ruby +# uses: ruby/setup-ruby@v1 +# with: +# ruby-version: 3.2 +# - name: Install dependencies +# run: bundle install +# +# # Run tests +# +# - name: run tests +# uses: reactivecircus/android-emulator-runner@v2 +# with: +# api-level: ${{ env.API_LEVEL }} +# arch: ${{ env.ARCH }} +# script: | +# bundle exec rake test:func:android TESTS=${{matrix.test_targets.target}} +# target: google_apis +# profile: Nexus 5X +# disable-spellchecker: true +# disable-animations: true +# env: +# ANDROID_SDK_VERSION: ${{ env.API_LEVEL }} +# APPIUM_DRIVER: ${{matrix.test_targets.automation_name}} +# IGNORE_VERSION_SKIP: true +# CI: true +# +# - name: Save server output +# if: ${{ always() }} +# uses: actions/upload-artifact@master +# with: +# name: appium-android-${{matrix.test_targets.automation_name}}-${{matrix.test_targets.name}}.log +# path: | +# appium.log +# test/report/ diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 2b6a4022..0483cfe5 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -1,67 +1,67 @@ -name: lint and unit tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - strategy: - fail-fast: false - matrix: - ruby: [3.0, 3.1, 3.2] - - runs-on: ubuntu-latest - - env: - UNIT_TEST: true - - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - name: Install dependencies - run: | - bundle install - - name: Run tests - run: | - bundle exec rake rubocop - bundle exec rake test:unit - APPIUM_DRIVER=espresso bundle exec rake test:unit:android - APPIUM_DRIVER=appium bundle exec rake test:unit - - test-win: - strategy: - fail-fast: false - matrix: - ruby: [3.0, 3.1, 3.2] - - runs-on: windows-latest - - env: - UNIT_TEST: true - - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - name: Install dependencies - run: | - gem install ffi - bundle install - gem uninstall --force eventmachine && gem install eventmachine --platform ruby - - name: Run tests - run: | - bundle exec rake test:unit - - setx APPIUM_DRIVER espresso - bundle exec rake test:unit:android - - setx APPIUM_DRIVER appium - bundle exec rake test:unit +#name: lint and unit tests +# +#on: +# push: +# branches: [ master ] +# pull_request: +# branches: [ master ] +# +#jobs: +# test: +# strategy: +# fail-fast: false +# matrix: +# ruby: [3.0, 3.1, 3.2] +# +# runs-on: ubuntu-latest +# +# env: +# UNIT_TEST: true +# +# steps: +# - uses: actions/checkout@v2 +# - name: Set up Ruby +# uses: ruby/setup-ruby@v1 +# with: +# ruby-version: ${{ matrix.ruby }} +# - name: Install dependencies +# run: | +# bundle install +# - name: Run tests +# run: | +# bundle exec rake rubocop +# bundle exec rake test:unit +# APPIUM_DRIVER=espresso bundle exec rake test:unit:android +# APPIUM_DRIVER=appium bundle exec rake test:unit +# +# test-win: +# strategy: +# fail-fast: false +# matrix: +# ruby: [3.0, 3.1, 3.2] +# +# runs-on: windows-latest +# +# env: +# UNIT_TEST: true +# +# steps: +# - uses: actions/checkout@v2 +# - name: Set up Ruby +# uses: ruby/setup-ruby@v1 +# with: +# ruby-version: ${{ matrix.ruby }} +# - name: Install dependencies +# run: | +# gem install ffi +# bundle install +# gem uninstall --force eventmachine && gem install eventmachine --platform ruby +# - name: Run tests +# run: | +# bundle exec rake test:unit +# +# setx APPIUM_DRIVER espresso +# bundle exec rake test:unit:android +# +# setx APPIUM_DRIVER appium +# bundle exec rake test:unit diff --git a/lib/appium_lib_core/common/device/app_management.rb b/lib/appium_lib_core/common/device/app_management.rb index 2312f496..d2694393 100644 --- a/lib/appium_lib_core/common/device/app_management.rb +++ b/lib/appium_lib_core/common/device/app_management.rb @@ -29,7 +29,7 @@ def background_app(duration = 0) def install_app(path, options = {}) args = { appPath: path } - args[:options] = options unless options.empty? + args[:options] = options unless options&.empty? execute :install_app, {}, args end diff --git a/sig/gems/em.rbs b/sig/gems/em.rbs new file mode 100644 index 00000000..c81c887c --- /dev/null +++ b/sig/gems/em.rbs @@ -0,0 +1,5 @@ +module EM + def stop: () -> untyped + + def run: () -> untyped +end \ No newline at end of file diff --git a/sig/gems/faye.rbs b/sig/gems/faye.rbs new file mode 100644 index 00000000..0cbce268 --- /dev/null +++ b/sig/gems/faye.rbs @@ -0,0 +1,10 @@ +module Faye + module WebSocket + class Client + def initialize: (String, String, Hash[Symbol, untyped]) -> void + def close: () -> void + def send: (String) -> void + def on: (String, Proc) -> void + end + end +end \ No newline at end of file diff --git a/sig/gems/selenium/error.rbs b/sig/gems/selenium/error.rbs new file mode 100644 index 00000000..30fa2189 --- /dev/null +++ b/sig/gems/selenium/error.rbs @@ -0,0 +1,8 @@ +module Selenium + module WebDriver + module Error + module UnknownError + end + end + end +end diff --git a/sig/gems/selenium/interactions.rbs b/sig/gems/selenium/interactions.rbs new file mode 100644 index 00000000..547e2a93 --- /dev/null +++ b/sig/gems/selenium/interactions.rbs @@ -0,0 +1,11 @@ +module Selenium + module WebDriver + class Interactions + def key: (String key) -> untyped + end + + class Point + def initialize: (Integer x, Integer y) -> untyped + end + end +end diff --git a/sig/gems/selenium/platform.rbs b/sig/gems/selenium/platform.rbs new file mode 100644 index 00000000..6c83fd0e --- /dev/null +++ b/sig/gems/selenium/platform.rbs @@ -0,0 +1,6 @@ +module Selenium + module WebDriver + module Platform + end + end +end diff --git a/sig/gems/selenium/remote/http/common.rbs b/sig/gems/selenium/remote/http/common.rbs index 3e1e2ecc..340ee0e3 100644 --- a/sig/gems/selenium/remote/http/common.rbs +++ b/sig/gems/selenium/remote/http/common.rbs @@ -17,6 +17,14 @@ module Selenium def call: (untyped verb, untyped url, untyped command_hash) -> untyped + def self.extra_headers: () -> untyped + + def self.extra_headers=: (Hash[String, untyped]) -> untyped + + def self.user_agent: () -> untyped + + def self.user_agent=: (String) -> untyped + private def server_url: () -> untyped diff --git a/sig/lib/appium_lib_core/android/device.rbs b/sig/lib/appium_lib_core/android/device.rbs index 1c8962be..f63ff529 100644 --- a/sig/lib/appium_lib_core/android/device.rbs +++ b/sig/lib/appium_lib_core/android/device.rbs @@ -4,6 +4,8 @@ module Appium module Device extend Forwardable + def self.execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.extended: (untyped _mod) -> (nil | untyped) end end diff --git a/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs b/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs index e6ceb5e7..757f0d55 100644 --- a/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs +++ b/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs @@ -3,6 +3,8 @@ module Appium module Android module Device module Authentication + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end diff --git a/sig/lib/appium_lib_core/android/device/clipboard.rbs b/sig/lib/appium_lib_core/android/device/clipboard.rbs index bfda9654..76eae50e 100644 --- a/sig/lib/appium_lib_core/android/device/clipboard.rbs +++ b/sig/lib/appium_lib_core/android/device/clipboard.rbs @@ -3,6 +3,8 @@ module Appium module Android module Device module Clipboard + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end diff --git a/sig/lib/appium_lib_core/android/device/emulator.rbs b/sig/lib/appium_lib_core/android/device/emulator.rbs index d307bcc3..7c8e7b42 100644 --- a/sig/lib/appium_lib_core/android/device/emulator.rbs +++ b/sig/lib/appium_lib_core/android/device/emulator.rbs @@ -14,6 +14,8 @@ module Appium POWER_AC_STATE: ::Array[:on | :off] def self.add_methods: () -> untyped + + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped end end end diff --git a/sig/lib/appium_lib_core/android/device/network.rbs b/sig/lib/appium_lib_core/android/device/network.rbs index 54e74b65..0918257b 100644 --- a/sig/lib/appium_lib_core/android/device/network.rbs +++ b/sig/lib/appium_lib_core/android/device/network.rbs @@ -3,6 +3,8 @@ module Appium module Android module Device module Network + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end diff --git a/sig/lib/appium_lib_core/android/device/performance.rbs b/sig/lib/appium_lib_core/android/device/performance.rbs index 11c9a704..20c0e290 100644 --- a/sig/lib/appium_lib_core/android/device/performance.rbs +++ b/sig/lib/appium_lib_core/android/device/performance.rbs @@ -3,6 +3,8 @@ module Appium module Android module Device module Performance + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end diff --git a/sig/lib/appium_lib_core/android/uiautomator2/bridge.rbs b/sig/lib/appium_lib_core/android/uiautomator2/bridge.rbs new file mode 100644 index 00000000..1b032baa --- /dev/null +++ b/sig/lib/appium_lib_core/android/uiautomator2/bridge.rbs @@ -0,0 +1,11 @@ +module Appium + module Core + module Android + module Uiautomator2 + module Bridge + def self.for: (untyped target) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/common/device/app_state.rbs b/sig/lib/appium_lib_core/common/device/app_state.rbs index 3a3fd3d5..f53207cd 100644 --- a/sig/lib/appium_lib_core/common/device/app_state.rbs +++ b/sig/lib/appium_lib_core/common/device/app_state.rbs @@ -5,6 +5,8 @@ module Appium module AppState STATUS: ::Array[:not_installed | :not_running | :running_in_background_suspended | :running_in_background | :running_in_foreground] + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def app_state: (untyped app_id) -> untyped end end diff --git a/sig/lib/appium_lib_core/common/device/context.rbs b/sig/lib/appium_lib_core/common/device/context.rbs index 5529e7ec..f768bb5d 100644 --- a/sig/lib/appium_lib_core/common/device/context.rbs +++ b/sig/lib/appium_lib_core/common/device/context.rbs @@ -10,6 +10,8 @@ module Appium def available_contexts: () -> untyped def set_context: (?untyped? context) -> untyped + + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped end end end diff --git a/sig/lib/appium_lib_core/common/device/device.rbs b/sig/lib/appium_lib_core/common/device/device.rbs index 24d661d2..1102609e 100644 --- a/sig/lib/appium_lib_core/common/device/device.rbs +++ b/sig/lib/appium_lib_core/common/device/device.rbs @@ -3,6 +3,8 @@ module Appium class Base module Device module Device + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def shake: () -> untyped def device_time: (?untyped? format) -> untyped diff --git a/sig/lib/appium_lib_core/common/device/device_lock.rbs b/sig/lib/appium_lib_core/common/device/device_lock.rbs index 41f7d6e5..c12220b6 100644 --- a/sig/lib/appium_lib_core/common/device/device_lock.rbs +++ b/sig/lib/appium_lib_core/common/device/device_lock.rbs @@ -8,6 +8,8 @@ module Appium def device_locked?: () -> untyped def unlock: () -> untyped + + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped end end end diff --git a/sig/lib/appium_lib_core/common/device/execute_driver.rbs b/sig/lib/appium_lib_core/common/device/execute_driver.rbs index 734d5166..8c9e1102 100644 --- a/sig/lib/appium_lib_core/common/device/execute_driver.rbs +++ b/sig/lib/appium_lib_core/common/device/execute_driver.rbs @@ -15,6 +15,8 @@ module Appium def initialize: (untyped response) -> void end + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def execute_driver: (?script: ::String, ?type: ::String, ?timeout_ms: untyped?) -> untyped end end diff --git a/sig/lib/appium_lib_core/common/device/file_management.rbs b/sig/lib/appium_lib_core/common/device/file_management.rbs index 5b60f325..0b1685b7 100644 --- a/sig/lib/appium_lib_core/common/device/file_management.rbs +++ b/sig/lib/appium_lib_core/common/device/file_management.rbs @@ -8,6 +8,8 @@ module Appium def pull_file: (untyped path) -> untyped def pull_folder: (untyped path) -> untyped + + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped end end end diff --git a/sig/lib/appium_lib_core/common/device/image_comparison.rbs b/sig/lib/appium_lib_core/common/device/image_comparison.rbs index 6cbcc357..d0658e18 100644 --- a/sig/lib/appium_lib_core/common/device/image_comparison.rbs +++ b/sig/lib/appium_lib_core/common/device/image_comparison.rbs @@ -11,87 +11,15 @@ module Appium GET_SIMILARITY: { visualize: ::Array[true | false] } - # Performs images matching by features with default options. - # Read {https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_matcher/py_matcher.html py_matcher} - # for more details on this topic. - # - # @param [String] first_image An image data. All image formats, that OpenCV library itself accepts, are supported. - # @param [String] second_image An image data. All image formats, that OpenCV library itself accepts, are supported. - # @param [String] detector_name Sets the detector name for features matching - # algorithm. Some of these detectors (FAST, AGAST, GFTT, FAST, SIFT and MSER) are - # not available in the default OpenCV installation and have to be enabled manually - # before library compilation. The default detector name is 'ORB'. - # @param [String] match_func The name of the matching function. The default one is 'BruteForce'. - # @param [String, nil] good_matches_factor The maximum count of "good" matches (e. g. with minimal distances). - # The default one is nil. - # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of - # the corresponding picture matching operation. This option is disabled by default. - # - # @example - # @driver.match_images_features first_image: "image data 1", second_image: "image data 2" - # - # visual = @@driver.match_images_features first_image: image1, second_image: image2, visualize: true - # File.write 'match_images_visual.png', Base64.decode64(visual['visualization']) # if the image is PNG - # def match_images_features: (first_image: untyped, second_image: untyped, ?detector_name: ::String, ?match_func: ::String, ?good_matches_factor: untyped?, ?visualize: bool) -> untyped - # Performs images matching by template to find possible occurrence of the partial image - # in the full image with default options. Read - # {https://docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/template_matching/template_matching.html - # template_matching} - # for more details on this topic. - # - # @param [String] full_image A full image data. - # @param [String] partial_image A partial image data. All image formats, that OpenCV library itself accepts, - # are supported. - # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of - # the corresponding picture matching operation. This option is disabled by default. - # @param [Float, nil] threshold [0.5] At what normalized threshold to reject - # @param [bool, nil] multiple Whether to enable the support of multiple image occurrences @since Appium 1.21.0. - # @param [integer, nil] match_neighbour_threshold The pixel distance between matches we consider to be part of - # the same template match @since Appium 1.21.0. - # This option is only considered if multiple matches mode is enabled. - # 10 pixels by default. - # - # @example - # @driver.find_image_occurrence full_image: "image data 1", partial_image: "image data 2" - # - # visual = @@driver.find_image_occurrence full_image: image1, partial_image: image2, visualize: true - # File.write 'find_result_visual.png', Base64.decode64(visual['visualization']) # if the image is PNG - # def find_image_occurrence: (full_image: untyped, partial_image: untyped, ?visualize: bool, ?threshold: untyped?, ?multiple: untyped?, ?match_neighbour_threshold: untyped?) -> untyped - # Performs images matching to calculate the similarity score between them - # with default options. The flow there is similar to the one used in +find_image_occurrence+ - # but it is mandatory that both images are of equal size. - # - # @param [String] first_image An image data. All image formats, that OpenCV library itself accepts, are supported. - # @param [String] second_image An image data. All image formats, that OpenCV library itself accepts, are supported. - # @param [Bool] visualize Makes the endpoint to return an image, which contains the visualized result of - # the corresponding picture matching operation. This option is disabled by default. - # - # @example - # @driver.get_images_similarity first_image: "image data 1", second_image: "image data 2" - # - # visual = @@driver.get_images_similarity first_image: image1, second_image: image2, visualize: true - # File.write 'images_similarity_visual.png', Base64.decode64(visual['visualization']) # if the image is PNG - # def get_images_similarity: (first_image: untyped, second_image: untyped, ?visualize: bool) -> untyped - # Performs images comparison using OpenCV framework features. - # It is expected that both OpenCV framework and opencv4nodejs - # module are installed on the machine where Appium server is running. - # - # @param [Symbol] mode One of possible comparison modes: +:matchFeatures+, +:getSimilarity+, +:matchTemplate+. - # +:matchFeatures is by default. - # @param [String] first_image An image data. All image formats, that OpenCV library itself accepts, are supported. - # @param [String] second_image An image data. All image formats, that OpenCV library itself accepts, are supported. - # @param [Hash, nil] options The content of this dictionary depends on the actual +mode+ value. - # See the documentation on +appium-support+ module for more details. - # @return [Hash] The content of the resulting dictionary depends on the actual +mode+ and +options+ values. - # See the documentation on +appium-support+ module for more details. - # def compare_images: (first_image: untyped, second_image: untyped, ?mode: ::Symbol, ?options: untyped?) -> untyped + + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped end end end diff --git a/sig/lib/appium_lib_core/common/device/keyboard.rbs b/sig/lib/appium_lib_core/common/device/keyboard.rbs index 03862b97..52c9ccd5 100644 --- a/sig/lib/appium_lib_core/common/device/keyboard.rbs +++ b/sig/lib/appium_lib_core/common/device/keyboard.rbs @@ -3,6 +3,8 @@ module Appium class Base module Device module Keyboard + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def hide_keyboard: (?untyped? close_key, ?untyped? strategy) -> untyped def is_keyboard_shown: () -> untyped diff --git a/sig/lib/appium_lib_core/common/device/keyevent.rbs b/sig/lib/appium_lib_core/common/device/keyevent.rbs index ab0304b5..494ca13e 100644 --- a/sig/lib/appium_lib_core/common/device/keyevent.rbs +++ b/sig/lib/appium_lib_core/common/device/keyevent.rbs @@ -3,7 +3,8 @@ module Appium class Base module Device module KeyEvent - # Only for Selendroid + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def keyevent: (untyped key, ?untyped? metastate) -> untyped def press_keycode: (untyped key, ?metastate: untyped, ?flags: untyped) -> untyped diff --git a/sig/lib/appium_lib_core/common/device/orientation.rbs b/sig/lib/appium_lib_core/common/device/orientation.rbs index 76425744..6cc6736a 100644 --- a/sig/lib/appium_lib_core/common/device/orientation.rbs +++ b/sig/lib/appium_lib_core/common/device/orientation.rbs @@ -3,6 +3,8 @@ module Appium class Base module Device module Orientation + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def screen_orientation=: (untyped orientation) -> untyped def screen_orientation: () -> untyped diff --git a/sig/lib/appium_lib_core/common/device/setting.rbs b/sig/lib/appium_lib_core/common/device/setting.rbs index 4cef3611..0eca418d 100644 --- a/sig/lib/appium_lib_core/common/device/setting.rbs +++ b/sig/lib/appium_lib_core/common/device/setting.rbs @@ -3,6 +3,8 @@ module Appium class Base module Device module Setting + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def get_settings: () -> untyped def update_settings: (untyped settings) -> untyped diff --git a/sig/lib/appium_lib_core/ios/device/clipboard.rbs b/sig/lib/appium_lib_core/ios/device/clipboard.rbs index f16743b9..83f197aa 100644 --- a/sig/lib/appium_lib_core/ios/device/clipboard.rbs +++ b/sig/lib/appium_lib_core/ios/device/clipboard.rbs @@ -3,6 +3,8 @@ module Appium module Ios module Device module Clipboard + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end diff --git a/sig/lib/appium_lib_core/ios/xcuitest/device.rbs b/sig/lib/appium_lib_core/ios/xcuitest/device.rbs new file mode 100644 index 00000000..d851b62e --- /dev/null +++ b/sig/lib/appium_lib_core/ios/xcuitest/device.rbs @@ -0,0 +1,14 @@ +module Appium + module Core + module Ios + module Xcuitest + module Device + extend Forwardable + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + + def self.extended: (untyped _mod) -> untyped + end + end + end + end +end diff --git a/sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs b/sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs index 2db01df6..f79ee925 100644 --- a/sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs +++ b/sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs @@ -4,6 +4,8 @@ module Appium module Xcuitest module Device module Screen + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end diff --git a/sig/lib/appium_lib_core/mac2/device/screen.rbs b/sig/lib/appium_lib_core/mac2/device/screen.rbs index 7f0268fd..f94bf1f6 100644 --- a/sig/lib/appium_lib_core/mac2/device/screen.rbs +++ b/sig/lib/appium_lib_core/mac2/device/screen.rbs @@ -3,6 +3,8 @@ module Appium module Mac2 module Device module Screen + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end diff --git a/sig/lib/appium_lib_core/windows/device/screen.rbs b/sig/lib/appium_lib_core/windows/device/screen.rbs index 67a2d02c..a7069350 100644 --- a/sig/lib/appium_lib_core/windows/device/screen.rbs +++ b/sig/lib/appium_lib_core/windows/device/screen.rbs @@ -3,6 +3,8 @@ module Appium module Windows module Device module Screen + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + def self.add_methods: () -> untyped end end From 1fc1122c9388ab7bcd8c376ad9b5d2a99478be79 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 3 Nov 2024 18:48:41 +0100 Subject: [PATCH 11/17] Reduce issues to 96 --- sig/interfaces/bridge.rbs | 2 ++ sig/lib/appium_lib_core/common/base/screenshot.rbs | 2 ++ .../appium_lib_core/common/device/image_comparison.rbs | 8 ++++---- sig/lib/appium_lib_core/common/device/ime_actions.rbs | 2 ++ sig/lib/appium_lib_core/ios/device/clipboard.rbs | 4 ++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sig/interfaces/bridge.rbs b/sig/interfaces/bridge.rbs index 65b90124..8caa4c7b 100644 --- a/sig/interfaces/bridge.rbs +++ b/sig/interfaces/bridge.rbs @@ -1,3 +1,5 @@ interface _Bridge + def bridge: -> untyped + def execute: (untyped command, ?Hash[untyped, untyped] opts, ?untyped? command_hash) -> untyped end diff --git a/sig/lib/appium_lib_core/common/base/screenshot.rbs b/sig/lib/appium_lib_core/common/base/screenshot.rbs index 139139a4..d5d43aa7 100644 --- a/sig/lib/appium_lib_core/common/base/screenshot.rbs +++ b/sig/lib/appium_lib_core/common/base/screenshot.rbs @@ -2,6 +2,8 @@ module Appium module Core class Base module TakesScreenshot + include _Bridge + def save_screenshot: (untyped png_path) -> untyped def screenshot_as: (untyped format) -> untyped diff --git a/sig/lib/appium_lib_core/common/device/image_comparison.rbs b/sig/lib/appium_lib_core/common/device/image_comparison.rbs index d0658e18..9255eac4 100644 --- a/sig/lib/appium_lib_core/common/device/image_comparison.rbs +++ b/sig/lib/appium_lib_core/common/device/image_comparison.rbs @@ -3,13 +3,13 @@ module Appium class Base module Device module ImageComparison - MODE: ::Array[:matchFeatures | :getSimilarity | :matchTemplate] + MODE: Array[Symbol] - MATCH_FEATURES: { detector_name: ::Array["AKAZE" | "AGAST" | "BRISK" | "FAST" | "GFTT" | "KAZE" | "MSER" | "SIFT" | "ORB"], match_func: ::Array["FlannBased" | "BruteForce" | "BruteForceL1" | "BruteForceHamming" | "BruteForceHammingLut" | "BruteForceSL2"], goodMatchesFactor: nil, visualize: ::Array[true | false] } + MATCH_FEATURES: { detector_name: untyped } - MATCH_TEMPLATE: { visualize: ::Array[true | false] } + MATCH_TEMPLATE: { visualize: Array[bool] } - GET_SIMILARITY: { visualize: ::Array[true | false] } + GET_SIMILARITY: { visualize: Array[bool] } def match_images_features: (first_image: untyped, second_image: untyped, ?detector_name: ::String, ?match_func: ::String, ?good_matches_factor: untyped?, ?visualize: bool) -> untyped diff --git a/sig/lib/appium_lib_core/common/device/ime_actions.rbs b/sig/lib/appium_lib_core/common/device/ime_actions.rbs index 14bdb050..0b8e6146 100644 --- a/sig/lib/appium_lib_core/common/device/ime_actions.rbs +++ b/sig/lib/appium_lib_core/common/device/ime_actions.rbs @@ -3,6 +3,8 @@ module Appium class Base module Device module ImeActions + include _Bridge + def ime_activate: (untyped ime_name) -> untyped def ime_available_engines: () -> untyped diff --git a/sig/lib/appium_lib_core/ios/device/clipboard.rbs b/sig/lib/appium_lib_core/ios/device/clipboard.rbs index 83f197aa..6e78e587 100644 --- a/sig/lib/appium_lib_core/ios/device/clipboard.rbs +++ b/sig/lib/appium_lib_core/ios/device/clipboard.rbs @@ -3,9 +3,13 @@ module Appium module Ios module Device module Clipboard + include _Bridge + def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped def self.add_methods: () -> untyped + + def self.touch_id: -> untyped end end end From 5eb47d8d4f2e47e94229b5956b435f6592970753 Mon Sep 17 00:00:00 2001 From: aguspe Date: Sun, 3 Nov 2024 18:50:40 +0100 Subject: [PATCH 12/17] Reduce issues to 95 --- sig/lib/appium_lib_core/common/base/remote_status.rbs | 2 ++ sig/lib/appium_lib_core/ios/xcuitest/device.rbs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sig/lib/appium_lib_core/common/base/remote_status.rbs b/sig/lib/appium_lib_core/common/base/remote_status.rbs index d4abd610..bafd9010 100644 --- a/sig/lib/appium_lib_core/common/base/remote_status.rbs +++ b/sig/lib/appium_lib_core/common/base/remote_status.rbs @@ -2,6 +2,8 @@ module Appium module Core class Base module HasRemoteStatus + include _Bridge + def remote_status: () -> untyped end end diff --git a/sig/lib/appium_lib_core/ios/xcuitest/device.rbs b/sig/lib/appium_lib_core/ios/xcuitest/device.rbs index d851b62e..268e8d1d 100644 --- a/sig/lib/appium_lib_core/ios/xcuitest/device.rbs +++ b/sig/lib/appium_lib_core/ios/xcuitest/device.rbs @@ -4,7 +4,7 @@ module Appium module Xcuitest module Device extend Forwardable - def execute: (Symbol command, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped + include _Bridge def self.extended: (untyped _mod) -> untyped end From a65cfc27d1d40a3c9df9d57eeb5d1bb1b54e5458 Mon Sep 17 00:00:00 2001 From: Augustin Pequeno Date: Thu, 2 Jan 2025 00:21:04 +0100 Subject: [PATCH 13/17] Reduce errors from 105 to 99 --- sig/gems/selenium/error.rbs | 1 + sig/lib/appium_lib_core/driver.rbs | 10 +++++----- .../appium_lib_core/ios/{device => }/clipboard.rbs | 0 sig/lib/appium_lib_core/ios/device.rbs | 12 ++++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) rename sig/lib/appium_lib_core/ios/{device => }/clipboard.rbs (100%) create mode 100644 sig/lib/appium_lib_core/ios/device.rbs diff --git a/sig/gems/selenium/error.rbs b/sig/gems/selenium/error.rbs index 30fa2189..5fd5aa9a 100644 --- a/sig/gems/selenium/error.rbs +++ b/sig/gems/selenium/error.rbs @@ -2,6 +2,7 @@ module Selenium module WebDriver module Error module UnknownError + def message: -> String end end end diff --git a/sig/lib/appium_lib_core/driver.rbs b/sig/lib/appium_lib_core/driver.rbs index 7222fb96..11b4142e 100644 --- a/sig/lib/appium_lib_core/driver.rbs +++ b/sig/lib/appium_lib_core/driver.rbs @@ -109,7 +109,7 @@ module Appium attr_reader enable_idempotency_header: bool - attr_reader device: Symbol + attr_reader device: Symbol | String attr_reader automation_name: Symbol @@ -166,7 +166,7 @@ module Appium private - def convert_to_symbol: (untyped? value) -> Symbol + def convert_to_symbol: (untyped? value) -> Symbol? def extend_for: (device: Symbol | String, automation_name: Symbol) -> self @@ -185,10 +185,10 @@ module Appium def set_app_path: () -> String? def set_appium_lib_specific_values: ( - Hash[Symbol, Symbol | String | Hash[Symbol, String | Numeric] | Numeric]? appium_lib_opts - ) -> self + Hash[Symbol, String] appium_lib_opts + ) -> bool - def set_appium_device: () -> String + def set_appium_device: () -> Symbol def set_automation_name: () -> Symbol? diff --git a/sig/lib/appium_lib_core/ios/device/clipboard.rbs b/sig/lib/appium_lib_core/ios/clipboard.rbs similarity index 100% rename from sig/lib/appium_lib_core/ios/device/clipboard.rbs rename to sig/lib/appium_lib_core/ios/clipboard.rbs diff --git a/sig/lib/appium_lib_core/ios/device.rbs b/sig/lib/appium_lib_core/ios/device.rbs new file mode 100644 index 00000000..b3751845 --- /dev/null +++ b/sig/lib/appium_lib_core/ios/device.rbs @@ -0,0 +1,12 @@ +module Appium + module Core + module Ios + module Device + include _Bridge + extend Forwardable + + def self.toggle_touch_id_enrollment: -> untyped + end + end + end +end From 2055333344acf6ba6bc9555620a0347f370afde4 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 8 Apr 2025 00:24:15 +0900 Subject: [PATCH 14/17] Uncomment and update unit test workflow --- .github/workflows/unittest.yml | 134 ++++++++++++++++----------------- .ruby-version | 1 - 2 files changed, 67 insertions(+), 68 deletions(-) delete mode 100644 .ruby-version diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 0483cfe5..25f151b5 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -1,67 +1,67 @@ -#name: lint and unit tests -# -#on: -# push: -# branches: [ master ] -# pull_request: -# branches: [ master ] -# -#jobs: -# test: -# strategy: -# fail-fast: false -# matrix: -# ruby: [3.0, 3.1, 3.2] -# -# runs-on: ubuntu-latest -# -# env: -# UNIT_TEST: true -# -# steps: -# - uses: actions/checkout@v2 -# - name: Set up Ruby -# uses: ruby/setup-ruby@v1 -# with: -# ruby-version: ${{ matrix.ruby }} -# - name: Install dependencies -# run: | -# bundle install -# - name: Run tests -# run: | -# bundle exec rake rubocop -# bundle exec rake test:unit -# APPIUM_DRIVER=espresso bundle exec rake test:unit:android -# APPIUM_DRIVER=appium bundle exec rake test:unit -# -# test-win: -# strategy: -# fail-fast: false -# matrix: -# ruby: [3.0, 3.1, 3.2] -# -# runs-on: windows-latest -# -# env: -# UNIT_TEST: true -# -# steps: -# - uses: actions/checkout@v2 -# - name: Set up Ruby -# uses: ruby/setup-ruby@v1 -# with: -# ruby-version: ${{ matrix.ruby }} -# - name: Install dependencies -# run: | -# gem install ffi -# bundle install -# gem uninstall --force eventmachine && gem install eventmachine --platform ruby -# - name: Run tests -# run: | -# bundle exec rake test:unit -# -# setx APPIUM_DRIVER espresso -# bundle exec rake test:unit:android -# -# setx APPIUM_DRIVER appium -# bundle exec rake test:unit +name: lint and unit tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + strategy: + fail-fast: false + matrix: + ruby: [3.0, 3.1, 3.2] + + runs-on: ubuntu-latest + + env: + UNIT_TEST: true + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: | + bundle install + - name: Run tests + run: | + bundle exec rake rubocop + bundle exec rake test:unit + APPIUM_DRIVER=espresso bundle exec rake test:unit:android + APPIUM_DRIVER=appium bundle exec rake test:unit + + test-win: + strategy: + fail-fast: false + matrix: + ruby: [3.0, 3.1, 3.2] + + runs-on: windows-latest + + env: + UNIT_TEST: true + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: | + gem install ffi + bundle install + gem uninstall --force eventmachine && gem install eventmachine --platform ruby + - name: Run tests + run: | + bundle exec rake test:unit + + setx APPIUM_DRIVER espresso + bundle exec rake test:unit:android + + setx APPIUM_DRIVER appium + bundle exec rake test:unit diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 15a27998..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.3.0 From 346396809744c0eae7e9b4e8e6a78a97ea77b38b Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 8 Apr 2025 00:26:25 +0900 Subject: [PATCH 15/17] Reformat unittest.yml indentation --- .github/workflows/unittest.yml | 102 ++++++++++++++++----------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 25f151b5..4e44c536 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -1,67 +1,67 @@ name: lint and unit tests on: - push: - branches: [ master ] - pull_request: - branches: [ master ] + push: + branches: [ master ] + pull_request: + branches: [ master ] jobs: test: - strategy: - fail-fast: false - matrix: - ruby: [3.0, 3.1, 3.2] + strategy: + fail-fast: false + matrix: + ruby: [3.0, 3.1, 3.2] - runs-on: ubuntu-latest + runs-on: ubuntu-latest - env: - UNIT_TEST: true + env: + UNIT_TEST: true - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - name: Install dependencies - run: | - bundle install - - name: Run tests - run: | - bundle exec rake rubocop - bundle exec rake test:unit - APPIUM_DRIVER=espresso bundle exec rake test:unit:android - APPIUM_DRIVER=appium bundle exec rake test:unit + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: | + bundle install + - name: Run tests + run: | + bundle exec rake rubocop + bundle exec rake test:unit + APPIUM_DRIVER=espresso bundle exec rake test:unit:android + APPIUM_DRIVER=appium bundle exec rake test:unit test-win: - strategy: - fail-fast: false - matrix: - ruby: [3.0, 3.1, 3.2] + strategy: + fail-fast: false + matrix: + ruby: [3.0, 3.1, 3.2] - runs-on: windows-latest + runs-on: windows-latest - env: - UNIT_TEST: true + env: + UNIT_TEST: true - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - name: Install dependencies - run: | - gem install ffi - bundle install - gem uninstall --force eventmachine && gem install eventmachine --platform ruby - - name: Run tests - run: | - bundle exec rake test:unit + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: | + gem install ffi + bundle install + gem uninstall --force eventmachine && gem install eventmachine --platform ruby + - name: Run tests + run: | + bundle exec rake test:unit - setx APPIUM_DRIVER espresso - bundle exec rake test:unit:android + setx APPIUM_DRIVER espresso + bundle exec rake test:unit:android - setx APPIUM_DRIVER appium - bundle exec rake test:unit + setx APPIUM_DRIVER appium + bundle exec rake test:unit From 98ca9892c59c804a918de9747b4a42607c020171 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 8 Apr 2025 00:27:13 +0900 Subject: [PATCH 16/17] Update Ruby versions in CI workflow --- .github/workflows/unittest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 4e44c536..61bd8c66 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -7,11 +7,11 @@ on: branches: [ master ] jobs: - test: + test: strategy: fail-fast: false matrix: - ruby: [3.0, 3.1, 3.2] + ruby: [3.1, 3.2, 3.3] runs-on: ubuntu-latest @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [3.0, 3.1, 3.2] + ruby: [3.1, 3.2, 3.3] runs-on: windows-latest From 9f19fe28b1348e3f3422ea9ff4943b8f6e8c27cc Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Tue, 8 Apr 2025 00:27:43 +0900 Subject: [PATCH 17/17] Fix indentation for test-win job in workflow --- .github/workflows/unittest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 61bd8c66..495bd13f 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -34,7 +34,7 @@ jobs: APPIUM_DRIVER=espresso bundle exec rake test:unit:android APPIUM_DRIVER=appium bundle exec rake test:unit - test-win: + test-win: strategy: fail-fast: false matrix: