appium_lib_core 5.0.0.rc7 → 5.0.0.rc8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86c326e32b6a255221e4eeb9c4636a2ad9862e33c536099fd926b5f75aa722ca
4
- data.tar.gz: 42badc486fa895ccad392a404778cf59fc6bdf3ef8cd084e67375b757a6066ef
3
+ metadata.gz: 02c194c911952ee0560a5fd0ba8d96e918ac39147fad4d7e82cd788d20eff551
4
+ data.tar.gz: e59d43b74b1c2e01d481a16508b925eb55fbbb3dcd80d8ae8653a865e8f59f5d
5
5
  SHA512:
6
- metadata.gz: 0e7d2d0a230bc1de4396276a7eebf7963e71253214d2f57910f3ff25f1f7ee6979f59c22d5d63874bf4dc6f4f68417710454b1fb8870060a0ad20db2b9c65048
7
- data.tar.gz: e3bdca124e8d17d4452f1a9bfc98c7246c4de6ff8593c579a21849593715e112545bf8a934f4babd8da9332a53aba904f22ec4b20ffc320d6e8b5ca86e256858
6
+ metadata.gz: b078512d2f2597977d369be50649e32c98a832d64884bd60dfc529c3a07cd94e2d884e6d3674f5faa16c29420959ce3ff0e9e5b537abc825cc7639ba56c613c0
7
+ data.tar.gz: effa2edb3ab9460496ee43b464afa64ed0aec01ee4f933062e37b5622b5fa3d22dc3db90bc5e2ae8cc272936b90f9d3e1b217ac3b63115811a7afc8b6affcc74
data/CHANGELOG.md CHANGED
@@ -14,29 +14,40 @@ Read `release_notes.md` for commit level details.
14
14
 
15
15
  ### Enhancements
16
16
 
17
- - Update base selenium webdriver version to `4.0.0`
18
- - Support only W3C spec as following Selenium v4 client
17
+ - Update base selenium webdriver version to `v4`
18
+ - Base Selenium Ruby binding is now v4
19
+ - Support only W3C WebDriver spec (and a few Appium specific commands)
19
20
  - Support Ruby 2.6+
20
- - `element.id` returns the element id instead of `element.ref`. `element.ref` now returns an array.
21
- - Removed `desired_capabilities` as capabilities for `Appium::Core#for`. Please use `capabilities` key name instead
22
- - Removals that already had _duplication_ mark
21
+ - Add `driver#wait`, `driver#wait_until`, `driver#wait_true`, `driver#wait_until_true` syntaxes
22
+ - Can give `driver` instance as its block variable
23
+ - `element.id` returns the element id instead of `element.ref`.
24
+ - `element.ref` now returns an array.
25
+ - Removed `desired_capabilities` as capabilities for `Appium::Core#for`. Please use `capabilities` key name instead.
26
+ - e.g. `Appium::Core.for capabilities: {...}` instead of `Appium::Core.for desired_capabilities: {...}`
27
+ - Removed methods that had _Deprecated_ mark
23
28
  - Removed `driver#screenshot`. Please use `driver#save_screenshot` instead
24
29
  - Removed `driver#send_keys` to send keys to an active element. Please use `driver.action.send_keys('happy testing').perform` instead
25
30
  - Removed `forceMjsonwp` to send only MJSONWP capabilities since Selenium cleint v4 no longer supports MJSONWP
26
- - No longer set default `timeouts` as `0`. ruby_lib_core calls `/timeouts` endpoint only when `appium_lib: { wait: 5 }` is provided explicitly
31
+ - No longer set default `timeouts` as `0`
32
+ - ruby_lib_core calls `/timeouts` endpoint only when `appium_lib: { wait: 5 }` is provided explicitly
27
33
  - Raises `::Appium::Core::Error::ArgumentError` instead of `ArgumentError` for this library specific argument errors
28
- - Add `driver#wait`, `driver#wait_until`, `driver#wait_true`, `driver#wait_until_true` syntaxes
29
- - Can give `driver` instance as its block variable
34
+ - Removed Selendroid related methods
30
35
 
31
36
  ### Deprecations
32
37
  - `Appium::Core::TouchAction` and `Appium::Core::MultiTouch` are deprecated
33
38
  - Please use W3C actions instead http://appium.io/docs/en/commands/interactions/actions/
34
39
  - More working examples:
35
- - test/functional/android/webdriver/w3c_actions_test.rb
36
- - test/functional/ios/webdriver/w3c_actions_test.rb
37
- - test/functional/common_w3c_actions.rb
40
+ - [test/functional/android/webdriver/w3c_actions_test.rb](test/functional/android/webdriver/w3c_actions_test.rb)
41
+ - [test/functional/ios/webdriver/w3c_actions_test.rb](test/functional/ios/webdriver/w3c_actions_test.rb)
42
+ - [test/functional/common_w3c_actions.rb](test/functional/common_w3c_actions.rb)
38
43
  - https://www.selenium.dev/documentation/support_packages/mouse_and_keyboard_actions_in_detail/
39
- - Removed Selendroid related methods
44
+ - https://www.youtube.com/watch?v=oAJ7jwMNFVU
45
+ - https://appiumpro.com/editions/30-ios-specific-touch-action-methods
46
+ - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
47
+ - `launch_app`, `close_app` and `reset`. Please read [issues#15807](https://github.com/appium/appium/issues/15807) for more details.
48
+ - `activate_app` or a new session request can be alternatives of `launch_app`
49
+ - `terminate_app` or close the session request can be alternatives of `close_app`
50
+ - Close current session and creating a new session, or `terminate_app` and `launch_app` can be alternatives of `reset`
40
51
 
41
52
  ## [4.7.1] - 2021-09-26
42
53
 
data/README.md CHANGED
@@ -13,6 +13,10 @@ This library wraps [selenium-webdriver](https://github.com/SeleniumHQ/selenium/w
13
13
  - http://www.rubydoc.info/github/appium/ruby_lib_core
14
14
  - You can find working API examples in test code, [test/functional](test/functional)
15
15
 
16
+ # Migration from v4 to v5
17
+
18
+ Please read `[5.0.0]` section in CHANGELOG.md
19
+
16
20
  # Related library
17
21
  - https://github.com/appium/ruby_lib
18
22
 
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'minitest', '~> 5.0'
32
32
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
33
33
  spec.add_development_dependency 'webmock', '~> 3.14.0'
34
- spec.add_development_dependency 'rubocop', '1.22.2'
34
+ spec.add_development_dependency 'rubocop', '1.22.3'
35
35
  spec.add_development_dependency 'appium_thor', '~> 1.0'
36
36
  spec.add_development_dependency 'pry'
37
37
  spec.add_development_dependency 'pry-byebug'
@@ -52,6 +52,10 @@ module Appium
52
52
  @wait_timeout = opts.delete(:wait_timeout)
53
53
  @wait_interval = opts.delete(:wait_interval)
54
54
 
55
+ # For logging.
56
+ # TODO: Remove when appium core no longer uses this in this bridge.
57
+ @automation_name = opts.delete(:automation_name)
58
+
55
59
  super
56
60
  end
57
61
 
@@ -414,17 +418,9 @@ module Appium
414
418
  alias set_context context=
415
419
 
416
420
  # Place a file in a specific location on the device.
417
- # On iOS, the server should have ifuse libraries installed and configured properly for this feature to work on
418
- # real devices.
419
421
  # On Android, the application under test should be built with debuggable flag enabled in order to get access to
420
422
  # its container on the internal file system.
421
423
  #
422
- # {https://github.com/libimobiledevice/ifuse iFuse GitHub page6}
423
- #
424
- # {https://github.com/osxfuse/osxfuse/wiki/FAQ osxFuse FAQ}
425
- #
426
- # {https://developer.android.com/studio/debug 'Debug Your App' developer article}
427
- #
428
424
  # @param [String] path Either an absolute path OR, for iOS devices, a path relative to the app, as described.
429
425
  # If the path starts with application id prefix, then the file will be pushed to the root of
430
426
  # the corresponding application container.
@@ -441,18 +437,10 @@ module Appium
441
437
  @bridge.push_file(path, filedata)
442
438
  end
443
439
 
444
- # Pull a file from the simulator/device.
445
- # On iOS the server should have ifuse
446
- # libraries installed and configured properly for this feature to work on real devices.
440
+ # Pull a file from the remote device.
447
441
  # On Android the application under test should be built with debuggable flag enabled in order to get access
448
442
  # to its container on the internal file system.
449
443
  #
450
- # {https://github.com/libimobiledevice/ifuse iFuse GitHub page6}
451
- #
452
- # {https://github.com/osxfuse/osxfuse/wiki/FAQ osxFuse FAQ}
453
- #
454
- # {https://developer.android.com/studio/debug 'Debug Your App' developer article}
455
- #
456
444
  # @param [String] path Either an absolute path OR, for iOS devices, a path relative to the app, as described.
457
445
  # If the path starts with application id prefix, then the file will be pulled from the root
458
446
  # of the corresponding application container.
@@ -461,7 +449,6 @@ module Appium
461
449
  # Only pulling files from application containers is supported for iOS Simulator.
462
450
  # Provide the remote path in format
463
451
  # <code>@bundle.identifier:container_type/relative_path_in_container</code>
464
- # (Make sure this in ifuse doc)
465
452
  #
466
453
  # @return [Base64-decoded] Base64 decoded data
467
454
  #
@@ -478,18 +465,10 @@ module Appium
478
465
  @bridge.pull_file(path)
479
466
  end
480
467
 
481
- # Pull a folder content from the simulator/device.
482
- # On iOS the server should have ifuse libraries installed and configured properly for this feature to work
483
- # on real devices.
468
+ # Pull a folder content from the remote device.
484
469
  # On Android the application under test should be built with debuggable flag enabled in order to get access to
485
470
  # its container on the internal file system.
486
471
  #
487
- # {https://github.com/libimobiledevice/ifuse iFuse GitHub page6}
488
- #
489
- # {https://github.com/osxfuse/osxfuse/wiki/FAQ osxFuse FAQ}
490
- #
491
- # {https://developer.android.com/studio/debug 'Debug Your App' developer article}
492
- #
493
472
  # @param [String] path Absolute path to the folder.
494
473
  # If the path starts with <em>@applicationId/</em> prefix, then the folder will be pulled
495
474
  # from the root of the corresponding application container.
@@ -498,7 +477,6 @@ module Appium
498
477
  # Only pulling files from application containers is supported for iOS Simulator.
499
478
  # Provide the remote path in format
500
479
  # <code>@bundle.identifier:container_type/relative_path_in_container</code>
501
- # (Make sure this in ifuse doc)
502
480
  #
503
481
  # @return [Base64-decoded] Base64 decoded data which is zip archived
504
482
  #
@@ -556,6 +534,7 @@ module Appium
556
534
  @bridge.long_press_keycode(key, metastate: metastate, flags: flags)
557
535
  end
558
536
 
537
+ # @deprecated Except for Windows
559
538
  # Start the simulator and application configured with desired capabilities
560
539
  #
561
540
  # @example
@@ -563,9 +542,16 @@ module Appium
563
542
  # @driver.launch_app
564
543
  #
565
544
  def launch_app
545
+ # TODO: Define only in Windows module when ruby_lib_core removes this method
546
+ if @automation_name != :windows
547
+ ::Appium::Logger.warn(
548
+ '[DEPRECATION] launch_app is deprecated. Please use activate_app instead.'
549
+ )
550
+ end
566
551
  @bridge.launch_app
567
552
  end
568
553
 
554
+ # @deprecated Except for Windows
569
555
  # Close an app on device
570
556
  #
571
557
  # @example
@@ -573,9 +559,16 @@ module Appium
573
559
  # @driver.close_app
574
560
  #
575
561
  def close_app
562
+ # TODO: Define only in Windows module when ruby_lib_core removes this method
563
+ if @automation_name != :windows
564
+ ::Appium::Logger.warn(
565
+ '[DEPRECATION] close_app is deprecated. Please use terminate_app instead.'
566
+ )
567
+ end
576
568
  @bridge.close_app
577
569
  end
578
570
 
571
+ # @deprecated
579
572
  # Reset the device, relaunching the application.
580
573
  #
581
574
  # @example
@@ -583,6 +576,10 @@ module Appium
583
576
  # @driver.reset
584
577
  #
585
578
  def reset
579
+ ::Appium::Logger.warn(
580
+ '[DEPRECATION] reset is deprecated. Please use terminate_app and activate_app, ' \
581
+ 'or quit and create a new session instead.'
582
+ )
586
583
  @bridge.reset
587
584
  end
588
585
 
@@ -800,7 +797,7 @@ module Appium
800
797
  #
801
798
  # @example: Zoom
802
799
  #
803
- # f1 = @driver.action.add_pointer_input(:touch, 'finger1')
800
+ # f1 = ::Selenium::WebDriver::Interactions.pointer(:touch, name: 'finger1')
804
801
  # f1.create_pointer_move(duration: 1, x: 200, y: 500,
805
802
  # origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
806
803
  # f1.create_pointer_down(:left)
@@ -808,7 +805,7 @@ module Appium
808
805
  # origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
809
806
  # f1.create_pointer_up(:left)
810
807
  #
811
- # f2 = @driver.action.add_pointer_input(:touch, 'finger2')
808
+ # f2 = ::Selenium::WebDriver::Interactions.pointer(:touch, name: 'finger2')
812
809
  # f2.create_pointer_move(duration: 1, x: 200, y: 500,
813
810
  # origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
814
811
  # f2.create_pointer_down(:left)
@@ -821,6 +818,10 @@ module Appium
821
818
  def perform_actions(data)
822
819
  raise ::Appium::Core::Error::ArgumentError, "'#{data}' must be Array" unless data.is_a? Array
823
820
 
821
+ # NOTE: 'add_input' in Selenium Ruby implementation has additional 'pause'.
822
+ # This implementation is to avoid the additional pause.
823
+ # https://github.com/SeleniumHQ/selenium/blob/64447d4b03f6986337d1ca8d8b6476653570bcc1/rb/lib/selenium/webdriver/common/action_builder.rb#L207
824
+
824
825
  @bridge.send_actions data.map(&:encode).compact
825
826
  data.each(&:clear_actions)
826
827
  nil
@@ -32,6 +32,7 @@ module Appium
32
32
  predicate: '-ios predicate string',
33
33
  class_chain: '-ios class chain',
34
34
  # Windows with windows prefix
35
+ # @deprecated
35
36
  windows_uiautomation: '-windows uiautomation',
36
37
  # Tizen with Tizen prefix
37
38
  tizen_uiautomation: '-tizen uiautomation'
@@ -122,6 +123,7 @@ module Appium
122
123
  # e.tag_name #=> "XCUIElementTypeStaticText"
123
124
  #
124
125
  # # For Windows
126
+ # # @deprecated
125
127
  # @driver.find_elements :windows_uiautomation, '....'
126
128
  #
127
129
  # # For Tizen
@@ -158,6 +160,12 @@ module Appium
158
160
  private
159
161
 
160
162
  def _set_by_from_finders(how)
163
+ if how == :windows_uiautomation
164
+ ::Appium::Logger.warn(
165
+ '[DEPRECATION] :windows_uiautomation is deprecated. Please use other locators.'
166
+ )
167
+ end
168
+
161
169
  by = FINDERS[how.to_sym]
162
170
  unless by
163
171
  raise ::Appium::Core::Error::ArgumentError,
@@ -24,6 +24,18 @@ module Appium
24
24
  # add to a new MultiTouch action. When ready, call +prepare()+ and all
25
25
  # actions will be executed simultaneously.
26
26
  #
27
+ # Consider to use W3C spec touch action like the followings.
28
+ # https://www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/PointerActions.html
29
+ # https://github.com/appium/ruby_lib_core/blob/master/test/functional/android/webdriver/w3c_actions_test.rb
30
+ # https://github.com/appium/ruby_lib_core/blob/master/test/functional/ios/webdriver/w3c_actions_test.rb
31
+ #
32
+ # About W3C actions
33
+ # https://www.youtube.com/watch?v=oAJ7jwMNFVU
34
+ # https://appiumpro.com/editions/30-ios-specific-touch-action-methods
35
+ # https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
36
+ #
37
+ # Functional test code in ruby_lib_core repository also helps.
38
+ #
27
39
  # @example
28
40
  #
29
41
  # @driver = Appium::Core.for(opts).start_driver
@@ -27,6 +27,13 @@ module Appium
27
27
  # https://github.com/appium/ruby_lib_core/blob/master/test/functional/android/webdriver/w3c_actions_test.rb
28
28
  # https://github.com/appium/ruby_lib_core/blob/master/test/functional/ios/webdriver/w3c_actions_test.rb
29
29
  #
30
+ # About W3C actions
31
+ # https://www.youtube.com/watch?v=oAJ7jwMNFVU
32
+ # https://appiumpro.com/editions/30-ios-specific-touch-action-methods
33
+ # https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
34
+ #
35
+ # Functional test code in ruby_lib_core repository also helps.
36
+ #
30
37
  # @example
31
38
  #
32
39
  # @driver = Appium::Core.for(opts).start_driver
@@ -320,7 +320,7 @@ module Appium
320
320
  #
321
321
  # # Start iOS driver
322
322
  # opts = {
323
- # caps: {
323
+ # capabilities: {
324
324
  # platformName: :ios,
325
325
  # platformVersion: '11.0',
326
326
  # deviceName: 'iPhone Simulator',
@@ -366,7 +366,8 @@ module Appium
366
366
  capabilities: @caps, # ::Selenium::WebDriver::Remote::Capabilities
367
367
  url: @custom_url,
368
368
  wait_timeout: @wait_timeout,
369
- wait_interval: @wait_interval)
369
+ wait_interval: @wait_interval,
370
+ automation_name: @automation_name)
370
371
 
371
372
  if @direct_connect
372
373
  d_c = DirectConnections.new(@driver.capabilities)
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '5.0.0.rc7' unless defined? ::Appium::Core::VERSION
18
- DATE = '2021-10-26' unless defined? ::Appium::Core::DATE
17
+ VERSION = '5.0.0.rc8' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2021-11-01' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.rc7
4
+ version: 5.0.0.rc8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-26 00:00:00.000000000 Z
11
+ date: 2021-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 1.22.2
131
+ version: 1.22.3
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 1.22.2
138
+ version: 1.22.3
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: appium_thor
141
141
  requirement: !ruby/object:Gem::Requirement