appium_lib 9.5.0 → 9.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/docs/android_docs.md +512 -287
- data/docs/ios_docs.md +906 -315
- data/docs/ios_xcuitest.md +4 -0
- data/lib/appium_lib/android/device.rb +39 -0
- data/lib/appium_lib/android/element/button.rb +36 -65
- data/lib/appium_lib/android/element/generic.rb +20 -12
- data/lib/appium_lib/android/helper.rb +4 -16
- data/lib/appium_lib/android/uiautomator2/element/button.rb +110 -0
- data/lib/appium_lib/android/uiautomator2/helper.rb +85 -0
- data/lib/appium_lib/common/command.rb +9 -1
- data/lib/appium_lib/common/helper.rb +5 -4
- data/lib/appium_lib/common/patch.rb +21 -5
- data/lib/appium_lib/common/version.rb +2 -2
- data/lib/appium_lib/common/wait.rb +1 -0
- data/lib/appium_lib/device/device.rb +13 -23
- data/lib/appium_lib/device/multi_touch.rb +60 -20
- data/lib/appium_lib/device/touch_actions.rb +17 -8
- data/lib/appium_lib/driver.rb +79 -19
- data/lib/appium_lib/ios/element/button.rb +5 -25
- data/lib/appium_lib/ios/element/generic.rb +4 -22
- data/lib/appium_lib/ios/element/text.rb +5 -25
- data/lib/appium_lib/ios/element/textfield.rb +31 -78
- data/lib/appium_lib/ios/helper.rb +11 -74
- data/lib/appium_lib/ios/mobile_methods.rb +0 -20
- data/lib/appium_lib/ios/patch.rb +2 -6
- data/lib/appium_lib/ios/xcuitest/device.rb +59 -0
- data/lib/appium_lib/ios/xcuitest/element.rb +24 -0
- data/lib/appium_lib/ios/xcuitest/element/button.rb +64 -0
- data/lib/appium_lib/ios/xcuitest/element/generic.rb +50 -0
- data/lib/appium_lib/ios/xcuitest/element/text.rb +61 -0
- data/lib/appium_lib/ios/xcuitest/element/textfield.rb +94 -0
- data/lib/appium_lib/ios/{xcuitest_gestures.rb → xcuitest/gestures.rb} +10 -23
- data/lib/appium_lib/ios/xcuitest/helper.rb +103 -0
- data/lib/appium_lib/ios/xcuitest/mobile_methods.rb +23 -0
- data/release_notes.md +6 -0
- metadata +14 -3
@@ -0,0 +1,103 @@
|
|
1
|
+
module Appium
|
2
|
+
module Ios
|
3
|
+
module Xcuitest
|
4
|
+
module Helper
|
5
|
+
# Return the iOS version as an array of integers
|
6
|
+
# @return [Array<Integer>]
|
7
|
+
def ios_version
|
8
|
+
@driver.capabilities['platformVersion']
|
9
|
+
end
|
10
|
+
|
11
|
+
# @private
|
12
|
+
def string_attr_exact(class_name, attr, value)
|
13
|
+
if attr == '*'
|
14
|
+
%((//#{class_name})[@*[.="#{value}"]])
|
15
|
+
else
|
16
|
+
%((//#{class_name})[@#{attr}="#{value}"])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# @private
|
21
|
+
def string_attr_include(class_name, attr, value)
|
22
|
+
if attr == '*'
|
23
|
+
%((//#{class_name})[@*[contains(translate(., "#{value.upcase}", "#{value}"), "#{value}")]])
|
24
|
+
else
|
25
|
+
%((//#{class_name})[contains(translate(@#{attr}, "#{value.upcase}", "#{value}"), "#{value}")])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get the last tag that matches class_name
|
30
|
+
# @param class_name [String] the tag to match
|
31
|
+
# @return [Element]
|
32
|
+
def last_ele(class_name)
|
33
|
+
visible_elements = tags class_name
|
34
|
+
raise _no_such_element if visible_elements.empty?
|
35
|
+
visible_elements.last
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns the first **visible** element matching class_name
|
39
|
+
#
|
40
|
+
# @param class_name [String] the class_name to search for
|
41
|
+
# @return [Element]
|
42
|
+
def tag(class_name)
|
43
|
+
raise_error_if_no_element tags(class_name).first
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns all visible elements matching class_name
|
47
|
+
#
|
48
|
+
# @param class_name [String] the class_name to search for
|
49
|
+
# @return [Element]
|
50
|
+
def tags(class_name)
|
51
|
+
elements = @driver.find_elements :class, class_name
|
52
|
+
select_visible_elements elements
|
53
|
+
end
|
54
|
+
|
55
|
+
# Returns all visible elements matching class_names and value
|
56
|
+
# This method calls find_element/s and element.value/text many times.
|
57
|
+
# So, if you set many class_names, this method's performance become worse.
|
58
|
+
#
|
59
|
+
# @param class_names [Array[String]] the class_names to search for
|
60
|
+
# @param value [String] the value to search for
|
61
|
+
# @return [Array[Element]]
|
62
|
+
def tags_include(class_names:, value: nil)
|
63
|
+
return unless class_names.is_a? Array
|
64
|
+
|
65
|
+
c_names = class_names.map { |class_name| %(type == "#{class_name}") }.join(' || ')
|
66
|
+
|
67
|
+
predicate = if value
|
68
|
+
%((#{c_names}) && ) +
|
69
|
+
%((name contains[c] "#{value}" || label contains[c] "#{value}" || value contains[c] "#{value}"))
|
70
|
+
else
|
71
|
+
c_names
|
72
|
+
end
|
73
|
+
|
74
|
+
elements = @driver.find_elements :predicate, predicate
|
75
|
+
select_visible_elements elements
|
76
|
+
end
|
77
|
+
|
78
|
+
# Returns all visible elements matching class_names and value.
|
79
|
+
# This method calls find_element/s and element.value/text many times.
|
80
|
+
# So, if you set many class_names, this method's performance become worse.
|
81
|
+
#
|
82
|
+
# @param class_names [Array[String]] the class_names to search for
|
83
|
+
# @param value [String] the value to search for
|
84
|
+
# @return [Array[Element]]
|
85
|
+
def tags_exact(class_names:, value: nil)
|
86
|
+
return unless class_names.is_a? Array
|
87
|
+
|
88
|
+
c_names = class_names.map { |class_name| %(type == "#{class_name}") }.join(' || ')
|
89
|
+
|
90
|
+
predicate = if value
|
91
|
+
%((#{c_names}) && ) +
|
92
|
+
%((name ==[c] "#{value}" || label ==[c] "#{value}" || value ==[c] "#{value}"))
|
93
|
+
else
|
94
|
+
c_names
|
95
|
+
end
|
96
|
+
|
97
|
+
elements = @driver.find_elements :predicate, predicate
|
98
|
+
select_visible_elements elements
|
99
|
+
end
|
100
|
+
end # module Helper
|
101
|
+
end # module Xcuitest
|
102
|
+
end # module Ios
|
103
|
+
end # module Appium
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Appium
|
2
|
+
module Ios
|
3
|
+
module Xcuitest
|
4
|
+
class << self
|
5
|
+
# @!method ios_class_chain_find
|
6
|
+
# Only for XCUITest(WebDriverAgent)
|
7
|
+
# find_element/s can be used with a [class chain]( https://github.com/facebook/WebDriverAgent/wiki/Queries)
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# # select the third child button of the first child window element
|
11
|
+
# find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'
|
12
|
+
# # select all the children windows
|
13
|
+
# find_elements :class_chain, 'XCUIElementTypeWindow'
|
14
|
+
# # select the second last child of the second child window
|
15
|
+
# find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'
|
16
|
+
# ```
|
17
|
+
def extended(_mod)
|
18
|
+
::Appium::Driver::SearchContext::FINDERS[:class_chain] = '-ios class chain'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end # module Ios
|
23
|
+
end # module Appium
|
data/release_notes.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
#### v9.5.0 2017-08-05
|
2
|
+
|
3
|
+
- [19177f5](https://github.com/appium/ruby_lib/commit/19177f5348300a0e2e1e0510b99efac2f3067201) [Release 9 5 0 (#628)](https://github.com/appium/ruby_lib/issues/628)
|
4
|
+
- [4219f1d](https://github.com/appium/ruby_lib/commit/4219f1d3f639a421bc4fc6a772c242d782357ae1) [feature: support selenium-webdriver3.4.1+ (#627)](https://github.com/appium/ruby_lib/issues/627)
|
5
|
+
|
6
|
+
|
1
7
|
#### v9.4.10 2017-07-30
|
2
8
|
|
3
9
|
- [6eae1b6](https://github.com/appium/ruby_lib/commit/6eae1b6412ba8dc6c967a44dd9a987944c8e6444) [Release 9 4 10 (#626)](https://github.com/appium/ruby_lib/issues/626)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- code@bootstraponline.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
@@ -254,6 +254,7 @@ files:
|
|
254
254
|
- docs_gen/make_docs.rb
|
255
255
|
- lib/appium_lib.rb
|
256
256
|
- lib/appium_lib/android/client_xpath.rb
|
257
|
+
- lib/appium_lib/android/device.rb
|
257
258
|
- lib/appium_lib/android/element/alert.rb
|
258
259
|
- lib/appium_lib/android/element/button.rb
|
259
260
|
- lib/appium_lib/android/element/generic.rb
|
@@ -262,6 +263,8 @@ files:
|
|
262
263
|
- lib/appium_lib/android/helper.rb
|
263
264
|
- lib/appium_lib/android/mobile_methods.rb
|
264
265
|
- lib/appium_lib/android/patch.rb
|
266
|
+
- lib/appium_lib/android/uiautomator2/element/button.rb
|
267
|
+
- lib/appium_lib/android/uiautomator2/helper.rb
|
265
268
|
- lib/appium_lib/common/command.rb
|
266
269
|
- lib/appium_lib/common/element/window.rb
|
267
270
|
- lib/appium_lib/common/error.rb
|
@@ -283,7 +286,15 @@ files:
|
|
283
286
|
- lib/appium_lib/ios/helper.rb
|
284
287
|
- lib/appium_lib/ios/mobile_methods.rb
|
285
288
|
- lib/appium_lib/ios/patch.rb
|
286
|
-
- lib/appium_lib/ios/
|
289
|
+
- lib/appium_lib/ios/xcuitest/device.rb
|
290
|
+
- lib/appium_lib/ios/xcuitest/element.rb
|
291
|
+
- lib/appium_lib/ios/xcuitest/element/button.rb
|
292
|
+
- lib/appium_lib/ios/xcuitest/element/generic.rb
|
293
|
+
- lib/appium_lib/ios/xcuitest/element/text.rb
|
294
|
+
- lib/appium_lib/ios/xcuitest/element/textfield.rb
|
295
|
+
- lib/appium_lib/ios/xcuitest/gestures.rb
|
296
|
+
- lib/appium_lib/ios/xcuitest/helper.rb
|
297
|
+
- lib/appium_lib/ios/xcuitest/mobile_methods.rb
|
287
298
|
- lib/appium_lib/logger.rb
|
288
299
|
- readme.md
|
289
300
|
- release_notes.md
|