appium_lib_core 4.1.0 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +352 -270
- data/README.md +68 -16
- data/Rakefile +8 -20
- data/Steepfile +11 -0
- data/appium_lib_core.gemspec +13 -15
- data/bin/console +0 -4
- data/lib/appium_lib_core/android/device/auth_finger_print.rb +4 -1
- data/lib/appium_lib_core/android/device/clipboard.rb +4 -2
- data/lib/appium_lib_core/android/device/emulator.rb +11 -5
- data/lib/appium_lib_core/android/device/network.rb +10 -0
- data/lib/appium_lib_core/android/device/performance.rb +3 -0
- data/lib/appium_lib_core/android/device/screen.rb +5 -1
- data/lib/appium_lib_core/android/device.rb +83 -20
- data/lib/appium_lib_core/common/base/bridge.rb +238 -95
- data/lib/appium_lib_core/common/base/capabilities.rb +21 -8
- data/lib/appium_lib_core/common/{command/mjsonwp.rb → base/device_ime.rb} +33 -12
- data/lib/appium_lib_core/common/base/driver.rb +263 -334
- data/lib/appium_lib_core/common/base/driver_settings.rb +51 -0
- data/lib/appium_lib_core/common/base/has_location.rb +80 -0
- data/lib/appium_lib_core/common/base/has_network_connection.rb +56 -0
- data/lib/appium_lib_core/common/base/http_default.rb +22 -38
- data/lib/appium_lib_core/{ios/uiautomation/bridge.rb → common/base/remote_status.rb} +9 -8
- data/lib/appium_lib_core/common/base/rotable.rb +62 -0
- data/lib/appium_lib_core/common/base/screenshot.rb +10 -10
- data/lib/appium_lib_core/common/base/search_context.rb +98 -172
- data/lib/appium_lib_core/common/base.rb +1 -5
- data/lib/appium_lib_core/common/command.rb +244 -4
- data/lib/appium_lib_core/common/device/app_management.rb +2 -26
- data/lib/appium_lib_core/common/device/context.rb +1 -5
- data/lib/appium_lib_core/common/device/image_comparison.rb +27 -10
- data/lib/appium_lib_core/common/device/keyevent.rb +4 -4
- data/lib/appium_lib_core/common/device/{touch_actions.rb → orientation.rb} +6 -10
- data/lib/appium_lib_core/common/device/screen_record.rb +8 -2
- data/lib/appium_lib_core/common/error.rb +5 -5
- data/lib/appium_lib_core/common/log.rb +5 -4
- data/lib/appium_lib_core/common/wait.rb +38 -6
- data/lib/appium_lib_core/device.rb +3 -9
- data/lib/appium_lib_core/driver.rb +207 -164
- data/lib/appium_lib_core/{patch.rb → element.rb} +64 -26
- data/lib/appium_lib_core/ios/device/clipboard.rb +4 -2
- data/lib/appium_lib_core/ios/xcuitest/device.rb +2 -0
- data/lib/appium_lib_core/{common/base/command.rb → mac2/bridge.rb} +9 -8
- data/lib/appium_lib_core/mac2/device/screen.rb +48 -0
- data/lib/appium_lib_core/mac2/device.rb +92 -0
- data/lib/appium_lib_core/{ios.rb → mac2.rb} +2 -5
- data/lib/appium_lib_core/support/event_firing_bridge.rb +57 -0
- data/lib/appium_lib_core/version.rb +2 -2
- data/lib/appium_lib_core.rb +23 -10
- data/rbs_collection.lock.yaml +252 -0
- data/rbs_collection.yaml +15 -0
- data/sig/gems/selenium/abstract_event_listener.rbs +8 -0
- data/sig/gems/selenium/capabilities.rbs +8 -0
- data/sig/gems/selenium/common.rbs +10 -0
- data/sig/gems/selenium/default.rbs +10 -0
- data/sig/gems/selenium/driver.rbs +7 -0
- data/sig/gems/selenium/has_session_id.rbs +8 -0
- data/sig/gems/selenium/has_web_storage.rbs +8 -0
- data/sig/gems/selenium/uploads_files.rbs +8 -0
- data/sig/lib/appium_lib_core/common/base/capabilities.rbs +9 -0
- data/sig/lib/appium_lib_core/common/base/driver.rbs +167 -0
- data/sig/lib/appium_lib_core/common/base/driver_settings.rbs +15 -0
- data/sig/lib/appium_lib_core/common/base/has_location.rbs +13 -0
- data/sig/lib/appium_lib_core/common/base/has_network_connection.rbs +19 -0
- data/sig/lib/appium_lib_core/common/base/http_default.rbs +38 -0
- data/sig/lib/appium_lib_core/common/base/platform.rbs +7 -0
- data/sig/lib/appium_lib_core/common/base/remote_status.rbs +9 -0
- data/sig/lib/appium_lib_core/common/base/rotable.rbs +17 -0
- data/sig/lib/appium_lib_core/common/base/screenshot.rbs +19 -0
- data/sig/lib/appium_lib_core/common/device/battery_status.rbs +13 -0
- data/sig/lib/appium_lib_core/common/wait.rbs +31 -0
- data/sig/lib/appium_lib_core/device.rbs +21 -0
- data/sig/lib/appium_lib_core/driver.rbs +200 -0
- data/sig/lib/appium_lib_core/ios/xcuitest/device/battery.rbs +15 -0
- data/sig/lib/appium_lib_core/version.rbs +7 -0
- data/sig/lib/appium_lib_core.rbs +8 -0
- metadata +88 -111
- data/.github/ISSUE_TEMPLATE/issue-report.md +0 -29
- data/.github/contributing.md +0 -26
- data/.github/issue_template.md +0 -20
- data/.github/workflows/unittest.yml +0 -68
- data/.gitignore +0 -18
- data/.rubocop.yml +0 -58
- data/azure-pipelines.yml +0 -15
- data/ci-jobs/functional/android_setup.yml +0 -3
- data/ci-jobs/functional/ios_setup.yml +0 -7
- data/ci-jobs/functional/publish_test_result.yml +0 -18
- data/ci-jobs/functional/run_appium.yml +0 -25
- data/ci-jobs/functional/start-emulator.sh +0 -26
- data/ci-jobs/functional_test.yml +0 -298
- data/docs/mobile_command.md +0 -34
- data/lib/appium_lib_core/common/base/bridge/mjsonwp.rb +0 -81
- data/lib/appium_lib_core/common/base/bridge/w3c.rb +0 -252
- data/lib/appium_lib_core/common/command/common.rb +0 -110
- data/lib/appium_lib_core/common/command/w3c.rb +0 -56
- data/lib/appium_lib_core/common/device/value.rb +0 -52
- data/lib/appium_lib_core/common/touch_action/multi_touch.rb +0 -56
- data/lib/appium_lib_core/common/touch_action/touch_actions.rb +0 -203
- data/lib/appium_lib_core/ios/uiautomation/device.rb +0 -44
- data/lib/appium_lib_core/ios/uiautomation/patch.rb +0 -34
- data/release_notes.md +0 -816
- data/script/commands.rb +0 -200
|
@@ -27,6 +27,7 @@ module Appium
|
|
|
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 Appium
|
|
|
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 Appium
|
|
|
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 Appium
|
|
|
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 Appium
|
|
|
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 Appium
|
|
|
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 Appium
|
|
|
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 Appium
|
|
|
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,45 @@ module Appium
|
|
|
106
114
|
# @driver.toggle_data
|
|
107
115
|
#
|
|
108
116
|
|
|
117
|
+
# @deprecated Use 'mobile: getConnectivity' extension instead.
|
|
118
|
+
# @!method location
|
|
119
|
+
# Get the location of the device.
|
|
120
|
+
#
|
|
121
|
+
# @return [::Appium::Location]
|
|
122
|
+
#
|
|
123
|
+
# @example
|
|
124
|
+
#
|
|
125
|
+
# driver.location #=> ::Appium::Location.new(10, 10, 10)
|
|
126
|
+
#
|
|
127
|
+
|
|
128
|
+
# @!method location=
|
|
129
|
+
# Set the location of the device.
|
|
130
|
+
#
|
|
131
|
+
# @param [::Appium::Location] location Set the location.
|
|
132
|
+
#
|
|
133
|
+
# @example
|
|
134
|
+
#
|
|
135
|
+
# driver.location = ::Appium::Location.new(10, 10, 10)
|
|
136
|
+
#
|
|
137
|
+
|
|
138
|
+
# @!method set_location
|
|
139
|
+
# Set the location of the device.
|
|
140
|
+
#
|
|
141
|
+
# @param [String, Number] latitude Set the latitude.
|
|
142
|
+
# @param [String, Number] longitude Set the longitude.
|
|
143
|
+
# @param [String, Number] altitude Set the altitude.
|
|
144
|
+
# @param [String, Number] speed Set the speed to apply the location on Android real devices
|
|
145
|
+
# in meters/second @since Appium 1.21.0 and in knots for emulators @since Appium 1.22.0.
|
|
146
|
+
# @param [String, Number] satellites Sets the count of geo satellites being tracked in range 1..12 @since Appium 1.22.0.
|
|
147
|
+
# This number is respected on Emulators.
|
|
148
|
+
# @param [::Appium::Location]
|
|
149
|
+
#
|
|
150
|
+
# @example
|
|
151
|
+
#
|
|
152
|
+
# driver.set_location 10, 10, 0
|
|
153
|
+
#
|
|
154
|
+
|
|
155
|
+
# @deprecated Use 'mobile: toggleGps' extension instead.
|
|
109
156
|
# @!method toggle_location_services
|
|
110
157
|
# Switch the state of the location service
|
|
111
158
|
#
|
|
@@ -116,6 +163,7 @@ module Appium
|
|
|
116
163
|
# @driver.toggle_location_services
|
|
117
164
|
#
|
|
118
165
|
|
|
166
|
+
# @deprecated Use 'mobile: getConnectivity' extension instead.
|
|
119
167
|
# @!method toggle_airplane_mode
|
|
120
168
|
# Toggle flight mode on or off
|
|
121
169
|
#
|
|
@@ -124,6 +172,7 @@ module Appium
|
|
|
124
172
|
# @driver.toggle_airplane_mode
|
|
125
173
|
#
|
|
126
174
|
|
|
175
|
+
# @deprecated Use 'mobile: hideKeyboard' extension instead.
|
|
127
176
|
# @!method hide_keyboard(close_key = nil, strategy = nil)
|
|
128
177
|
# Hide the onscreen keyboard
|
|
129
178
|
# @param [String] close_key The name of the key which closes the keyboard.
|
|
@@ -139,12 +188,7 @@ module Appium
|
|
|
139
188
|
# @driver.hide_keyboard(nil, :tapOutside) # Close a keyboard with tapping out side of keyboard
|
|
140
189
|
#
|
|
141
190
|
|
|
142
|
-
#
|
|
143
|
-
# Android only; Ends the test coverage and writes the results to the given path on device.
|
|
144
|
-
# @param [String] path Path on the device to write too.
|
|
145
|
-
# @param [String] intent Intent to broadcast when ending coverage.
|
|
146
|
-
#
|
|
147
|
-
|
|
191
|
+
# @deprecated Use 'mobile: startActivity' extension instead.
|
|
148
192
|
# @!method start_activity(opts)
|
|
149
193
|
# Android only. Start a new activity within the current app or launch a new app and start the target activity.
|
|
150
194
|
#
|
|
@@ -169,6 +213,7 @@ module Appium
|
|
|
169
213
|
# app_activity: '.accessibility.AccessibilityNodeProviderActivity'
|
|
170
214
|
#
|
|
171
215
|
|
|
216
|
+
# @deprecated Use 'mobile: setConnectivity' extension instead.
|
|
172
217
|
# @!method set_network_connection(mode)
|
|
173
218
|
# Set the device network connection mode
|
|
174
219
|
# Same as +#network_connection_type+ in selenium-webdriver.
|
|
@@ -191,6 +236,7 @@ module Appium
|
|
|
191
236
|
# @driver.network_connection_type = :airplane_mode # As selenium-webdriver
|
|
192
237
|
#
|
|
193
238
|
|
|
239
|
+
# @deprecated Use 'mobile: getPerformanceDataTypes' extension instead.
|
|
194
240
|
# @!method get_performance_data_types
|
|
195
241
|
# Get the information type of the system state which is supported to read such as
|
|
196
242
|
# cpu, memory, network, battery via adb commands.
|
|
@@ -201,6 +247,7 @@ module Appium
|
|
|
201
247
|
# @driver.get_performance_data_types #=> ["cpuinfo", "batteryinfo", "networkinfo", "memoryinfo"]
|
|
202
248
|
#
|
|
203
249
|
|
|
250
|
+
# @deprecated Use 'mobile: getPerformanceData' extension instead.
|
|
204
251
|
# @!method get_performance_data(package_name:, data_type:, data_read_timeout: 1000)
|
|
205
252
|
# Get the resource usage information of the application.
|
|
206
253
|
# https://github.com/appium/appium-base-driver/blob/be29aec2318316d12b5c3295e924a5ba8f09b0fb/lib/mjsonwp/routes.js#L303
|
|
@@ -280,6 +327,7 @@ module Appium
|
|
|
280
327
|
# @driver.set_clipboard(content: 'happy testing') #=> {"protocol"=>"W3C"}
|
|
281
328
|
#
|
|
282
329
|
|
|
330
|
+
# @deprecated Use 'mobile: fingerprint' extension instead.
|
|
283
331
|
# @!method finger_print(finger_id)
|
|
284
332
|
# Authenticate users by using their finger print scans on supported emulators.
|
|
285
333
|
#
|
|
@@ -290,18 +338,22 @@ module Appium
|
|
|
290
338
|
# @driver.finger_print 1
|
|
291
339
|
#
|
|
292
340
|
|
|
293
|
-
# @!method execute_cdp(cmd, params)
|
|
341
|
+
# @!method execute_cdp(cmd, **params)
|
|
294
342
|
# Execute Chrome Devtools protocol commands
|
|
295
343
|
# https://chromedevtools.github.io/devtools-protocol
|
|
296
344
|
#
|
|
297
345
|
# @param [String] cmd The name of command
|
|
298
|
-
# @
|
|
346
|
+
# @option params The parameter for the command as keyword options.
|
|
299
347
|
#
|
|
300
348
|
# @example
|
|
301
349
|
#
|
|
302
|
-
# @driver.execute_cdp 'Page.captureScreenshot',
|
|
350
|
+
# @driver.execute_cdp 'Page.captureScreenshot', quality: 50, format: 'jpeg'
|
|
303
351
|
# @driver.execute_cdp 'Page.getResourceTree'
|
|
304
352
|
#
|
|
353
|
+
# # for Ruby 2,7 and 3+ compatibility
|
|
354
|
+
# params = {'timezoneId': 'Asia/Tokyo'}
|
|
355
|
+
# driver.execute_cdp 'Emulation.setTimezoneOverride', **params
|
|
356
|
+
#
|
|
305
357
|
|
|
306
358
|
####
|
|
307
359
|
## class << self
|
|
@@ -315,51 +367,65 @@ module Appium
|
|
|
315
367
|
|
|
316
368
|
::Appium::Core::Device.add_endpoint_method(:open_notifications) do
|
|
317
369
|
def open_notifications
|
|
370
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: openNotifications' extension instead"
|
|
371
|
+
|
|
318
372
|
execute :open_notifications
|
|
319
373
|
end
|
|
320
374
|
end
|
|
321
375
|
|
|
322
376
|
::Appium::Core::Device.add_endpoint_method(:current_activity) do
|
|
323
377
|
def current_activity
|
|
378
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: getCurrentActivity' extension instead"
|
|
379
|
+
|
|
324
380
|
execute :current_activity
|
|
325
381
|
end
|
|
326
382
|
end
|
|
327
383
|
|
|
328
384
|
::Appium::Core::Device.add_endpoint_method(:current_package) do
|
|
329
385
|
def current_package
|
|
386
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: getCurrentPackage' extension instead"
|
|
387
|
+
|
|
330
388
|
execute :current_package
|
|
331
389
|
end
|
|
332
390
|
end
|
|
333
391
|
|
|
334
392
|
::Appium::Core::Device.add_endpoint_method(:get_system_bars) do
|
|
335
393
|
def get_system_bars
|
|
394
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: getSystemBars' extension instead"
|
|
395
|
+
|
|
336
396
|
execute :get_system_bars
|
|
337
397
|
end
|
|
338
398
|
end
|
|
339
399
|
# as alias to get_system_bars
|
|
340
400
|
::Appium::Core::Device.add_endpoint_method(:system_bars) do
|
|
341
401
|
def system_bars
|
|
402
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: getSystemBars' extension instead"
|
|
403
|
+
|
|
342
404
|
execute :get_system_bars
|
|
343
405
|
end
|
|
344
406
|
end
|
|
345
407
|
|
|
346
408
|
::Appium::Core::Device.add_endpoint_method(:toggle_location_services) do
|
|
347
409
|
def toggle_location_services
|
|
410
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: toggleGps' extension instead"
|
|
411
|
+
|
|
348
412
|
execute :toggle_location_services
|
|
349
413
|
end
|
|
350
414
|
end
|
|
351
415
|
|
|
352
416
|
::Appium::Core::Device.add_endpoint_method(:start_activity) do
|
|
353
417
|
def start_activity(opts)
|
|
354
|
-
|
|
418
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: startActivity' extension instead"
|
|
419
|
+
|
|
420
|
+
raise ::Appium::Core::Error::ArgumentError, 'opts must be a hash' unless opts.is_a? Hash
|
|
355
421
|
|
|
356
422
|
option = {}
|
|
357
423
|
|
|
358
424
|
app_package = opts[:app_package]
|
|
359
|
-
raise 'app_package is required' unless app_package
|
|
425
|
+
raise ::Appium::Core::Error::ArgumentError, 'app_package is required' unless app_package
|
|
360
426
|
|
|
361
427
|
app_activity = opts[:app_activity]
|
|
362
|
-
raise 'app_activity is required' unless app_activity
|
|
428
|
+
raise ::Appium::Core::Error::ArgumentError, 'app_activity is required' unless app_activity
|
|
363
429
|
|
|
364
430
|
option[:appPackage] = app_package
|
|
365
431
|
option[:appActivity] = app_activity
|
|
@@ -388,6 +454,8 @@ module Appium
|
|
|
388
454
|
# Android, Override included method in bridge
|
|
389
455
|
::Appium::Core::Device.add_endpoint_method(:hide_keyboard) do
|
|
390
456
|
def hide_keyboard(close_key = nil, strategy = nil)
|
|
457
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: hideKeyboard' extension instead"
|
|
458
|
+
|
|
391
459
|
option = {}
|
|
392
460
|
|
|
393
461
|
option[:key] = close_key if close_key
|
|
@@ -400,14 +468,9 @@ module Appium
|
|
|
400
468
|
# Android, Override included method in bridge
|
|
401
469
|
::Appium::Core::Device.add_endpoint_method(:background_app) do
|
|
402
470
|
def background_app(duration = 0)
|
|
403
|
-
|
|
404
|
-
end
|
|
405
|
-
end
|
|
471
|
+
::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: backgroundApp' extension instead"
|
|
406
472
|
|
|
407
|
-
|
|
408
|
-
::Appium::Core::Device.add_endpoint_method(:end_coverage) do
|
|
409
|
-
def end_coverage(path, intent)
|
|
410
|
-
execute :end_coverage, {}, path: path, intent: intent
|
|
473
|
+
execute :background_app, {}, seconds: duration
|
|
411
474
|
end
|
|
412
475
|
end
|
|
413
476
|
|
|
@@ -415,7 +478,7 @@ module Appium
|
|
|
415
478
|
# SeleniumWebdriver could already define this method
|
|
416
479
|
return if method_defined? :execute_cdp
|
|
417
480
|
|
|
418
|
-
def execute_cdp(cmd, params
|
|
481
|
+
def execute_cdp(cmd, **params)
|
|
419
482
|
execute :chrome_send_command, {}, { cmd: cmd, params: params }
|
|
420
483
|
end
|
|
421
484
|
end
|