Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/appium_lib_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.symbolize_keys(hash, nested: false, enable_deprecation_msg: true)
# the methods which expect the symbol first.
raise ::Appium::Core::Error::ArgumentError, 'symbolize_keys requires a hash' unless hash.is_a? Hash

hash.each_with_object({}) do |pair, acc|
hash.each_with_object({}) do |pair, acc| # steep:ignore
key = begin
if enable_deprecation_msg && !(pair[0].is_a? Symbol)
::Appium::Logger.warn("[Deprecation] The key '#{pair[0]}' must be a symbol while currently it " \
Expand Down
6 changes: 3 additions & 3 deletions lib/appium_lib_core/common/base/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def create_session(capabilities)
@available_commands = ::Appium::Core::Commands::COMMANDS.dup

always_match = add_appium_prefix(capabilities)
response = execute(:new_session, {}, { capabilities: { alwaysMatch: always_match, firstMatch: [{}] } })
response = execute(:new_session, {}, { capabilities: { alwaysMatch: always_match, firstMatch: [{}] } }) # steep:ignore

@session_id = response['sessionId']
raise ::Selenium::WebDriver::Error::WebDriverError, 'no sessionId in returned payload' unless @session_id
Expand Down Expand Up @@ -273,7 +273,7 @@ def set_location(lat, lon, alt = 0.0, speed: nil, satellites: nil)
# No implementation for W3C webdriver module
def available_log_types
types = execute :get_available_log_types
Array(types).map(&:to_sym)
Array(types).map(&:to_sym) # steep:ignore
end

# For Appium
Expand All @@ -297,7 +297,7 @@ def log_event(vendor, event)

# For Appium
def log_events(type = nil)
args = {}
args = {} # steep:ignore
args['type'] = type unless type.nil?

execute :get_log_events, {}, args
Expand Down
2 changes: 1 addition & 1 deletion lib/appium_lib_core/common/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module Commands
chrome_send_command: [:post, 'session/:session_id/goog/cdp/execute']
}.freeze

COMMANDS = {}.merge(COMMAND).merge(COMMAND_ANDROID).freeze
COMMANDS = {}.merge(COMMAND).merge(COMMAND_ANDROID).freeze # steep:ignore
end # module Commands
end # module Core
end # module Appium
4 changes: 2 additions & 2 deletions lib/appium_lib_core/common/device/app_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Base
module Device
module AppManagement
def app_strings(language = nil)
opts = language ? { language: language } : {}
opts = language ? { language: language } : {} # steep:ignore
execute_script 'mobile:getAppStrings', opts
end

Expand All @@ -27,7 +27,7 @@ def background_app(duration = 0)
raise NotImplementedError
end

def install_app(path, options = {})
def install_app(path, options = {}) # steep:ignore
args = { appPath: path }
args[:options] = options unless options&.empty?

Expand Down
2 changes: 1 addition & 1 deletion lib/appium_lib_core/common/device/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def shake
end

def device_time(format = nil)
arg = {}
arg = {} # steep:ignore
arg[:format] = format unless format.nil?

execute_script 'mobile:getDeviceTime', arg
Expand Down
2 changes: 1 addition & 1 deletion lib/appium_lib_core/common/device/device_lock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Base
module Device
module DeviceLock
def lock(duration = nil)
opts = duration ? { seconds: duration } : {}
opts = duration ? { seconds: duration } : {} # steep:ignore
execute_script 'mobile:lock', opts
end

Expand Down
8 changes: 4 additions & 4 deletions lib/appium_lib_core/common/device/image_comparison.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def match_images_features(first_image:,
raise ::Appium::Core::Error::ArgumentError, "match_func should be #{MATCH_FEATURES[:match_func]}" unless MATCH_FEATURES[:match_func].member?(match_func.to_s)
raise ::Appium::Core::Error::ArgumentError, "visualize should be #{MATCH_FEATURES[:visualize]}" unless MATCH_FEATURES[:visualize].member?(visualize)

options = {}
options = {} # steep:ignore
options[:detectorName] = detector_name.to_s.upcase
options[:matchFunc] = match_func.to_s
options[:goodMatchesFactor] = good_matches_factor.to_i unless good_matches_factor.nil?
Expand Down Expand Up @@ -108,7 +108,7 @@ def find_image_occurrence(full_image:, partial_image:, visualize: false, thresho
"visualize should be #{MATCH_TEMPLATE[:visualize]}"
end

options = {}
options = {} # steep:ignore
options[:visualize] = visualize
options[:threshold] = threshold unless threshold.nil?
options[:multiple] = multiple unless multiple.nil?
Expand Down Expand Up @@ -138,7 +138,7 @@ def get_images_similarity(first_image:, second_image:, visualize: false)
"visualize should be #{GET_SIMILARITY[:visualize]}"
end

options = {}
options = {} # steep:ignore
options[:visualize] = visualize

compare_images(mode: :getSimilarity, first_image: first_image, second_image: second_image, options: options)
Expand All @@ -160,7 +160,7 @@ def get_images_similarity(first_image:, second_image:, visualize: false)
def compare_images(mode: :matchFeatures, first_image:, second_image:, options: nil)
raise ::Appium::Core::Error::ArgumentError, "content_type should be #{MODE}" unless MODE.member?(mode)

params = {}
params = {} # steep:ignore
params[:mode] = mode
params[:firstImage] = Base64.strict_encode64 first_image
params[:secondImage] = Base64.strict_encode64 second_image
Expand Down
2 changes: 1 addition & 1 deletion lib/appium_lib_core/common/device/keyboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Base
module Device
module Keyboard
def hide_keyboard(close_key = nil)
option = {}
option = {} # steep:ignore

option[:key] = close_key || 'Done' # default to Done key.

Expand Down
4 changes: 2 additions & 2 deletions lib/appium_lib_core/common/device/screen_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def initialize(remote_path: nil, user: nil, pass: nil, method: 'PUT',
'method should be POST or PUT'
end

option = {}
option = {} # steep:ignore
option[:remotePath] = remote_path
option[:user] = user unless user.nil?
option[:pass] = pass unless pass.nil?
Expand Down Expand Up @@ -64,7 +64,7 @@ def stop_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT',
file_field_name: file_field_name, form_fields: form_fields, headers: headers
).upload_option

params = option.empty? ? {} : { options: option }
params = option.empty? ? {} : { options: option } # steep:ignore

execute(:stop_recording_screen, {}, params)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/appium_lib_core/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def get_caps(opts)
o = opts || {}

raw_caps = o[:caps] || o[:capabilities]
caps_hash = raw_caps.is_a?(Hash) ? raw_caps : {}
caps_hash = raw_caps.is_a?(Hash) ? raw_caps : {} # steep:ignore

Core::Base::Capabilities.new(caps_hash)
end
Expand Down Expand Up @@ -631,7 +631,7 @@ def set_app_path
app = get_app # for steep reason
return unless app && app.empty?

uri_regex = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
uri_regex = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER # steep:ignore
return if app =~ uri_regex.make_regexp

# steep:ignore
Expand Down
3 changes: 3 additions & 0 deletions sig/gems/selenium/error.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ module Selenium
module UnknownError
def message: -> String
end

class WebDriverError < StandardError
end
end
end
end
2 changes: 2 additions & 0 deletions sig/lib/appium_lib_core/common/base/capabilities.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Appium
module Core
class Base
class Capabilities < Selenium::WebDriver::Remote::Capabilities
KNOWN: Array[Symbol]

def convert_key: (untyped key) -> untyped

# Inherit json_create from parent, but you can redeclare for clarity:
Expand Down
2 changes: 2 additions & 0 deletions sig/lib/appium_lib_core/common/base/driver.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ module Appium
def execute_driver: (?script: ::String, ?type: ::String, ?timeout_ms: untyped?) -> untyped

def convert_to_element: (untyped response_id) -> untyped

def bidi: () -> untyped
end
end
end
Expand Down
Loading