calabash-cucumber 0.12.0.pre5 → 0.12.0.pre9

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: 67e77c7aeadd2e71f0aa99dee6223504e88ea946
4
- data.tar.gz: 1e4970c81205577ce3152263b20c5d956bfa91e6
3
+ metadata.gz: 66b5f876df6e3ce0e0a3417c4f5861685869d85e
4
+ data.tar.gz: 9edc572d4f8eb084d64d591e8f5ed1399c96a41d
5
5
  SHA512:
6
- metadata.gz: 1e4221997ecdde3663a12f83c2c769f82f5dcd2941fe05f9488c8573e0b871b6dc7fb685fc71bef9185981e387bc9e354fe9a8a7643bc32b08ddbd819e6d610e
7
- data.tar.gz: c9d7a5525285b446deb05083238f9b1fe82c12789abf6e8c8be6c2b23eee3e3ba643d3b3e0ba327d6b0fd580bfbfdeaad957c56cefe0e48e00604c2d72bef2cc
6
+ metadata.gz: 16f85ccd0171c01faba965ff7164f762b5a26470a18412c83205ab6c9649bcb0ea52863f022f6f55982a881759cf14719af86966b943c7bb20b08d41e44d465c
7
+ data.tar.gz: 1c23312f810b198f1509dd9bf510a8f51ab9f775dba7c3484a287c016fa5a8abd61abdc42e11ca9ec927a9c146f33cdfd5e6974f306304e2bcd6d8201a6a9473
Binary file
Binary file
@@ -171,6 +171,9 @@ module Calabash
171
171
  # and causes the touch to be offset with `(x,y)` relative to the center (`center + (offset[:x], offset[:y])`).
172
172
  # @return {Array<Hash>} array containing the serialized version of the tapped view.
173
173
  def touch(uiquery, options={})
174
+ if uiquery.nil? && options[:offset].nil?
175
+ raise "called touch(nil) without specifying an offset in options (#{options})"
176
+ end
174
177
  query_action_with_options(:touch, uiquery, options)
175
178
  end
176
179
 
@@ -51,8 +51,6 @@ module Calabash
51
51
  # been completed. If there is problem rotating, this method will return
52
52
  # `:down` regardless of the actual home button position.
53
53
  #
54
- # @todo When running under UIAutomation, we should use that API to rotate
55
- # instead of relying on playbacks.
56
54
  def rotate_home_button_to(dir)
57
55
  dir_sym = dir.to_sym
58
56
  if dir_sym.eql?(:top)
@@ -129,9 +127,6 @@ module Calabash
129
127
  #
130
128
  # @param [Symbol] dir The position of the home button after the rotation.
131
129
  # Can be one of `{:down | :left | :right | :up }`.
132
- #
133
- # @todo When running under UIAutomation, we should use that API to rotate
134
- # instead of relying on playbacks.
135
130
  def rotate(dir)
136
131
  dir = dir.to_sym
137
132
  current_orientation = status_bar_orientation().to_sym
@@ -171,7 +166,7 @@ module Calabash
171
166
  end
172
167
 
173
168
  def recalibrate_after_rotation
174
- uia_tap_offset(x:0,y:0)
169
+ uia_query :window
175
170
  end
176
171
 
177
172
 
@@ -277,6 +277,49 @@ module Calabash
277
277
  uia_handle_command(:screenshot, name)
278
278
  end
279
279
 
280
+ # Simulates Rotation of the device
281
+ # @param [String|Symbol] dir The position of the home button after the rotation.
282
+ # Can be one of `{'clockwise' | 'counter-clockwise'| :left | :right}`.
283
+ #
284
+ def uia_rotate(dir)
285
+ uia_handle_command(:rotate, dir)
286
+ end
287
+
288
+ # Gets the current orientation of the device
289
+ # @return {String} the current orientation of the device
290
+ # one of `{'portrait', 'portrait-upside-down', 'landscape-left', 'landscape-right', 'faceup', 'facedown' }`
291
+ def uia_orientation
292
+ o = uia_handle_command(:orientation).to_s
293
+ o[1..o.length]
294
+ end
295
+
296
+ # Rotates the home button position to the position indicated by `dir`.
297
+ # @note Refer to Apple's documentation for clarification about left vs.
298
+ # right landscape orientations.
299
+ # @param [Symbol|String] dir The position of the home button after the rotation.
300
+ # Can be one of `{:down, :left, :right, :up }`.
301
+ def uia_rotate_home_button_to(dir)
302
+ dir = dir.to_sym
303
+ if dir == :top
304
+ dir = :up
305
+ elsif dir == :bottom
306
+ dir = :down
307
+ end
308
+ uia_orientation = case dir
309
+ when :left then
310
+ 'UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT'
311
+ when :right then
312
+ 'UIA_DEVICE_ORIENTATION_LANDSCAPELEFT'
313
+ when :up then
314
+ 'UIA_DEVICE_ORIENTATION_PORTRAIT_UPSIDEDOWN'
315
+ when :down then
316
+ 'UIA_DEVICE_ORIENTATION_PORTRAIT'
317
+ else
318
+ raise "Unexpected direction #{dir}"
319
+ end
320
+ uia("target.setDeviceOrientation(#{uia_orientation})")
321
+ end
322
+
280
323
  # @!visibility private
281
324
  def uia_type_string(string, opt_text_before='', escape=true)
282
325
  result = uia_handle_command(:typeString, string, opt_text_before)
@@ -3,11 +3,11 @@ module Calabash
3
3
 
4
4
  # @!visibility public
5
5
  # The Calabash iOS gem version.
6
- VERSION = '0.12.0.pre5'
6
+ VERSION = '0.12.0.pre9'
7
7
 
8
8
  # @!visibility public
9
9
  # The minimum required version of the calabash.framework or, for Xamarin
10
10
  # users, the Calabash component.
11
- MIN_SERVER_VERSION = '0.12.0.pre1'
11
+ MIN_SERVER_VERSION = '0.12.0.pre2'
12
12
  end
13
13
  end
Binary file
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.12.0.pre5
4
+ version: 0.12.0.pre9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-30 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 1.2.0.pre3
173
+ version: 1.2.0.pre5
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 1.2.0.pre3
180
+ version: 1.2.0.pre5
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rake
183
183
  requirement: !ruby/object:Gem::Requirement