@@ -27,6 +27,7 @@ module Device
27
27
28
28
# rubocop:disable Layout/LineLength
29
29
30
+ # @deprecated Use 'mobile: openNotifications' extension instead.
30
31
# @!method open_notifications
31
32
# Open Android notifications
32
33
#
@@ -35,6 +36,7 @@ module Device
35
36
# @driver.open_notifications
36
37
#
37
38
39
+ # @deprecated Use 'mobile: getCurrentActivity' extension instead.
38
40
# @!method current_activity
39
41
# Get current activity name
40
42
# @return [String] An activity name
@@ -44,6 +46,7 @@ module Device
44
46
# @driver.current_activity # '.ApiDemos'
45
47
#
46
48
49
+ # @deprecated Use 'mobile: getCurrentPackage' extension instead.
47
50
# @!method current_package
48
51
# Get current package name
49
52
# @return [String] A package name
@@ -53,6 +56,7 @@ module Device
53
56
# @driver.current_package # 'com.example.android.apis'
54
57
#
55
58
59
+ # @deprecated Use 'mobile: getSystemBars' extension instead.
56
60
# @!method get_system_bars
57
61
# Get system bar's information
58
62
# @return [String]
@@ -63,6 +67,7 @@ module Device
63
67
# @driver.system_bars
64
68
#
65
69
70
+ # @deprecated Use 'mobile: getDisplayDensity' extension instead.
66
71
# @!method get_display_density
67
72
# Get connected device's density.
68
73
# @return [Integer] The size of density
@@ -72,6 +77,7 @@ module Device
72
77
# @driver.get_display_density # 320
73
78
#
74
79
80
+ # @deprecated Use 'mobile: getConnectivity' extension instead.
75
81
# @!method get_network_connection
76
82
# Get the device network connection current status
77
83
# See set_network_connection method for return value
@@ -86,6 +92,7 @@ module Device
86
92
# @driver.get_network_connection #=> 6
87
93
#
88
94
95
+ # @deprecated Use 'mobile: getConnectivity' extension instead.
89
96
# @!method toggle_wifi
90
97
# Switch the state of the wifi service only for Android
91
98
#
@@ -96,6 +103,7 @@ module Device
96
103
# @driver.toggle_wifi
97
104
#
98
105
106
+ # @deprecated Use 'mobile: getConnectivity' extension instead.
99
107
# @!method toggle_data
100
108
# Switch the state of data service only for Android, and the device should be rooted
101
109
#
@@ -106,6 +114,7 @@ module Device
106
114
# @driver.toggle_data
107
115
#
108
116
117
+ # @deprecated Use 'mobile: getConnectivity' extension instead.
109
118
# @!method location
110
119
# Get the location of the device.
111
120
#
@@ -143,6 +152,7 @@ module Device
143
152
# driver.set_location 10, 10, 0
144
153
#
145
154
155
+ # @deprecated Use 'mobile: toggleGps' extension instead.
146
156
# @!method toggle_location_services
147
157
# Switch the state of the location service
148
158
#
@@ -153,6 +163,7 @@ module Device
153
163
# @driver.toggle_location_services
154
164
#
155
165
166
+ # @deprecated Use 'mobile: getConnectivity' extension instead.
156
167
# @!method toggle_airplane_mode
157
168
# Toggle flight mode on or off
158
169
#
@@ -161,6 +172,7 @@ module Device
161
172
# @driver.toggle_airplane_mode
162
173
#
163
174
175
+ # @deprecated Use 'mobile: hideKeyboard' extension instead.
164
176
# @!method hide_keyboard(close_key = nil, strategy = nil)
165
177
# Hide the onscreen keyboard
166
178
# @param [String] close_key The name of the key which closes the keyboard.
@@ -176,12 +188,14 @@ module Device
176
188
# @driver.hide_keyboard(nil, :tapOutside) # Close a keyboard with tapping out side of keyboard
177
189
#
178
190
191
+ # @deprecated The method no longer exists. This method will be removed.
179
192
# @!method end_coverage(path, intent)
180
193
# Android only; Ends the test coverage and writes the results to the given path on device.
181
194
# @param [String] path Path on the device to write too.
182
195
# @param [String] intent Intent to broadcast when ending coverage.
183
196
#
184
197
198
+ # @deprecated Use 'mobile: startActivity' extension instead.
185
199
# @!method start_activity(opts)
186
200
# Android only. Start a new activity within the current app or launch a new app and start the target activity.
187
201
#
@@ -206,6 +220,7 @@ module Device
206
220
# app_activity: '.accessibility.AccessibilityNodeProviderActivity'
207
221
#
208
222
223
+ # @deprecated Use 'mobile: setConnectivity' extension instead.
209
224
# @!method set_network_connection(mode)
210
225
# Set the device network connection mode
211
226
# Same as +#network_connection_type+ in selenium-webdriver.
@@ -228,6 +243,7 @@ module Device
228
243
# @driver.network_connection_type = :airplane_mode # As selenium-webdriver
229
244
#
230
245
246
+ # @deprecated Use 'mobile: getPerformanceDataTypes' extension instead.
231
247
# @!method get_performance_data_types
232
248
# Get the information type of the system state which is supported to read such as
233
249
# cpu, memory, network, battery via adb commands.
@@ -238,6 +254,7 @@ module Device
238
254
# @driver.get_performance_data_types #=> ["cpuinfo", "batteryinfo", "networkinfo", "memoryinfo"]
239
255
#
240
256
257
+ # @deprecated Use 'mobile: getPerformanceData' extension instead.
241
258
# @!method get_performance_data(package_name:, data_type:, data_read_timeout: 1000)
242
259
# Get the resource usage information of the application.
243
260
# https://github.com/appium/appium-base-driver/blob/be29aec2318316d12b5c3295e924a5ba8f09b0fb/lib/mjsonwp/routes.js#L303
@@ -317,6 +334,7 @@ module Device
317
334
# @driver.set_clipboard(content: 'happy testing') #=> {"protocol"=>"W3C"}
318
335
#
319
336
337
+ # @deprecated Use 'mobile: fingerprint' extension instead.
320
338
# @!method finger_print(finger_id)
321
339
# Authenticate users by using their finger print scans on supported emulators.
322
340
#
@@ -356,42 +374,56 @@ def extended(_mod)
356
374
357
375
::Appium ::Core ::Device . add_endpoint_method ( :open_notifications ) do
358
376
def open_notifications
377
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: openNotifications' extension instead"
378
+
359
379
execute :open_notifications
360
380
end
361
381
end
362
382
363
383
::Appium ::Core ::Device . add_endpoint_method ( :current_activity ) do
364
384
def current_activity
385
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: getCurrentActivity' extension instead"
386
+
365
387
execute :current_activity
366
388
end
367
389
end
368
390
369
391
::Appium ::Core ::Device . add_endpoint_method ( :current_package ) do
370
392
def current_package
393
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: getCurrentPackage' extension instead"
394
+
371
395
execute :current_package
372
396
end
373
397
end
374
398
375
399
::Appium ::Core ::Device . add_endpoint_method ( :get_system_bars ) do
376
400
def get_system_bars
401
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: getSystemBars' extension instead"
402
+
377
403
execute :get_system_bars
378
404
end
379
405
end
380
406
# as alias to get_system_bars
381
407
::Appium ::Core ::Device . add_endpoint_method ( :system_bars ) do
382
408
def system_bars
409
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: getSystemBars' extension instead"
410
+
383
411
execute :get_system_bars
384
412
end
385
413
end
386
414
387
415
::Appium ::Core ::Device . add_endpoint_method ( :toggle_location_services ) do
388
416
def toggle_location_services
417
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: toggleGps' extension instead"
418
+
389
419
execute :toggle_location_services
390
420
end
391
421
end
392
422
393
423
::Appium ::Core ::Device . add_endpoint_method ( :start_activity ) do
394
424
def start_activity ( opts )
425
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: startActivity' extension instead"
426
+
395
427
raise 'opts must be a hash' unless opts . is_a? Hash
396
428
397
429
option = { }
@@ -429,6 +461,8 @@ def start_activity(opts)
429
461
# Android, Override included method in bridge
430
462
::Appium ::Core ::Device . add_endpoint_method ( :hide_keyboard ) do
431
463
def hide_keyboard ( close_key = nil , strategy = nil )
464
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: hideKeyboard' extension instead"
465
+
432
466
option = { }
433
467
434
468
option [ :key ] = close_key if close_key
@@ -441,13 +475,16 @@ def hide_keyboard(close_key = nil, strategy = nil)
441
475
# Android, Override included method in bridge
442
476
::Appium ::Core ::Device . add_endpoint_method ( :background_app ) do
443
477
def background_app ( duration = 0 )
478
+ ::Appium ::Logger . warn "[DEPRECATION] Please use 'mobile: backgroundApp' extension instead"
479
+
444
480
execute :background_app , { } , seconds : duration
445
481
end
446
482
end
447
483
448
484
# TODO: TEST ME
449
485
::Appium ::Core ::Device . add_endpoint_method ( :end_coverage ) do
450
486
def end_coverage ( path , intent )
487
+ ::Appium ::Logger . warn '[DEPRECATION] The method no longer exists. This method will be removed.'
451
488
execute :end_coverage , { } , path : path , intent : intent
452
489
end
453
490
end
0 commit comments