appium_lib_core 9.5.2 → 11.0.0

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -4
  3. data/Gemfile +2 -2
  4. data/README.md +2 -2
  5. data/lib/appium_lib_core/android/device/auth_finger_print.rb +1 -4
  6. data/lib/appium_lib_core/android/device/clipboard.rb +2 -2
  7. data/lib/appium_lib_core/android/device/emulator.rb +7 -8
  8. data/lib/appium_lib_core/android/device/performance.rb +3 -7
  9. data/lib/appium_lib_core/android/device/screen.rb +1 -3
  10. data/lib/appium_lib_core/android/device.rb +12 -184
  11. data/lib/appium_lib_core/common/base/bridge.rb +1 -15
  12. data/lib/appium_lib_core/common/base/driver.rb +6 -34
  13. data/lib/appium_lib_core/common/command.rb +1 -45
  14. data/lib/appium_lib_core/common/device/app_management.rb +1 -1
  15. data/lib/appium_lib_core/common/device/app_state.rb +2 -2
  16. data/lib/appium_lib_core/common/device/device.rb +3 -2
  17. data/lib/appium_lib_core/common/device/device_lock.rb +3 -3
  18. data/lib/appium_lib_core/common/device/keyboard.rb +4 -5
  19. data/lib/appium_lib_core/common/device/keyevent.rb +3 -3
  20. data/lib/appium_lib_core/common/log.rb +4 -4
  21. data/lib/appium_lib_core/common/ws/websocket.rb +1 -1
  22. data/lib/appium_lib_core/driver.rb +12 -12
  23. data/lib/appium_lib_core/ios/device/clipboard.rb +2 -2
  24. data/lib/appium_lib_core/ios/device.rb +2 -2
  25. data/lib/appium_lib_core/ios/xcuitest/device.rb +4 -13
  26. data/lib/appium_lib_core/version.rb +2 -2
  27. data/sig/lib/appium_lib_core/common/base/driver.rbs +1 -3
  28. metadata +3 -6
  29. data/lib/appium_lib_core/android/device/network.rb +0 -71
  30. data/lib/appium_lib_core/common/base/has_network_connection.rb +0 -56
  31. data/sig/lib/appium_lib_core/common/base/has_network_connection.rbs +0 -19
@@ -20,7 +20,6 @@ require_relative 'screenshot'
20
20
  require_relative 'rotable'
21
21
  require_relative 'remote_status'
22
22
  require_relative 'has_location'
23
- require_relative 'has_network_connection'
24
23
  require_relative '../wait'
25
24
 
26
25
  module Appium
@@ -35,7 +34,6 @@ module Appium
35
34
  include ::Appium::Core::Base::TakesScreenshot
36
35
  include ::Appium::Core::Base::HasRemoteStatus
37
36
  include ::Appium::Core::Base::HasLocation
38
- include ::Appium::Core::Base::HasNetworkConnection
39
37
 
40
38
  include ::Appium::Core::Waitable
41
39
 
@@ -223,7 +221,6 @@ module Appium
223
221
  )
224
222
  end
225
223
 
226
- # @deprecated Use 'mobile: lock' extension instead.
227
224
  # Lock the device
228
225
  # @return [String]
229
226
  #
@@ -234,11 +231,9 @@ module Appium
234
231
  # # Block other commands during locking the device.
235
232
  #
236
233
  def lock(duration = nil)
237
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: lock' extension instead"
238
234
  @bridge.lock(duration)
239
235
  end
240
236
 
241
- # @deprecated Use 'mobile: isLocked' extension instead.
242
237
  # Check current device status is weather locked or not
243
238
  #
244
239
  # @example
@@ -247,12 +242,10 @@ module Appium
247
242
  # @driver.locked?
248
243
  #
249
244
  def locked?
250
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: isLocked' extension instead"
251
245
  @bridge.device_locked?
252
246
  end
253
247
  alias device_locked? locked?
254
248
 
255
- # @deprecated Use 'mobile: unlock' extension instead.
256
249
  # Unlock the device
257
250
  #
258
251
  # @example
@@ -260,30 +253,22 @@ module Appium
260
253
  # @driver.unlock
261
254
  #
262
255
  def unlock
263
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: unlock' extension instead"
264
256
  @bridge.unlock
265
257
  end
266
258
 
267
- # @deprecated Use 'mobile: hideKeyboard' extension instead.
268
259
  # Hide the onscreen keyboard
269
260
  # @param [String] close_key The name of the key which closes the keyboard.
270
261
  # Defaults to 'Done' for iOS(except for XCUITest).
271
- # @param [Symbol] strategy The symbol of the strategy which closes the keyboard.
272
- # XCUITest ignore this argument.
273
- # Default for iOS is +:pressKey+. Default for Android is +:tapOutside+.
274
262
  #
275
263
  # @example
276
264
  #
277
265
  # @driver.hide_keyboard # Close a keyboard with the 'Done' button
278
266
  # @driver.hide_keyboard('Finished') # Close a keyboard with the 'Finished' button
279
- # @driver.hide_keyboard(nil, :tapOutside) # Close a keyboard with tapping out side of keyboard
280
267
  #
281
- def hide_keyboard(close_key = nil, strategy = nil)
282
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: hideKeyboard' extension instead"
283
- @bridge.hide_keyboard close_key, strategy
268
+ def hide_keyboard(close_key = nil)
269
+ @bridge.hide_keyboard close_key
284
270
  end
285
271
 
286
- # @deprecated Use 'mobile: isKeyboardShown' extension instead.
287
272
  # Get whether keyboard is displayed or not.
288
273
  # @return [Boolean] Return true if keyboard is shown. Return false if keyboard is hidden.
289
274
  #
@@ -292,7 +277,6 @@ module Appium
292
277
  # @driver.keyboard_shown? # true
293
278
  #
294
279
  def keyboard_shown?
295
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: isKeyboardShown' extension instead"
296
280
  @bridge.is_keyboard_shown
297
281
  end
298
282
  alias is_keyboard_shown keyboard_shown?
@@ -542,15 +526,14 @@ module Appium
542
526
  @bridge.pull_folder(path)
543
527
  end
544
528
 
545
- # @deprecated Use 'mobile: pressKey' extension instead.
546
529
  # Press keycode on the device.
547
530
  # http://developer.android.com/reference/android/view/KeyEvent.html
548
531
  # @param [Integer] key The key to press. The values which have +KEYCODE_+ prefix in http://developer.android.com/reference/android/view/KeyEvent.html
549
532
  # e.g.: KEYCODE_HOME is +3+ or +0x00000003+
550
- # @param [[Integer]] metastate The state the metakeys should be in when pressing the key. Default is empty Array.
533
+ # @param [Array<Integer>] metastate The state the metakeys should be in when pressing the key. Default is empty Array.
551
534
  # Metastate have +META_+ prefix in https://developer.android.com/reference/android/view/KeyEvent.html
552
535
  # e.g.: META_SHIFT_ON is +1+ or +0x00000001+
553
- # @param [[Integer]] flags Native Android flag value. Several flags can be combined into a single key event.
536
+ # @param [Array<Integer>] flags Native Android flag value. Several flags can be combined into a single key event.
554
537
  # Default is empty Array. Can set multiple flags as Array.
555
538
  # Flags have +FLAG_+ prefix in http://developer.android.com/reference/android/view/KeyEvent.html
556
539
  # e.g.: FLAG_CANCELED is +32+ or +0x00000020+
@@ -562,19 +545,17 @@ module Appium
562
545
  # @driver.press_keycode 66, metastate: [1], flags: [32]
563
546
  #
564
547
  def press_keycode(key, metastate: [], flags: [])
565
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: pressKey' extension instead"
566
548
  @bridge.press_keycode(key, metastate: metastate, flags: flags)
567
549
  end
568
550
 
569
- # @deprecated Use 'mobile: pressKey' extension instead.
570
551
  # Long press keycode on the device.
571
552
  # http://developer.android.com/reference/android/view/KeyEvent.html
572
553
  # @param [Integer] key The key to long press. The values which have +KEYCODE_+ prefix in http://developer.android.com/reference/android/view/KeyEvent.html
573
554
  # e.g.: KEYCODE_HOME is +3+ or +0x00000003+
574
- # @param [[Integer]] metastate The state the metakeys should be in when pressing the key. Default is empty Array.
555
+ # @param [Array<Integer>] metastate The state the metakeys should be in when pressing the key. Default is empty Array.
575
556
  # Metastate have +META_+ prefix in https://developer.android.com/reference/android/view/KeyEvent.html
576
557
  # e.g.: META_SHIFT_ON is +1+ or +0x00000001+
577
- # @param [[Integer]] flags Native Android flag value. Several flags can be combined into a single key event.
558
+ # @param [Array<Integer>] flags Native Android flag value. Several flags can be combined into a single key event.
578
559
  # Default is empty Array. Can set multiple flags as Array.
579
560
  # Flags have +FLAG_+ prefix in http://developer.android.com/reference/android/view/KeyEvent.html
580
561
  # e.g.: FLAG_CANCELED is +32+ or +0x00000020+
@@ -586,11 +567,9 @@ module Appium
586
567
  # @driver.long_press_keycode 66, metastate: [1], flags: [32, 8192]
587
568
  #
588
569
  def long_press_keycode(key, metastate: [], flags: [])
589
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: pressKey' extension instead"
590
570
  @bridge.long_press_keycode(key, metastate: metastate, flags: flags)
591
571
  end
592
572
 
593
- # @deprecated Use 'mobile: getAppStrings' extension instead.
594
573
  # Return the hash of all localization strings.
595
574
  # @return [Hash]
596
575
  #
@@ -599,11 +578,9 @@ module Appium
599
578
  # @driver.app_strings #=> "TransitionsTitle"=>"Transitions", "WebTitle"=>"Web"
600
579
  #
601
580
  def app_strings(language = nil)
602
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: getAppStrings' extension instead"
603
581
  @bridge.app_strings(language)
604
582
  end
605
583
 
606
- # @deprecated Use 'mobile: backgroundApp' extension instead.
607
584
  # Backgrounds the app for a set number of seconds.
608
585
  # This is a blocking application
609
586
  # @param [Integer] duration How many seconds to background the app for.
@@ -732,7 +709,6 @@ module Appium
732
709
  # @driver.query_app_state("io.appium.bundle") #=> :not_running
733
710
  #
734
711
  def app_state(app_id)
735
- # TODO: use mobile command in the background?
736
712
  @bridge.app_state(app_id)
737
713
  end
738
714
  alias query_app_state app_state
@@ -772,7 +748,6 @@ module Appium
772
748
  @bridge.stop_and_save_recording_screen(file_path)
773
749
  end
774
750
 
775
- # @deprecated Use 'mobile: shake' extension instead.
776
751
  # Cause the device to shake
777
752
  #
778
753
  # @example
@@ -780,11 +755,9 @@ module Appium
780
755
  # @driver.shake
781
756
  #
782
757
  def shake
783
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: shake' extension instead"
784
758
  @bridge.shake
785
759
  end
786
760
 
787
- # @deprecated Use 'mobile: getDeviceTime' extension instead.
788
761
  # Get the time on the device
789
762
  #
790
763
  # @param [String] format The set of format specifiers. Read https://momentjs.com/docs/ to get
@@ -798,7 +771,6 @@ module Appium
798
771
  # @driver.device_time "YYYY-MM-DD" #=> "2018-06-12"
799
772
  #
800
773
  def device_time(format = nil)
801
- ::Appium::Logger.warn "[DEPRECATION] Please use 'mobile: getDeviceTime' extension instead"
802
774
  @bridge.device_time(format)
803
775
  end
804
776
 
@@ -184,75 +184,31 @@ module Appium
184
184
  set_context: [:post, 'session/:session_id/context'],
185
185
  current_context: [:get, 'session/:session_id/context'],
186
186
 
187
- background_app: [:post, 'session/:session_id/appium/app/background'],
188
- app_strings: [:post, 'session/:session_id/appium/app/strings'],
189
-
190
- device_locked?: [:post, 'session/:session_id/appium/device/is_locked'],
191
- unlock: [:post, 'session/:session_id/appium/device/unlock'],
192
- lock: [:post, 'session/:session_id/appium/device/lock'],
193
187
  device_time: [:get, 'session/:session_id/appium/device/system_time'],
194
188
  install_app: [:post, 'session/:session_id/appium/device/install_app'],
195
189
  remove_app: [:post, 'session/:session_id/appium/device/remove_app'],
196
190
  app_installed?: [:post, 'session/:session_id/appium/device/app_installed'],
197
191
  activate_app: [:post, 'session/:session_id/appium/device/activate_app'],
198
192
  terminate_app: [:post, 'session/:session_id/appium/device/terminate_app'],
199
- app_state: [:post, 'session/:session_id/appium/device/app_state'],
200
- shake: [:post, 'session/:session_id/appium/device/shake'],
201
- hide_keyboard: [:post, 'session/:session_id/appium/device/hide_keyboard'],
202
- press_keycode: [:post, 'session/:session_id/appium/device/press_keycode'],
203
- long_press_keycode: [:post, 'session/:session_id/appium/device/long_press_keycode'],
204
193
  push_file: [:post, 'session/:session_id/appium/device/push_file'],
205
194
  pull_file: [:post, 'session/:session_id/appium/device/pull_file'],
206
195
  pull_folder: [:post, 'session/:session_id/appium/device/pull_folder'],
207
- get_clipboard: [:post, 'session/:session_id/appium/device/get_clipboard'],
208
- set_clipboard: [:post, 'session/:session_id/appium/device/set_clipboard'],
209
- finger_print: [:post, 'session/:session_id/appium/device/finger_print'],
210
196
  get_settings: [:get, 'session/:session_id/appium/settings'],
211
197
  update_settings: [:post, 'session/:session_id/appium/settings'],
212
198
  stop_recording_screen: [:post, 'session/:session_id/appium/stop_recording_screen'],
213
199
  start_recording_screen: [:post, 'session/:session_id/appium/start_recording_screen'],
214
200
  compare_images: [:post, 'session/:session_id/appium/compare_images'],
215
- is_keyboard_shown: [:get, 'session/:session_id/appium/device/is_keyboard_shown'],
216
201
  execute_driver: [:post, 'session/:session_id/appium/execute_driver'],
217
202
  post_log_event: [:post, 'session/:session_id/appium/log_event'],
218
203
  get_log_events: [:post, 'session/:session_id/appium/events']
219
204
  }.freeze
220
205
 
221
206
  COMMAND_ANDROID = {
222
- open_notifications: [:post, 'session/:session_id/appium/device/open_notifications'],
223
- toggle_airplane_mode: [:post, 'session/:session_id/appium/device/toggle_airplane_mode'],
224
- start_activity: [:post, 'session/:session_id/appium/device/start_activity'],
225
- current_activity: [:get, 'session/:session_id/appium/device/current_activity'],
226
- current_package: [:get, 'session/:session_id/appium/device/current_package'],
227
- get_system_bars: [:get, 'session/:session_id/appium/device/system_bars'],
228
- get_display_density: [:get, 'session/:session_id/appium/device/display_density'],
229
- toggle_wifi: [:post, 'session/:session_id/appium/device/toggle_wifi'],
230
- toggle_data: [:post, 'session/:session_id/appium/device/toggle_data'],
231
- toggle_location_services: [:post, 'session/:session_id/appium/device/toggle_location_services'],
232
- get_performance_data_types: [:post, 'session/:session_id/appium/performanceData/types'],
233
- get_performance_data: [:post, 'session/:session_id/appium/getPerformanceData'],
234
- get_network_connection: [:get, 'session/:session_id/network_connection'], # defined also in OSS
235
- set_network_connection: [:post, 'session/:session_id/network_connection'], # defined also in OSS
236
-
237
- # only emulator
238
- send_sms: [:post, 'session/:session_id/appium/device/send_sms'],
239
- gsm_call: [:post, 'session/:session_id/appium/device/gsm_call'],
240
- gsm_signal: [:post, 'session/:session_id/appium/device/gsm_signal'],
241
- gsm_voice: [:post, 'session/:session_id/appium/device/gsm_voice'],
242
- set_network_speed: [:post, 'session/:session_id/appium/device/network_speed'],
243
- set_power_capacity: [:post, 'session/:session_id/appium/device/power_capacity'],
244
- set_power_ac: [:post, 'session/:session_id/appium/device/power_ac'],
245
-
246
207
  # For chromium: https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/server/http_handler.cc
247
208
  chrome_send_command: [:post, 'session/:session_id/goog/cdp/execute']
248
209
  }.freeze
249
210
 
250
- COMMAND_IOS = {
251
- touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'],
252
- toggle_touch_id_enrollment: [:post, 'session/:session_id/appium/simulator/toggle_touch_id_enrollment']
253
- }.freeze
254
-
255
- COMMANDS = {}.merge(COMMAND).merge(COMMAND_ANDROID).merge(COMMAND_IOS).freeze
211
+ COMMANDS = {}.merge(COMMAND).merge(COMMAND_ANDROID).freeze
256
212
  end # module Commands
257
213
  end # module Core
258
214
  end # module Appium
@@ -19,7 +19,7 @@ module Appium
19
19
  module AppManagement
20
20
  def app_strings(language = nil)
21
21
  opts = language ? { language: language } : {}
22
- execute :app_strings, {}, opts
22
+ execute_script 'mobile:getAppStrings', opts
23
23
  end
24
24
 
25
25
  def background_app(duration = 0)
@@ -26,8 +26,8 @@ module Appium
26
26
  ].freeze
27
27
 
28
28
  def app_state(app_id)
29
- # required: [['appId'], ['bundleId']]
30
- response = execute :app_state, {}, appId: app_id
29
+ # appId is for android, bundleId is for ios.
30
+ response = execute_script 'mobile:queryAppState', { 'appId': app_id, 'bundleId': app_id }
31
31
 
32
32
  case response
33
33
  when 0, 1, 2, 3, 4
@@ -18,13 +18,14 @@ module Appium
18
18
  module Device
19
19
  module Device
20
20
  def shake
21
- execute :shake
21
+ execute_script 'mobile:shake', {}
22
22
  end
23
23
 
24
24
  def device_time(format = nil)
25
25
  arg = {}
26
26
  arg[:format] = format unless format.nil?
27
- execute :device_time, {}, arg
27
+
28
+ execute_script 'mobile:getDeviceTime', arg
28
29
  end
29
30
  end # module Device
30
31
  end # module Device
@@ -19,15 +19,15 @@ module Appium
19
19
  module DeviceLock
20
20
  def lock(duration = nil)
21
21
  opts = duration ? { seconds: duration } : {}
22
- execute :lock, {}, opts
22
+ execute_script 'mobile:lock', opts
23
23
  end
24
24
 
25
25
  def device_locked?
26
- execute :device_locked?
26
+ execute_script 'mobile:isLocked', {}
27
27
  end
28
28
 
29
29
  def unlock
30
- execute :unlock
30
+ execute_script 'mobile:unlock', {}
31
31
  end
32
32
  end # module DeviceLock
33
33
  end # module Device
@@ -17,17 +17,16 @@ module Appium
17
17
  class Base
18
18
  module Device
19
19
  module Keyboard
20
- def hide_keyboard(close_key = nil, strategy = nil)
20
+ def hide_keyboard(close_key = nil)
21
21
  option = {}
22
22
 
23
- option[:key] = close_key || 'Done' # default to Done key.
24
- option[:strategy] = strategy || :pressKey # default to pressKey
23
+ option[:key] = close_key || 'Done' # default to Done key.
25
24
 
26
- execute :hide_keyboard, {}, option
25
+ execute_script 'mobile:hideKeyboard', option
27
26
  end
28
27
 
29
28
  def is_keyboard_shown # rubocop:disable Naming/PredicateName
30
- execute :is_keyboard_shown
29
+ execute_script 'mobile:isKeyboardShown', {}
31
30
  end
32
31
  end # module Keyboard
33
32
  end # module Device
@@ -32,18 +32,18 @@ module Appium
32
32
  args[:metastate] = metastate.reduce(0) { |acc, meta| acc | meta } unless metastate.empty?
33
33
  args[:flags] = flags.reduce(0) { |acc, flag| acc | flag } unless flags.empty?
34
34
 
35
- execute :press_keycode, {}, args
35
+ execute_script 'mobile:pressKey', args
36
36
  end
37
37
 
38
38
  def long_press_keycode(key, metastate: [], flags: [])
39
39
  raise ::Appium::Core::Error::ArgumentError, 'flags should be Array' unless flags.is_a? Array
40
40
  raise ::Appium::Core::Error::ArgumentError, 'metastates should be Array' unless metastate.is_a? Array
41
41
 
42
- args = { keycode: key }
42
+ args = { keycode: key, isLongPress: true }
43
43
  args[:metastate] = metastate.reduce(0) { |acc, meta| acc | meta } unless metastate.empty?
44
44
  args[:flags] = flags.reduce(0) { |acc, flag| acc | flag } unless flags.empty?
45
45
 
46
- execute :long_press_keycode, {}, args
46
+ execute_script 'mobile:pressKey', args
47
47
  end
48
48
  end # module KeyEvent
49
49
  end # module Device
@@ -19,8 +19,8 @@ module Appium
19
19
  @bridge = bridge
20
20
  end
21
21
 
22
- # @param [String|Hash] type You can get particular type's logs.
23
- # @return [[Selenium::WebDriver::LogEntry]] A list of logs data.
22
+ # @param [String, Hash] type You can get particular type's logs.
23
+ # @return [Array<Selenium::WebDriver::LogEntry>] A list of logs data.
24
24
  #
25
25
  # @example
26
26
  #
@@ -33,7 +33,7 @@ module Appium
33
33
 
34
34
  # Get a list of available log types
35
35
  #
36
- # @return [[Hash]] A list of available log types.
36
+ # @return [Array<Hash>] A list of available log types.
37
37
  # @example
38
38
  #
39
39
  # @driver.logs.available_types # [:syslog, :crashlog, :performance]
@@ -74,7 +74,7 @@ module Appium
74
74
  # @since Appium 1.16.0
75
75
  # Returns events with filtering with 'type'. Defaults to all available events.
76
76
  #
77
- # @param [String] type The type of events to get
77
+ # @param [String, Array<String>] type The type of events to get
78
78
  # @return [Hash]
79
79
  #
80
80
  # @example
@@ -84,7 +84,7 @@ module Appium
84
84
  # Accepts either a String or an Array of byte-sized integers and sends a text or binary message over the connection
85
85
  # to the other peer; binary data must be encoded as an Array.
86
86
  #
87
- # @param [String|Array] message A message to send a text or binary message over the connection
87
+ # @param [String, Array] message A message to send a text or binary message over the connection
88
88
  #
89
89
  # @example
90
90
  # ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
@@ -129,7 +129,7 @@ module Appium
129
129
  attr_reader :automation_name
130
130
 
131
131
  # Custom URL for the selenium server. If set this attribute, ruby_lib_core try to handshake to the custom url.<br>
132
- # Defaults to false. Then try to connect to <code>http://127.0.0.1:#{port}/wd/hub</code>.
132
+ # Defaults to false. Then try to connect to <code>http://127.0.0.1:#{port}</code>.
133
133
  # @return [String]
134
134
  attr_reader :custom_url
135
135
 
@@ -196,7 +196,7 @@ module Appium
196
196
  # # format 1
197
197
  # @core = Appium::Core.for caps: {...}, appium_lib: {...}
198
198
  # # format 2. 'capabilities:' is also available instead of 'caps:'.
199
- # @core = Appium::Core.for url: "http://127.0.0.1:8080/wd/hub", capabilities: {...}, appium_lib: {...}
199
+ # @core = Appium::Core.for url: "http://127.0.0.1:8080", capabilities: {...}, appium_lib: {...}
200
200
  #
201
201
  #
202
202
  # require 'rubygems'
@@ -220,7 +220,7 @@ module Appium
220
220
  # }
221
221
  # }
222
222
  # @core = Appium::Core.for(opts) # create a core driver with 'opts' and extend methods into 'self'
223
- # @core.start_driver # Connect to 'http://127.0.0.1:8080/wd/hub' because of 'port: 8080'
223
+ # @core.start_driver # Connect to 'http://127.0.0.1:8080' because of 'port: 8080'
224
224
  #
225
225
  # # Start iOS driver with .zip file over HTTP
226
226
  # # 'capabilities:' is also available instead of 'caps:'. Either is fine.
@@ -233,7 +233,7 @@ module Appium
233
233
  # app: 'http://example.com/path/to/MyiOS.app.zip'
234
234
  # },
235
235
  # appium_lib: {
236
- # server_url: 'http://custom-host:8080/wd/hub.com',
236
+ # server_url: 'http://custom-host:8080/wd/hub',
237
237
  # wait: 0,
238
238
  # wait_timeout: 20,
239
239
  # wait_interval: 0.3,
@@ -241,11 +241,11 @@ module Appium
241
241
  # }
242
242
  # }
243
243
  # @core = Appium::Core.for(opts)
244
- # @core.start_driver # Connect to 'http://custom-host:8080/wd/hub.com'
244
+ # @core.start_driver # Connect to 'http://custom-host:8080/wd/hub'
245
245
  #
246
246
  # # Start iOS driver as another format. 'url' is available like below
247
247
  # opts = {
248
- # url: "http://custom-host:8080/wd/hub.com",
248
+ # url: "http://custom-host:8080/wd/hub",
249
249
  # capabilities: {
250
250
  # platformName: :ios,
251
251
  # platformVersion: '11.0',
@@ -261,7 +261,7 @@ module Appium
261
261
  # }
262
262
  # }
263
263
  # @core = Appium::Core.for(opts) # create a core driver with 'opts' and extend methods into 'self'
264
- # @core.start_driver # start driver with 'url'. Connect to 'http://custom-host:8080/wd/hub.com'
264
+ # @core.start_driver # start driver with 'url'. Connect to 'http://custom-host:8080/wd/hub'
265
265
  #
266
266
  # # With a custom listener
267
267
  # class CustomListener < ::Selenium::WebDriver::Support::AbstractEventListener
@@ -300,7 +300,7 @@ module Appium
300
300
  #
301
301
  # new_driver = ::Appium::Core::Driver.attach_to(
302
302
  # driver.session_id, # The 'driver' has an existing session id
303
- # url: 'http://127.0.0.1:4723/wd/hub', automation_name: 'UiAutomator2', platform_name: 'Android'
303
+ # url: 'http://127.0.0.1:4723', automation_name: 'UiAutomator2', platform_name: 'Android'
304
304
  # )
305
305
  # new_driver.page_source # for example
306
306
  #
@@ -352,7 +352,7 @@ module Appium
352
352
  # Creates a new global driver and quits the old one if it exists.
353
353
  # You can customise http_client as the following
354
354
  #
355
- # @param [String] server_url Custom server url to send to requests. Default is "http://127.0.0.1:4723/wd/hub".
355
+ # @param [String] server_url Custom server url to send to requests. Default is "http://127.0.0.1:4723".
356
356
  # @param http_client_ops [Hash] Options for http client
357
357
  # @option http_client_ops [Hash] :http_client Custom HTTP Client
358
358
  # @option http_client_ops [Hash] :open_timeout Custom open timeout for http client.
@@ -383,10 +383,10 @@ module Appium
383
383
  # }
384
384
  #
385
385
  # @core = Appium::Core.for(opts) # create a core driver with 'opts' and extend methods into 'self'
386
- # @driver = @core.start_driver server_url: "http://127.0.0.1:8000/wd/hub"
386
+ # @driver = @core.start_driver server_url: "http://127.0.0.1:8000"
387
387
  #
388
388
  # # Attach custom HTTP client
389
- # @driver = @core.start_driver server_url: "http://127.0.0.1:8000/wd/hub",
389
+ # @driver = @core.start_driver server_url: "http://127.0.0.1:8000",
390
390
  # http_client_ops: { http_client: Your:Http:Client.new,
391
391
  # open_timeout: 1_000,
392
392
  # read_timeout: 1_000 }
@@ -394,7 +394,7 @@ module Appium
394
394
 
395
395
  def start_driver(server_url: nil,
396
396
  http_client_ops: { http_client: nil, open_timeout: 999_999, read_timeout: 999_999 })
397
- @custom_url ||= "http://127.0.0.1:#{@port}/wd/hub"
397
+ @custom_url ||= "http://127.0.0.1:#{@port}"
398
398
  @custom_url = server_url unless server_url.nil?
399
399
 
400
400
  @http_client = get_http_client http_client: http_client_ops.delete(:http_client),
@@ -29,7 +29,7 @@ module Appium
29
29
 
30
30
  params = { contentType: content_type }
31
31
 
32
- data = execute(:get_clipboard, {}, params)
32
+ data = execute_script 'mobile:getClipboard', params
33
33
  Base64.decode64 data
34
34
  end
35
35
  end
@@ -46,7 +46,7 @@ module Appium
46
46
  content: Base64.strict_encode64(content)
47
47
  }
48
48
 
49
- execute(:set_clipboard, {}, params)
49
+ execute_script 'mobile:setClipboard', params
50
50
  end
51
51
  end
52
52
  end
@@ -75,13 +75,13 @@ module Appium
75
75
 
76
76
  ::Appium::Core::Device.add_endpoint_method(:touch_id) do
77
77
  def touch_id(match = true)
78
- execute :touch_id, {}, match: match
78
+ execute_script 'mobile:sendBiometricMatch', { 'type': 'touch_id', match: match }
79
79
  end
80
80
  end
81
81
 
82
82
  ::Appium::Core::Device.add_endpoint_method(:toggle_touch_id_enrollment) do
83
83
  def toggle_touch_id_enrollment(enabled = true)
84
- execute :toggle_touch_id_enrollment, {}, enabled: enabled
84
+ execute_script 'mobile:enrollBiometric', { 'isEnabled': enabled }
85
85
  end
86
86
  end
87
87
 
@@ -25,13 +25,9 @@ module Appium
25
25
 
26
26
  # rubocop:disable Layout/LineLength
27
27
 
28
- # @deprecated Use 'mobile: hideKeyboard' extension instead.
29
- # @!method hide_keyboard(close_key = nil, strategy = nil)
28
+ # @!method hide_keyboard(close_key = nil)
30
29
  # Hide the onscreen keyboard
31
30
  # @param [String] close_key The name of the key which closes the keyboard.
32
- # @param [Symbol] strategy The symbol of the strategy which closes the keyboard.
33
- # XCUITest ignore this argument.
34
- # Default for iOS is +:pressKey+. Default for Android is +:tapOutside+.
35
31
  #
36
32
  # @example
37
33
  #
@@ -39,7 +35,6 @@ module Appium
39
35
  # @driver.hide_keyboard('Finished') # Close a keyboard with the 'Finished' button
40
36
  #
41
37
 
42
- # @deprecated Use 'mobile: backgroundApp' extension instead.
43
38
  # @!method background_app(duration = 0)
44
39
  # Backgrounds the app for a set number of seconds.
45
40
  # This is a blocking application.
@@ -183,23 +178,19 @@ module Appium
183
178
  def extended(_mod)
184
179
  # Xcuitest, Override included method in bridge
185
180
  ::Appium::Core::Device.add_endpoint_method(:hide_keyboard) do
186
- def hide_keyboard(close_key = nil, strategy = nil)
181
+ def hide_keyboard(close_key = nil)
187
182
  option = {}
188
183
 
189
184
  option[:key] = close_key if close_key
190
- option[:strategy] = strategy if strategy
191
185
 
192
- execute :hide_keyboard, {}, option
186
+ execute_script 'mobile:hideKeyboard', option
193
187
  end
194
188
  end
195
189
 
196
190
  # Xcuitest, Override included method in bridge
197
191
  ::Appium::Core::Device.add_endpoint_method(:background_app) do
198
192
  def background_app(duration = 0)
199
- # https://github.com/appium/ruby_lib/issues/500, https://github.com/appium/appium/issues/7741
200
- # 'execute :background_app, {}, seconds: { timeout: duration_milli_sec }' works over Appium 1.6.4
201
- duration_milli_sec = duration.nil? ? nil : duration * 1000
202
- execute :background_app, {}, seconds: { timeout: duration_milli_sec }
193
+ execute_script 'mobile:backgroundApp', { seconds: duration }
203
194
  end
204
195
  end
205
196
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '9.5.2' unless defined? ::Appium::Core::VERSION
18
- DATE = '2025-01-30' unless defined? ::Appium::Core::DATE
17
+ VERSION = '11.0.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2025-03-21' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
@@ -32,8 +32,6 @@ module Appium
32
32
 
33
33
  include Base::HasLocation
34
34
 
35
- include Base::HasNetworkConnection
36
-
37
35
  include Core::Waitable
38
36
 
39
37
  attr_reader bridge: untyped
@@ -62,7 +60,7 @@ module Appium
62
60
 
63
61
  def unlock: () -> untyped
64
62
 
65
- def hide_keyboard: (?untyped? close_key, ?untyped? strategy) -> untyped
63
+ def hide_keyboard: (?untyped? close_key) -> untyped
66
64
 
67
65
  def keyboard_shown?: () -> untyped
68
66