appium_lib 9.11.1 → 9.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/appium_lib.gemspec +1 -1
- data/docs/android_docs.md +179 -179
- data/docs/ios_docs.md +233 -233
- data/lib/appium_lib/common/multi_touch.rb +10 -48
- data/lib/appium_lib/common/touch_actions.rb +12 -14
- data/lib/appium_lib/version.rb +2 -2
- data/release_notes.md +6 -0
- metadata +4 -4
@@ -54,9 +54,7 @@ module Appium
|
|
54
54
|
rate = Float(percentage) / 100
|
55
55
|
pinch = MultiTouch.new(driver)
|
56
56
|
|
57
|
-
if driver.
|
58
|
-
top, bottom = pinch_for_xcuitest(rate, pinch.driver)
|
59
|
-
elsif driver.device_is_android?
|
57
|
+
if driver.device_is_android?
|
60
58
|
top, bottom = pinch_android(rate, pinch.driver)
|
61
59
|
else
|
62
60
|
top, bottom = pinch_ios(rate, pinch.driver)
|
@@ -98,9 +96,7 @@ module Appium
|
|
98
96
|
rate = 100 / Float(percentage)
|
99
97
|
zoom = MultiTouch.new(driver)
|
100
98
|
|
101
|
-
if driver.
|
102
|
-
top, bottom = zoom_for_xcuitest(rate, zoom.driver)
|
103
|
-
elsif driver.device_is_android?
|
99
|
+
if driver.device_is_android?
|
104
100
|
top, bottom = zoom_android(rate, zoom.driver)
|
105
101
|
else
|
106
102
|
top, bottom = zoom_ios(rate, zoom.driver)
|
@@ -121,28 +117,11 @@ module Appium
|
|
121
117
|
|
122
118
|
top = ::Appium::Core::TouchAction.new(driver)
|
123
119
|
top.swipe start_x: offset, start_y: 1.0 * height + offset,
|
124
|
-
|
120
|
+
end_x: 0.0, end_y: (rate - 1) * height, duration: 1_000
|
125
121
|
|
126
122
|
bottom = ::Appium::Core::TouchAction.new(driver)
|
127
123
|
bottom.swipe start_x: offset, start_y: 0.0 + offset,
|
128
|
-
|
129
|
-
|
130
|
-
[top, bottom]
|
131
|
-
end
|
132
|
-
|
133
|
-
# @private
|
134
|
-
def pinch_for_xcuitest(rate, driver)
|
135
|
-
height = 100
|
136
|
-
offset = 100
|
137
|
-
|
138
|
-
ele = driver.find_element :class, 'XCUIElementTypeApplication'
|
139
|
-
top = ::Appium::Core::TouchAction.new(driver)
|
140
|
-
top.swipe({ start_x: 0.5, start_y: 0.0 + offset,
|
141
|
-
offset_x: 0.0, offset_y: (1 - rate) * height }, ele)
|
142
|
-
|
143
|
-
bottom = ::Appium::Core::TouchAction.new(driver)
|
144
|
-
bottom.swipe({ start_x: 0.5, start_y: 1.0 + offset,
|
145
|
-
offset_x: 0.0, offset_y: rate * height }, ele)
|
124
|
+
end_x: 0.0, end_y: (1 - rate) * height, duration: 1_000
|
146
125
|
|
147
126
|
[top, bottom]
|
148
127
|
end
|
@@ -154,11 +133,11 @@ module Appium
|
|
154
133
|
|
155
134
|
top = ::Appium::Core::TouchAction.new(driver)
|
156
135
|
top.swipe start_x: 0.5, start_y: 0.0 + offset,
|
157
|
-
|
136
|
+
end_x: 0.0, end_y: (1 - rate) * height, duration: 1_000
|
158
137
|
|
159
138
|
bottom = ::Appium::Core::TouchAction.new(driver)
|
160
139
|
bottom.swipe start_x: 0.5, start_y: 1.0 + offset,
|
161
|
-
|
140
|
+
end_x: 0.0, end_y: rate * height, duration: 1_000
|
162
141
|
|
163
142
|
[top, bottom]
|
164
143
|
end
|
@@ -170,28 +149,11 @@ module Appium
|
|
170
149
|
|
171
150
|
top = ::Appium::Core::TouchAction.new(driver)
|
172
151
|
top.swipe start_x: offset, start_y: (1.0 - rate) * height + offset,
|
173
|
-
|
152
|
+
end_x: 0.0, end_y: (rate - 1.0) * height, duration: 1_000
|
174
153
|
|
175
154
|
bottom = ::Appium::Core::TouchAction.new(driver)
|
176
155
|
bottom.swipe start_x: offset, start_y: rate * height + offset,
|
177
|
-
|
178
|
-
|
179
|
-
[top, bottom]
|
180
|
-
end
|
181
|
-
|
182
|
-
# @private
|
183
|
-
def zoom_for_xcuitest(rate, driver)
|
184
|
-
height = 100
|
185
|
-
offset = 100
|
186
|
-
|
187
|
-
ele = driver.find_element :class, 'XCUIElementTypeApplication'
|
188
|
-
top = ::Appium::Core::TouchAction.new(driver)
|
189
|
-
top.swipe({ start_x: 0.5, start_y: (1 - rate) * height + offset,
|
190
|
-
offset_x: 0.0, offset_y: - (1 - rate) * height }, ele)
|
191
|
-
|
192
|
-
bottom = ::Appium::Core::TouchAction.new(driver)
|
193
|
-
bottom.swipe({ start_x: 0.5, start_y: rate * height + offset,
|
194
|
-
offset_x: 0.0, offset_y: (1 - rate) * height }, ele)
|
156
|
+
end_x: 0.0, end_y: (1.0 - rate) * height, duration: 1_000
|
195
157
|
|
196
158
|
[top, bottom]
|
197
159
|
end
|
@@ -203,11 +165,11 @@ module Appium
|
|
203
165
|
|
204
166
|
top = ::Appium::Core::TouchAction.new(driver)
|
205
167
|
top.swipe start_x: 0.5, start_y: (1 - rate) * height + offset,
|
206
|
-
|
168
|
+
end_x: 0.0, end_y: - (1 - rate) * height, duration: 1_000
|
207
169
|
|
208
170
|
bottom = ::Appium::Core::TouchAction.new(driver)
|
209
171
|
bottom.swipe start_x: 0.5, start_y: rate * height + offset,
|
210
|
-
|
172
|
+
end_x: 0.0, end_y: (1 - rate) * height, duration: 1_000
|
211
173
|
|
212
174
|
[top, bottom]
|
213
175
|
end
|
@@ -17,7 +17,7 @@ module Appium
|
|
17
17
|
# @example
|
18
18
|
#
|
19
19
|
# # called `swipe(...).perform` in this method.
|
20
|
-
# swipe(start_x: 75, start_y: 500,
|
20
|
+
# swipe(start_x: 75, start_y: 500, end_x: 75, end_y: 20, duration: 500)
|
21
21
|
#
|
22
22
|
# If you'd like to perform the chain with an arbitrary driver:
|
23
23
|
#
|
@@ -48,25 +48,23 @@ module Appium
|
|
48
48
|
super driver
|
49
49
|
end
|
50
50
|
|
51
|
-
def swipe(opts
|
51
|
+
def swipe(opts)
|
52
52
|
start_x = opts.fetch :start_x, 0
|
53
53
|
start_y = opts.fetch :start_y, 0
|
54
|
-
|
55
|
-
|
56
|
-
end_x = opts.fetch :end_x, nil
|
57
|
-
end_y = opts.fetch :end_y, nil
|
54
|
+
end_x = opts.fetch :end_x, 0
|
55
|
+
end_y = opts.fetch :end_y, 0
|
58
56
|
duration = opts.fetch :duration, 200
|
59
57
|
|
60
|
-
if
|
61
|
-
warn
|
62
|
-
end_x
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
if opts[:offset_x]
|
59
|
+
::Appium::Logger.warn('[DEPRECATED] :offset_x was renamed to :end_x to indicate as an absolute point.')
|
60
|
+
end_x = opts.fetch :offset_x, 0
|
61
|
+
end
|
62
|
+
if opts[:offset_y]
|
63
|
+
::Appium::Logger.warn('[DEPRECATED] :offset_y was renamed to :end_y to indicate as an absolute point.')
|
64
|
+
end_y = opts.fetch :offset_y, 0
|
67
65
|
end
|
68
66
|
|
69
|
-
super(start_x: start_x, start_y: start_y,
|
67
|
+
super(start_x: start_x, start_y: start_y, end_x: end_x, end_y: end_y, duration: duration)
|
70
68
|
end
|
71
69
|
end # class TouchAction
|
72
70
|
end # module Appium
|
data/lib/appium_lib/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Appium
|
2
2
|
# Version and Date are defined on the 'Appium' module, not 'Appium::Common'
|
3
|
-
VERSION = '9.
|
4
|
-
DATE = '2018-04-
|
3
|
+
VERSION = '9.12.0'.freeze unless defined? ::Appium::VERSION
|
4
|
+
DATE = '2018-04-25'.freeze unless defined? ::Appium::DATE
|
5
5
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
#### v9.11.1 2018-04-22
|
2
|
+
|
3
|
+
- [778aaf4](https://github.com/appium/ruby_lib/commit/778aaf4dfd5879759fd296f770aef59a6eca685e) [Release 9 11 1 (#772)](https://github.com/appium/ruby_lib/issues/772)
|
4
|
+
- [c89f526](https://github.com/appium/ruby_lib/commit/c89f526e97be008b4320c89d7a02267dcb23aa1d) [fix some tests and fix compatibility for wait (#771)](https://github.com/appium/ruby_lib/issues/771)
|
5
|
+
|
6
|
+
|
1
7
|
#### v9.11.0 2018-04-19
|
2
8
|
|
3
9
|
- [91f4db4](https://github.com/appium/ruby_lib/commit/91f4db40f0b1e29bc77231f3ce850bee193d4968) [Release 9 11 0 (#770)](https://github.com/appium/ruby_lib/issues/770)
|
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.12.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: 2018-04-
|
11
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appium_lib_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tomlrb
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|