appium_lib_core 9.5.0 → 9.5.1

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: ea30fede68f949ef19f33b37f70440a990b39928b718b6c636cd8c361170fdc1
4
- data.tar.gz: 63946e1befb597ba88d01437ca4267cb065593db644ab6c260228aff2aa9d7cf
3
+ metadata.gz: 65d659dce3980c45c306b4e6e2da0f9e089428b2de1bd881bf8a276f37e66900
4
+ data.tar.gz: 6d8e9e621366cef67cbd8e40ddbe8e1a79eb0e191cb5295bdd19e583dfc770fa
5
5
  SHA512:
6
- metadata.gz: 74ae97cd7c049ab123dfa4bd0ad4b87bae763a3e2abe1a05cfef2c670a4d0d27c963d314ed3a5cbd2531552ffa71a753076f290d6d3824a07a13cf743a120740
7
- data.tar.gz: 844478fe643b07e014baae5bfab9dc2a496626ba44b6dea63017b0f1c33b3bec254cd05944d3fa73cb6fa60a51c4995aabf1af923dbf65d832418b2e015158d5
6
+ metadata.gz: fbd3f5b0aa25fbb1ca35ef4002a1a49470a329bcab6d0ea12c01679cb3ee8834f41f33b702fa31caaa44e80236b8e6cd2d07c74c3dec54711a1b68a128243475
7
+ data.tar.gz: bbab7740cde1fd3995a1c55dcf46ff8452f1db4286b595995c0840a3a81947acc7245b97a1bd2667ca514b5b52466f1fbdb1b4e1ba9d58c00f9eef8d35903615
data/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [9.5.1] - 2025-01-29
14
+
15
+ ### Enhancements
16
+ - Added a module to search context to improve documentation
17
+
18
+
13
19
  ## [9.5.0] - 2025-01-22
14
20
 
15
21
  ### Deprecations
data/Gemfile CHANGED
@@ -8,8 +8,8 @@ gem 'minitest', '~> 5.0'
8
8
  gem 'minitest-reporters', '~> 1.1'
9
9
  gem 'parallel_tests'
10
10
  gem 'rake', '~> 13.0'
11
- gem 'rubocop', '1.70.0'
11
+ gem 'rubocop', '1.71.0'
12
12
  gem 'simplecov'
13
- gem 'steep', '~> 1.7.0'
13
+ gem 'steep', '~> 1.9.3'
14
14
  gem 'webmock', '~> 3.24.0'
15
15
  gem 'yard', '~> 0.9.11'
@@ -39,7 +39,7 @@ module Appium
39
39
 
40
40
  include ::Appium::Core::Waitable
41
41
 
42
- ::Selenium::WebDriver::SearchContext.extra_finders = APPIUM_EXTRA_FINDERS
42
+ ::Selenium::WebDriver::SearchContext.extra_finders = ::Appium::Core::Base::SearchContext::APPIUM_EXTRA_FINDERS
43
43
 
44
44
  # Private API.
45
45
  # Do not use this for general use. Used by flutter driver to get bridge for creating a new element
@@ -12,102 +12,110 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- # rubocop:disable Layout/LineLength
16
- #
17
- # Find the first element matching the given arguments
18
- #
19
- # - Android can find with uiautomator like a {http://developer.android.com/tools/help/uiautomator/UiSelector.html UISelector}.
20
- # - iOS can find with a {https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAWindowClassReference/UIAWindow/UIAWindow.html#//apple_ref/doc/uid/TP40009930 UIAutomation command}.
21
- # - iOS, only for XCUITest(WebDriverAgent), can find with a {https://github.com/facebook/WebDriverAgent/wiki/Queries class chain}
22
- #
23
- # == Find with image
24
- # Return an element if current view has a partial image. The logic depends on template matching by OpenCV.
25
- # {https://github.com/appium/appium/blob/1.x/docs/en/writing-running-appium/image-comparison.md image-comparison}
26
- #
27
- # You can handle settings for the comparision following {https://github.com/appium/appium-base-driver/blob/master/lib/basedriver/device-settings.js#L6 here}
28
- #
29
- # == Espresso viewmatcher and datamatcher
30
- # Espresso has {https://developer.android.com/training/testing/espresso/basics _onView_ matcher}
31
- # and {https://medium.com/androiddevelopers/adapterviews-and-espresso-f4172aa853cf _onData_ matcher} for more reference
32
- # that allows you to target adapters instead of Views. This method find methods based on reflections
33
- #
34
- # This is a selector strategy that allows users to pass a selector of the form:
35
- #
36
- # <code>{ name: '<name>', args: ['arg1', 'arg2', '...'], class: '<optional class>' }</code>
37
- #
38
- # - _name_: The name of a method to invoke. The method must return
39
- # a Hamcrest {http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html Matcher}
40
- # - _args_: The args provided to the method
41
- # - _class_: The class name that the method is part of (defaults to <code>org.hamcrest.Matchers</code>).
42
- # Can be fully qualified, or simple, and simple defaults to <code>androidx.test.espresso.matcher</code> package
43
- # (e.g.: <code>class=CursorMatchers</code> fully qualified is <code>class=androidx.test.espresso.matcher.CursorMatchers</code>
44
- #
45
- # See example how to send viewmatcher and datamatcher in Ruby client
46
- #
47
- #
48
- # @overload find_element(how, what)
49
- # @param [Symbol, String] how The method to find the element by
50
- # @param [String] what The locator to use
51
- #
52
- # @overload find_element(opts)
53
- # @param [Hash] opts Find options
54
- # @option opts [Symbol] :how Key named after the method to find the element by, containing the locator
55
- # @return [Element]
56
- # @raise [Error::NoSuchElementError] if the element doesn't exist
57
- #
58
- # @example Find element with each keys
59
- #
60
- # # with accessibility id. All platforms.
61
- # @driver.find_elements :accessibility_id, 'Animation'
62
- # @driver.find_elements :accessibility_id, 'Animation'
63
- #
64
- # # with base64 encoded template image. All platforms.
65
- # @driver.find_elements :image, Base64.strict_encode64(File.read(file_path))
66
- #
67
- # # For Android
68
- # ## With uiautomator
69
- # @driver.find_elements :uiautomator, 'new UiSelector().clickable(true)'
70
- # ## With viewtag, but only for Espresso
71
- # ## 'setTag'/'getTag' in https://developer.android.com/reference/android/view/View
72
- # @driver.find_elements :viewtag, 'new UiSelector().clickable(true)'
73
- # # With data_matcher. The argument should be JSON format.
74
- # @driver.find_elements :data_matcher, { name: 'hasEntry', args: %w(title Animation) }.to_json
75
- #
76
- # # For iOS
77
- # ## With :predicate
78
- # @driver.find_elements :predicate, "isWDVisible == 1"
79
- # @driver.find_elements :predicate, 'wdName == "Buttons"'
80
- # @driver.find_elements :predicate, 'wdValue == "SearchBar" AND isWDDivisible == 1'
81
- #
82
- # ## With Class Chain
83
- # ### select the third child button of the first child window element
84
- # @driver.find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'
85
- # ### select all the children windows
86
- # @driver.find_elements :class_chain, 'XCUIElementTypeWindow'
87
- # ### select the second last child of the second child window
88
- # @driver.find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'
89
- # ### matching predicate. <code>'</code> is the mark.
90
- # @driver.find_elements :class_chain, 'XCUIElementTypeWindow['visible = 1]['name = "bla"']'
91
- # ### containing predicate. '$' is the mark.
92
- # ### Require appium-xcuitest-driver 2.54.0+. PR: https://github.com/facebook/WebDriverAgent/pull/707/files
93
- # @driver.find_elements :class_chain, 'XCUIElementTypeWindow[$name = \"bla$$$bla\"$]'
94
- # e = find_element :class_chain, "**/XCUIElementTypeWindow[$name == 'Buttons'$]"
95
- # e.tag_name #=> "XCUIElementTypeWindow"
96
- # e = find_element :class_chain, "**/XCUIElementTypeStaticText[$name == 'Buttons'$]"
97
- # e.tag_name #=> "XCUIElementTypeStaticText"
98
- #
99
- # rubocop:enable Layout/LineLength
15
+ module Appium
16
+ module Core
17
+ class Base
18
+ module SearchContext
19
+ # rubocop:disable Layout/LineLength
20
+ #
21
+ # Find the first element matching the given arguments
22
+ #
23
+ # - Android can find with uiautomator like a {http://developer.android.com/tools/help/uiautomator/UiSelector.html UISelector}.
24
+ # - iOS can find with a {https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAWindowClassReference/UIAWindow/UIAWindow.html#//apple_ref/doc/uid/TP40009930 UIAutomation command}.
25
+ # - iOS, only for XCUITest(WebDriverAgent), can find with a {https://github.com/facebook/WebDriverAgent/wiki/Queries class chain}
26
+ #
27
+ # == Find with image
28
+ # Return an element if current view has a partial image. The logic depends on template matching by OpenCV.
29
+ # {https://github.com/appium/appium/blob/1.x/docs/en/writing-running-appium/image-comparison.md image-comparison}
30
+ #
31
+ # You can handle settings for the comparision following {https://github.com/appium/appium-base-driver/blob/master/lib/basedriver/device-settings.js#L6 here}
32
+ #
33
+ # == Espresso viewmatcher and datamatcher
34
+ # Espresso has {https://developer.android.com/training/testing/espresso/basics _onView_ matcher}
35
+ # and {https://medium.com/androiddevelopers/adapterviews-and-espresso-f4172aa853cf _onData_ matcher} for more reference
36
+ # that allows you to target adapters instead of Views. This method find methods based on reflections
37
+ #
38
+ # This is a selector strategy that allows users to pass a selector of the form:
39
+ #
40
+ # <code>{ name: '<name>', args: ['arg1', 'arg2', '...'], class: '<optional class>' }</code>
41
+ #
42
+ # - _name_: The name of a method to invoke. The method must return
43
+ # a Hamcrest {http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html Matcher}
44
+ # - _args_: The args provided to the method
45
+ # - _class_: The class name that the method is part of (defaults to <code>org.hamcrest.Matchers</code>).
46
+ # Can be fully qualified, or simple, and simple defaults to <code>androidx.test.espresso.matcher</code> package
47
+ # (e.g.: <code>class=CursorMatchers</code> fully qualified is <code>class=androidx.test.espresso.matcher.CursorMatchers</code>
48
+ #
49
+ # See example how to send viewmatcher and datamatcher in Ruby client
50
+ #
51
+ #
52
+ # @overload find_element(how, what)
53
+ # @param [Symbol, String] how The method to find the element by
54
+ # @param [String] what The locator to use
55
+ #
56
+ # @overload find_element(opts)
57
+ # @param [Hash] opts Find options
58
+ # @option opts [Symbol] :how Key named after the method to find the element by, containing the locator
59
+ # @return [Element]
60
+ # @raise [Error::NoSuchElementError] if the element doesn't exist
61
+ #
62
+ # @example Find element with each keys
63
+ #
64
+ # # with accessibility id. All platforms.
65
+ # @driver.find_elements :accessibility_id, 'Animation'
66
+ # @driver.find_elements :accessibility_id, 'Animation'
67
+ #
68
+ # # with base64 encoded template image. All platforms.
69
+ # @driver.find_elements :image, Base64.strict_encode64(File.read(file_path))
70
+ #
71
+ # # For Android
72
+ # ## With uiautomator
73
+ # @driver.find_elements :uiautomator, 'new UiSelector().clickable(true)'
74
+ # ## With viewtag, but only for Espresso
75
+ # ## 'setTag'/'getTag' in https://developer.android.com/reference/android/view/View
76
+ # @driver.find_elements :viewtag, 'new UiSelector().clickable(true)'
77
+ # # With data_matcher. The argument should be JSON format.
78
+ # @driver.find_elements :data_matcher, { name: 'hasEntry', args: %w(title Animation) }.to_json
79
+ #
80
+ # # For iOS
81
+ # ## With :predicate
82
+ # @driver.find_elements :predicate, "isWDVisible == 1"
83
+ # @driver.find_elements :predicate, 'wdName == "Buttons"'
84
+ # @driver.find_elements :predicate, 'wdValue == "SearchBar" AND isWDDivisible == 1'
85
+ #
86
+ # ## With Class Chain
87
+ # ### select the third child button of the first child window element
88
+ # @driver.find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'
89
+ # ### select all the children windows
90
+ # @driver.find_elements :class_chain, 'XCUIElementTypeWindow'
91
+ # ### select the second last child of the second child window
92
+ # @driver.find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'
93
+ # ### matching predicate. <code>'</code> is the mark.
94
+ # @driver.find_elements :class_chain, 'XCUIElementTypeWindow['visible = 1]['name = "bla"']'
95
+ # ### containing predicate. '$' is the mark.
96
+ # ### Require appium-xcuitest-driver 2.54.0+. PR: https://github.com/facebook/WebDriverAgent/pull/707/files
97
+ # @driver.find_elements :class_chain, 'XCUIElementTypeWindow[$name = \"bla$$$bla\"$]'
98
+ # e = find_element :class_chain, "**/XCUIElementTypeWindow[$name == 'Buttons'$]"
99
+ # e.tag_name #=> "XCUIElementTypeWindow"
100
+ # e = find_element :class_chain, "**/XCUIElementTypeStaticText[$name == 'Buttons'$]"
101
+ # e.tag_name #=> "XCUIElementTypeStaticText"
102
+ #
103
+ # rubocop:enable Layout/LineLength
100
104
 
101
- APPIUM_EXTRA_FINDERS = {
102
- accessibility_id: 'accessibility id',
103
- image: '-image',
104
- custom: '-custom',
105
- # Android
106
- uiautomator: '-android uiautomator', # Unavailable in Espresso
107
- viewtag: '-android viewtag', # Available in Espresso
108
- data_matcher: '-android datamatcher', # Available in Espresso
109
- view_matcher: '-android viewmatcher', # Available in Espresso
110
- # iOS
111
- predicate: '-ios predicate string',
112
- class_chain: '-ios class chain'
113
- }.freeze
105
+ APPIUM_EXTRA_FINDERS = {
106
+ accessibility_id: 'accessibility id',
107
+ image: '-image',
108
+ custom: '-custom',
109
+ # Android
110
+ uiautomator: '-android uiautomator', # Unavailable in Espresso
111
+ viewtag: '-android viewtag', # Available in Espresso
112
+ data_matcher: '-android datamatcher', # Available in Espresso
113
+ view_matcher: '-android viewmatcher', # Available in Espresso
114
+ # iOS
115
+ predicate: '-ios predicate string',
116
+ class_chain: '-ios class chain'
117
+ }.freeze
118
+ end
119
+ end
120
+ end
121
+ end
@@ -19,7 +19,7 @@ module Appium
19
19
  class Element < ::Selenium::WebDriver::Element
20
20
  include ::Appium::Core::Base::TakesScreenshot
21
21
 
22
- ::Selenium::WebDriver::SearchContext.extra_finders = APPIUM_EXTRA_FINDERS
22
+ ::Selenium::WebDriver::SearchContext.extra_finders = ::Appium::Core::Base::SearchContext::APPIUM_EXTRA_FINDERS
23
23
 
24
24
  # Retuns the element id.
25
25
  #
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '9.5.0' unless defined? ::Appium::Core::VERSION
18
- DATE = '2025-01-22' unless defined? ::Appium::Core::DATE
17
+ VERSION = '9.5.1' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2025-01-29' 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: 9.5.0
4
+ version: 9.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-22 00:00:00.000000000 Z
11
+ date: 2025-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket