Skip to content

Commit af2a58b

Browse files
authored
feat: Remove deprecated methods (#526)
BREAKING CHANGE: remove obsolute launch_app, close_app, reset, touch and multi actions
1 parent b3abc6c commit af2a58b

File tree

22 files changed

+16
-616
lines changed

22 files changed

+16
-616
lines changed

lib/appium_lib_core/common/base.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
require_relative 'device/battery_status'
2828
require_relative 'device/clipboard_content_type'
2929
require_relative 'device/device'
30-
require_relative 'device/touch_actions'
3130
require_relative 'device/execute_driver'
3231
require_relative 'device/orientation'
3332

lib/appium_lib_core/common/base/bridge.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Bridge < ::Selenium::WebDriver::Remote::Bridge
2929
include Device::AppState
3030
include Device::ScreenRecord::Command
3131
include Device::Device
32-
include Device::TouchActions
3332
include Device::ExecuteDriver
3433
include Device::Orientation
3534

lib/appium_lib_core/common/base/driver.rb

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -603,43 +603,6 @@ def long_press_keycode(key, metastate: [], flags: [])
603603
@bridge.long_press_keycode(key, metastate: metastate, flags: flags)
604604
end
605605

606-
# @deprecated Will be removed, or use 'windows: launchApp' extension instead for Windows.
607-
# Start the simulator and application configured with desired capabilities
608-
#
609-
# @example
610-
#
611-
# @driver.launch_app
612-
#
613-
def launch_app
614-
@bridge.launch_app
615-
end
616-
617-
# @deprecated Will be removed, or use 'windows: closeApp' extension instead for Windows.
618-
# Close an app on device
619-
#
620-
# @example
621-
#
622-
# @driver.close_app
623-
#
624-
def close_app
625-
@bridge.close_app
626-
end
627-
628-
# @deprecated
629-
# Reset the device, relaunching the application.
630-
#
631-
# @example
632-
#
633-
# @driver.reset
634-
#
635-
def reset
636-
::Appium::Logger.warn(
637-
'[DEPRECATION] reset is deprecated. Please use terminate_app and activate_app, ' \
638-
'or quit and create a new session instead.'
639-
)
640-
@bridge.reset
641-
end
642-
643606
# @deprecated Use 'mobile: getAppStrings' extension instead.
644607
# Return the hash of all localization strings.
645608
# @return [Hash]
@@ -852,15 +815,6 @@ def device_time(format = nil)
852815
@bridge.device_time(format)
853816
end
854817

855-
# touch actions
856-
def touch_actions(actions)
857-
@bridge.touch_actions(actions)
858-
end
859-
860-
def multi_touch(actions)
861-
@bridge.multi_touch(actions)
862-
end
863-
864818
#
865819
# Send multiple W3C action chains to server. Use [email protected]+ for single action chain.
866820
#

lib/appium_lib_core/common/base/search_context.rb

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ module SearchContext
2929
view_matcher: '-android viewmatcher', # Available in Espresso
3030
# iOS
3131
predicate: '-ios predicate string',
32-
class_chain: '-ios class chain',
33-
# Windows with windows prefix
34-
# @deprecated
35-
windows_uiautomation: '-windows uiautomation',
36-
# Tizen with Tizen prefix
37-
tizen_uiautomation: '-tizen uiautomation'
32+
class_chain: '-ios class chain'
3833
)
3934

4035
# rubocop:disable Layout/LineLength
@@ -121,13 +116,6 @@ module SearchContext
121116
# e = find_element :class_chain, "**/XCUIElementTypeStaticText[$name == 'Buttons'$]"
122117
# e.tag_name #=> "XCUIElementTypeStaticText"
123118
#
124-
# # For Windows
125-
# # @deprecated
126-
# @driver.find_elements :windows_uiautomation, '....'
127-
#
128-
# # For Tizen
129-
# @driver.find_elements :tizen_uiautomation, '....'
130-
#
131119
# rubocop:enable Layout/LineLength
132120
def find_element(*args)
133121
how, what = extract_args(args)
@@ -159,12 +147,6 @@ def find_elements(*args)
159147
private
160148

161149
def _set_by_from_finders(how)
162-
if how == :windows_uiautomation
163-
::Appium::Logger.warn(
164-
'[DEPRECATION] :windows_uiautomation is deprecated. Please use other locators.'
165-
)
166-
end
167-
168150
by = FINDERS[how.to_sym]
169151
unless by
170152
raise ::Appium::Core::Error::ArgumentError,

lib/appium_lib_core/common/command.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,10 @@ module Commands
189189
set_context: [:post, 'session/:session_id/context'],
190190
current_context: [:get, 'session/:session_id/context'],
191191

192-
touch_actions: [:post, 'session/:session_id/touch/perform'],
193-
multi_touch: [:post, 'session/:session_id/touch/multi/perform'],
194-
195192
# TODO: remove
196193
set_immediate_value: [:post, 'session/:session_id/appium/element/:id/value'],
197194
replace_value: [:post, 'session/:session_id/appium/element/:id/replace_value'],
198195

199-
launch_app: [:post, 'session/:session_id/appium/app/launch'],
200-
close_app: [:post, 'session/:session_id/appium/app/close'],
201-
reset: [:post, 'session/:session_id/appium/app/reset'],
202196
background_app: [:post, 'session/:session_id/appium/app/background'],
203197
app_strings: [:post, 'session/:session_id/appium/app/strings'],
204198

lib/appium_lib_core/common/device/app_management.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,6 @@ module Core
1717
class Base
1818
module Device
1919
module AppManagement
20-
def launch_app
21-
::Appium::Logger.warn(
22-
'[DEPRECATION] launch_app is deprecated. Please use activate_app instead.'
23-
)
24-
execute :launch_app
25-
end
26-
27-
def close_app
28-
::Appium::Logger.warn(
29-
'[DEPRECATION] close_app is deprecated. Please use terminate_app instead.'
30-
)
31-
execute :close_app
32-
end
33-
34-
def reset
35-
execute :reset
36-
end
37-
3820
def app_strings(language = nil)
3921
opts = language ? { language: language } : {}
4022
execute :app_strings, {}, opts

lib/appium_lib_core/common/device/touch_actions.rb

Lines changed: 0 additions & 37 deletions
This file was deleted.

lib/appium_lib_core/common/touch_action/multi_touch.rb

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)