calabash-cucumber 0.21.4 → 0.21.5

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
  SHA1:
3
- metadata.gz: 47062da2a6696fc997c91dcceb968781b69e4b74
4
- data.tar.gz: 3e3be7398ac0910b76fe161c36e51f21fd0d495c
3
+ metadata.gz: b7dfee76ce28e4b2e416e448dac9e7e23982c776
4
+ data.tar.gz: 068aa05c346dd2246aa432ea2f14e401fcb98f04
5
5
  SHA512:
6
- metadata.gz: 1f23f97f83b6292d6114bf6d8ca2215a43ab74e86354a96aa5ac90fed75cb2c6b123a60ffbf39092556dc0d3739866d42f355803ae8e85b14383b87ce05c76d5
7
- data.tar.gz: 5953b4bc82d80d392d657d2055d74634f8327008f925a99bb928ccb51d872a1a9e73c59f855d051f70813410386b6e8f79e6f5dffa22409611c15d91799d7305
6
+ metadata.gz: eb268b9620002b1d5400254492682a19bc1e60eb973387faabe9b4097c5e35e2d0ea54834c275c27c99e3848bdaa288341218702e88c829730be247fe733dfaa
7
+ data.tar.gz: faeec233cb862347585781cec66c866c0f6da97777435114d7ccd961babd92a1613b76467cfee1ef4300f9bf9bfb2b0ca872c6f09a276754bd53864886a38e54
Binary file
@@ -206,11 +206,13 @@ args[0] = #{args[0]}])
206
206
  to_point = to_hash[:coordinates]
207
207
 
208
208
  gesture_options = {
209
- :duration => dupped_options[:duration]
209
+ duration: dupped_options[:duration],
210
+ num_fingers: dupped_options.fetch(:num_fingers, 1),
211
+ first_touch_hold_duration:
212
+ dupped_options.fetch(:first_touch_hold_duration, 0.0)
210
213
  }
211
214
 
212
- client.pan_between_coordinates(from_point, to_point,
213
- gesture_options)
215
+ client.pan_between_coordinates(from_point, to_point, gesture_options)
214
216
 
215
217
  [from_hash[:view], to_hash[:view]]
216
218
  end
@@ -219,11 +221,13 @@ args[0] = #{args[0]}])
219
221
  def pan_coordinates(from_point, to_point, options)
220
222
 
221
223
  gesture_options = {
222
- :duration => options[:duration]
224
+ duration: options[:duration],
225
+ num_fingers: options.fetch(:num_fingers, 1),
226
+ first_touch_hold_duration:
227
+ options.fetch(:first_touch_hold_duration, 0.0)
223
228
  }
224
229
 
225
- client.pan_between_coordinates(from_point, to_point,
226
- gesture_options)
230
+ client.pan_between_coordinates(from_point, to_point, gesture_options)
227
231
  [first_element_for_query("*")]
228
232
  end
229
233
 
@@ -490,6 +490,9 @@ Valid forces are: :strong, :normal, :light
490
490
  # @option options {Numeric} :duration (1.0) duration of the 'pan'. The
491
491
  # minimum value of pan in UIAutomation is 0.5. For DeviceAgent, the
492
492
  # duration must be > 0.
493
+ # @option options {Numeric} :first_touch_hold_duration (0.0) How long the
494
+ # first touch holds before starting the pan. Only available for iOS 9
495
+ # or greater (requires DeviceAgent)
493
496
  # @return {Array<Hash>} array containing the serialized version of the
494
497
  # touched views. The first element is the first view matched by
495
498
  # the from_query and the second element is the first view matched by
@@ -522,6 +525,8 @@ The minimum duration is 0.0.
522
525
  ]
523
526
  end
524
527
 
528
+ # TODO validate first_touch_hold_duration
529
+
525
530
  launcher.automator.pan(from_query, to_query, merged_options)
526
531
  end
527
532
 
@@ -551,6 +556,9 @@ The minimum duration is 0.0.
551
556
  # @option options {Numeric} :duration (1.0) duration of the 'pan'. The
552
557
  # minimum value of pan in UIAutomation is 0.5. For DeviceAgent, the
553
558
  # duration must be > 0.
559
+ # @option options {Numeric} :first_touch_hold_duration (0.0) How long the
560
+ # first touch holds before starting the pan. Only available for iOS 9 or
561
+ # greater (requires DeviceAgent).
554
562
  #
555
563
  # @raise [ArgumentError] If duration is < 0.5 for UIAutomation and <= 0
556
564
  # for DeviceAgent.
@@ -579,8 +587,9 @@ The minimum duration is 0.0.
579
587
  ]
580
588
  end
581
589
 
582
- launcher.automator.pan_coordinates(from_point, to_point,
583
- merged_options)
590
+ # TODO validate first_touch_hold_duration
591
+
592
+ launcher.automator.pan_coordinates(from_point, to_point, merged_options)
584
593
  end
585
594
 
586
595
  # Performs a "pinch" gesture.
@@ -232,6 +232,55 @@ module Calabash
232
232
  with_screenshot_on_failure { client.long_press(uiquery, {:duration => duration}) }
233
233
  end
234
234
 
235
+ # Wait for text to appear in a view matched by uiquery.
236
+ #
237
+ # @param [Hash] text the text to wait for (exact match)
238
+ # @param [Hash] uiquery query for the view in which the text should appear
239
+ # @param [Hash] options control the timeout
240
+ # @option options [Numeric] :timeout How long to wait for the query to
241
+ # match a view and the text to appear in that view.
242
+ #
243
+ # @raise [Timeout::Error] when no match appears before the timeout
244
+ # @return The first view that matches uiquery and contains text
245
+ def wait_for_text_in_view(text, uiquery, options={})
246
+ value = nil
247
+ with_screenshot_on_failure do
248
+ value = client.wait_for_text_in_view(text, uiquery, options)
249
+ end
250
+ value
251
+ end
252
+
253
+ # Wait for view to match uiquery.
254
+ #
255
+ # @param [Hash] uiquery the query
256
+ # @param [Hash] options control the timeout
257
+ # @option options [Numeric] :timeout How long to wait for the query to
258
+ # match a view and the text to appear in that view.
259
+ #
260
+ # @raise [Timeout::Error] when no match appears before the timeout
261
+ # @return The first view that matches uiquery
262
+ def wait_for_view(uiquery, options={})
263
+ value = nil
264
+ with_screenshot_on_failure do
265
+ value = client.wait_for_view(uiquery, options)
266
+ end
267
+ value
268
+ end
269
+
270
+ # Wait for no view to match uiquery.
271
+ #
272
+ # @param [Hash] uiquery the query
273
+ # @param [Hash] options control the timeout
274
+ # @option options [Numeric] :timeout How long to wait for the query to
275
+ # match a view and the text to appear in that view.
276
+ #
277
+ # @raise [Timeout::Error] when there is a view that matches uiquery
278
+ def wait_for_no_view(uiquery, options={})
279
+ with_screenshot_on_failure do
280
+ client.wait_for_no_view(uiquery, options)
281
+ end
282
+ end
283
+
235
284
  # Returns true if there is a keyboard visible.
236
285
  #
237
286
  # Scheduled for removal in 0.21.0. Use Core#keyboard_visible?. If you
@@ -3,10 +3,10 @@ module Calabash
3
3
 
4
4
  # @!visibility public
5
5
  # The Calabash iOS gem version.
6
- VERSION = "0.21.4"
6
+ VERSION = "0.21.5"
7
7
 
8
8
  # @!visibility public
9
9
  # The minimum required version of the Calabash embedded server.
10
- MIN_SERVER_VERSION = "0.21.4"
10
+ MIN_SERVER_VERSION = "0.21.5"
11
11
  end
12
12
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.4
4
+ version: 0.21.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -132,7 +132,7 @@ dependencies:
132
132
  requirements:
133
133
  - - ">="
134
134
  - !ruby/object:Gem::Version
135
- version: 2.6.3
135
+ version: 2.6.6
136
136
  - - "<"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '3.0'
@@ -142,7 +142,7 @@ dependencies:
142
142
  requirements:
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 2.6.3
145
+ version: 2.6.6
146
146
  - - "<"
147
147
  - !ruby/object:Gem::Version
148
148
  version: '3.0'