Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove deprecated methods #526

Merged
merged 4 commits into from
Feb 26, 2024
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
1 change: 0 additions & 1 deletion lib/appium_lib_core/common/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
require_relative 'device/battery_status'
require_relative 'device/clipboard_content_type'
require_relative 'device/device'
require_relative 'device/touch_actions'
require_relative 'device/execute_driver'
require_relative 'device/orientation'

Expand Down
1 change: 0 additions & 1 deletion lib/appium_lib_core/common/base/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Bridge < ::Selenium::WebDriver::Remote::Bridge
include Device::AppState
include Device::ScreenRecord::Command
include Device::Device
include Device::TouchActions
include Device::ExecuteDriver
include Device::Orientation

Expand Down
46 changes: 0 additions & 46 deletions lib/appium_lib_core/common/base/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -603,43 +603,6 @@ def long_press_keycode(key, metastate: [], flags: [])
@bridge.long_press_keycode(key, metastate: metastate, flags: flags)
end

# @deprecated Will be removed, or use 'windows: launchApp' extension instead for Windows.
# Start the simulator and application configured with desired capabilities
#
# @example
#
# @driver.launch_app
#
def launch_app
@bridge.launch_app
end

# @deprecated Will be removed, or use 'windows: closeApp' extension instead for Windows.
# Close an app on device
#
# @example
#
# @driver.close_app
#
def close_app
@bridge.close_app
end

# @deprecated
# Reset the device, relaunching the application.
#
# @example
#
# @driver.reset
#
def reset
::Appium::Logger.warn(
'[DEPRECATION] reset is deprecated. Please use terminate_app and activate_app, ' \
'or quit and create a new session instead.'
)
@bridge.reset
end

# @deprecated Use 'mobile: getAppStrings' extension instead.
# Return the hash of all localization strings.
# @return [Hash]
Expand Down Expand Up @@ -852,15 +815,6 @@ def device_time(format = nil)
@bridge.device_time(format)
end

# touch actions
def touch_actions(actions)
@bridge.touch_actions(actions)
end

def multi_touch(actions)
@bridge.multi_touch(actions)
end

#
# Send multiple W3C action chains to server. Use [email protected]+ for single action chain.
#
Expand Down
20 changes: 1 addition & 19 deletions lib/appium_lib_core/common/base/search_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ module SearchContext
view_matcher: '-android viewmatcher', # Available in Espresso
# iOS
predicate: '-ios predicate string',
class_chain: '-ios class chain',
# Windows with windows prefix
# @deprecated
windows_uiautomation: '-windows uiautomation',
# Tizen with Tizen prefix
tizen_uiautomation: '-tizen uiautomation'
class_chain: '-ios class chain'
)

# rubocop:disable Layout/LineLength
Expand Down Expand Up @@ -121,13 +116,6 @@ module SearchContext
# e = find_element :class_chain, "**/XCUIElementTypeStaticText[$name == 'Buttons'$]"
# e.tag_name #=> "XCUIElementTypeStaticText"
#
# # For Windows
# # @deprecated
# @driver.find_elements :windows_uiautomation, '....'
#
# # For Tizen
# @driver.find_elements :tizen_uiautomation, '....'
#
# rubocop:enable Layout/LineLength
def find_element(*args)
how, what = extract_args(args)
Expand Down Expand Up @@ -159,12 +147,6 @@ def find_elements(*args)
private

def _set_by_from_finders(how)
if how == :windows_uiautomation
::Appium::Logger.warn(
'[DEPRECATION] :windows_uiautomation is deprecated. Please use other locators.'
)
end

by = FINDERS[how.to_sym]
unless by
raise ::Appium::Core::Error::ArgumentError,
Expand Down
6 changes: 0 additions & 6 deletions lib/appium_lib_core/common/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,10 @@ module Commands
set_context: [:post, 'session/:session_id/context'],
current_context: [:get, 'session/:session_id/context'],

touch_actions: [:post, 'session/:session_id/touch/perform'],
multi_touch: [:post, 'session/:session_id/touch/multi/perform'],

# TODO: remove
set_immediate_value: [:post, 'session/:session_id/appium/element/:id/value'],
replace_value: [:post, 'session/:session_id/appium/element/:id/replace_value'],

launch_app: [:post, 'session/:session_id/appium/app/launch'],
close_app: [:post, 'session/:session_id/appium/app/close'],
reset: [:post, 'session/:session_id/appium/app/reset'],
background_app: [:post, 'session/:session_id/appium/app/background'],
app_strings: [:post, 'session/:session_id/appium/app/strings'],

Expand Down
18 changes: 0 additions & 18 deletions lib/appium_lib_core/common/device/app_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@ module Core
class Base
module Device
module AppManagement
def launch_app
::Appium::Logger.warn(
'[DEPRECATION] launch_app is deprecated. Please use activate_app instead.'
)
execute :launch_app
end

def close_app
::Appium::Logger.warn(
'[DEPRECATION] close_app is deprecated. Please use terminate_app instead.'
)
execute :close_app
end

def reset
execute :reset
end

def app_strings(language = nil)
opts = language ? { language: language } : {}
execute :app_strings, {}, opts
Expand Down
37 changes: 0 additions & 37 deletions lib/appium_lib_core/common/device/touch_actions.rb

This file was deleted.

75 changes: 0 additions & 75 deletions lib/appium_lib_core/common/touch_action/multi_touch.rb

This file was deleted.

Loading
Loading