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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +2 -2
- data/lib/appium_lib_core/common/base/driver.rb +1 -1
- data/lib/appium_lib_core/common/base/search_context.rb +106 -98
- data/lib/appium_lib_core/element.rb +1 -1
- data/lib/appium_lib_core/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65d659dce3980c45c306b4e6e2da0f9e089428b2de1bd881bf8a276f37e66900
|
4
|
+
data.tar.gz: 6d8e9e621366cef67cbd8e40ddbe8e1a79eb0e191cb5295bdd19e583dfc770fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbd3f5b0aa25fbb1ca35ef4002a1a49470a329bcab6d0ea12c01679cb3ee8834f41f33b702fa31caaa44e80236b8e6cd2d07c74c3dec54711a1b68a128243475
|
7
|
+
data.tar.gz: bbab7740cde1fd3995a1c55dcf46ff8452f1db4286b595995c0840a3a81947acc7245b97a1bd2667ca514b5b52466f1fbdb1b4e1ba9d58c00f9eef8d35903615
|
data/CHANGELOG.md
CHANGED
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.
|
11
|
+
gem 'rubocop', '1.71.0'
|
12
12
|
gem 'simplecov'
|
13
|
-
gem 'steep', '~> 1.
|
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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
# {https://github.com/
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
# @overload find_element(
|
53
|
-
# @param [
|
54
|
-
# @
|
55
|
-
#
|
56
|
-
# @
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
# # with
|
65
|
-
# @driver.find_elements :
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
# @driver.find_elements :
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
# @driver.find_elements :
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
# @driver.find_elements :
|
85
|
-
#
|
86
|
-
#
|
87
|
-
# ### select the
|
88
|
-
# @driver.find_elements :class_chain, 'XCUIElementTypeWindow
|
89
|
-
# ###
|
90
|
-
# @driver.find_elements :class_chain, 'XCUIElementTypeWindow
|
91
|
-
# ###
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
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
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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.
|
18
|
-
DATE = '2025-01-
|
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.
|
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-
|
11
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faye-websocket
|