calabash-cucumber 0.9.160 → 0.9.161

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: 4250065fb240c637edd42fdd56234dcd2cc5e0ad
4
- data.tar.gz: 082b884451b052b431d502cfb10bc8591bc9b037
3
+ metadata.gz: d5a530cbf65efa54db1984a3f8afe227d5de54f9
4
+ data.tar.gz: 4e9b073d215cc110aaf8d207b6ce2d9fdeef29eb
5
5
  SHA512:
6
- metadata.gz: dce4c8faf1c3a8aba0d38f947c006c3a7c7394d47e3c63da08cea904aba5cee50d24e206e44e45977a6af9605d871a194e37052980f59d8b0090e3f9806e40d5
7
- data.tar.gz: a9502b1a1e61ce0276d7f1cc44eb64a277a556b9aa4e41defde7b7f83b689efcbc694222ee3e61e7c3d6dedf5f6034fccf5f3d42e4154b5fc63337b6361dd29a
6
+ metadata.gz: 26835b71dfd637fcaa0003b6ac3f051a61cb0db81742a188fda6e8bfec820f5f86e502a8135608c15d5330f81a9caf1e7825f181e92f7228dd27299c1f897880
7
+ data.tar.gz: e4d5478835361305f871412e9a1808d44a415b7743baa2adcd3a54c6662344a2f7cb1e976b0ebffb556cd7f47dcc5a20d51d303335c241f08736b0a1e94bde48
@@ -93,7 +93,7 @@ def download_calabash(project_path)
93
93
  zip_file = File.join(@framework_dir,"calabash.framework.zip")
94
94
 
95
95
  if File.exist?(zip_file)
96
- if not system("unzip -C -K -o -q -d #{project_path} #{zip_file} -x __MACOSX/* calabash.framework/.DS_Store")
96
+ if not system("unzip -C -K -o -q -d '#{project_path}' '#{zip_file}' -x __MACOSX/* calabash.framework/.DS_Store")
97
97
  msg("Error") do
98
98
  puts "Unable to unzip file: #{zip_file}"
99
99
  puts "You must install manually."
@@ -1,4 +1,3 @@
1
-
2
1
  WAIT_TIMEOUT = (ENV['WAIT_TIMEOUT'] || 30).to_f
3
2
  STEP_PAUSE = (ENV['STEP_PAUSE'] || 0.5).to_f
4
3
 
@@ -336,7 +335,7 @@ end
336
335
 
337
336
  Then /^I send app to background for (\d+) seconds$/ do |secs|
338
337
  secs = secs.to_f
339
- background(secs)
338
+ send_app_to_background(secs)
340
339
  sleep(secs+10)
341
340
  end
342
341
 
@@ -71,7 +71,6 @@ module Calabash
71
71
 
72
72
  def touch(uiquery, options={})
73
73
 
74
-
75
74
  if (uiquery.is_a?(Array))
76
75
  raise "No elements to touch in array" if uiquery.empty?
77
76
  uiquery = uiquery.first
@@ -102,8 +101,7 @@ module Calabash
102
101
  if ios7?
103
102
  swipe_ios7(options.merge(:direction => dir))
104
103
  else
105
- dir = dir.to_sym
106
- current_orientation = device_orientation().to_sym
104
+ current_orientation = status_bar_orientation.to_sym
107
105
  if current_orientation == :left
108
106
  case dir
109
107
  when :left then
@@ -117,6 +115,7 @@ module Calabash
117
115
  else
118
116
  end
119
117
  end
118
+
120
119
  if current_orientation == :right
121
120
  case dir
122
121
  when :left then
@@ -130,6 +129,7 @@ module Calabash
130
129
  else
131
130
  end
132
131
  end
132
+
133
133
  if current_orientation == :up
134
134
  case dir
135
135
  when :left then
@@ -143,6 +143,7 @@ module Calabash
143
143
  else
144
144
  end
145
145
  end
146
+
146
147
  playback("swipe_#{dir}", options)
147
148
  end
148
149
  end
@@ -259,47 +260,59 @@ module Calabash
259
260
  # * see apple documentation for clarification about where the home button
260
261
  # is in left and right landscape orientations
261
262
  def rotate_home_button_to(dir)
262
- dir = dir.to_s
263
- # *** UNEXPECTED ***
264
- # do not call device_orientation function here because it does a number
265
- # of checks that will lead to inconsistent and confusing warnings
266
- # ******************
267
- res = map(nil, :orientation, :device).first
268
- return res if res.eql? dir
263
+ dir_sym = dir.to_sym
264
+ if dir_sym.eql?(:top)
265
+ if ENV['CALABASH_FULL_CONSOLE_OUTPUT'] == '1'
266
+ warn "converting '#{dir}' to ':up' - please adjust your code"
267
+ end
268
+ dir_sym = :up
269
+ end
270
+
271
+ if dir_sym.eql?(:bottom)
272
+ if ENV['CALABASH_FULL_CONSOLE_OUTPUT'] == '1'
273
+ warn "converting '#{dir}' to ':down' - please adjust your code"
274
+ end
275
+ dir_sym = :down
276
+ end
277
+
278
+ directions = [:down, :up, :left, :right]
279
+ unless directions.include?(dir_sym)
280
+ screenshot_and_raise "expected one of '#{directions}' as an arg to 'rotate_home_button_to but found '#{dir}'"
281
+ end
282
+
283
+ res = status_bar_orientation()
284
+ if res.nil?
285
+ screenshot_and_raise "expected 'status_bar_orientation' to return a non-nil value"
286
+ else
287
+ res = res.to_sym
288
+ end
289
+
290
+ return res if res.eql? dir_sym
291
+
269
292
  rotation_candidates.each { |candidate|
270
293
  if ENV['CALABASH_FULL_CONSOLE_OUTPUT'] == '1'
271
- puts "try to rotate to '#{dir}' using '#{candidate}'"
294
+ puts "try to rotate to '#{dir_sym}' using '#{candidate}'"
272
295
  end
273
296
  playback(candidate)
274
297
  # need a longer sleep for cloud testing
275
- sleep(0.5)
276
-
277
- # *** UNEXPECTED ***
278
- # do not call device_orientation function here because it does a number
279
- # of checks that will lead to inconsistent and confusing warnings
280
- # ******************
281
- res = map(nil, :orientation, :device).first
282
-
283
- # *** UNEXPECTED ***
284
- # the device orientation changes when rotation playback is performed
285
- # _regardless_ of whether or not the rotation succeeded
286
- #
287
- # this is an attempt to sync to the device and status bar orientation
288
- # ******************
289
- if res.eql? dir
290
- status_bar = status_bar_orientation
291
- if status_bar.eql? res
292
- return res
293
- else
294
- return rotate_home_button_to status_bar
295
- end
298
+ sleep(0.4)
299
+
300
+ res = status_bar_orientation
301
+ if res.nil?
302
+ screenshot_and_raise "expected 'status_bar_orientation' to return a non-nil value"
303
+ else
304
+ res = res.to_sym
296
305
  end
297
306
 
307
+ return if res.eql? dir_sym
298
308
  }
309
+
299
310
  if ENV['CALABASH_FULL_CONSOLE_OUTPUT'] == '1'
300
- puts "Could not rotate device. Is rotation enabled in app? Will return 'down'"
311
+ warn "Could not rotate home button to '#{dir}'."
312
+ warn 'Is rotation enabled for this controller?'
313
+ warn "Will return 'down'"
301
314
  end
302
- 'down'
315
+ :down
303
316
  end
304
317
 
305
318
  def device_orientation(force_down=false)
@@ -309,11 +322,6 @@ module Calabash
309
322
  if ENV['CALABASH_FULL_CONSOLE_OUTPUT'] == '1'
310
323
  if force_down
311
324
  puts "WARN found orientation '#{res}' - will rotate to force orientation to 'down'"
312
- else
313
- puts "WARN found orientation '#{res}'"
314
- puts ' if you did not expect this, you have two options:'
315
- puts ' 1. position your device in the upright position'
316
- puts " 2. call device_orientation(true) to force a 'down' orientation"
317
325
  end
318
326
  end
319
327
 
@@ -332,7 +340,7 @@ module Calabash
332
340
 
333
341
  def rotate(dir)
334
342
  dir = dir.to_sym
335
- current_orientation = device_orientation(true).to_sym
343
+ current_orientation = status_bar_orientation().to_sym
336
344
  rotate_cmd = nil
337
345
  case dir
338
346
  when :left then
@@ -27,7 +27,7 @@ module Calabash
27
27
  end
28
28
 
29
29
  def normalize_rect_for_orientation(rect)
30
- orientation = device_orientation().to_sym
30
+ orientation = status_bar_orientation().to_sym
31
31
  launcher = Calabash::Cucumber::Launcher.launcher
32
32
  screen_size = launcher.device.screen_size
33
33
  case orientation
@@ -38,7 +38,7 @@ module Calabash
38
38
  end
39
39
 
40
40
  def home_direction
41
- device_orientation().to_sym
41
+ status_bar_orientation.to_sym
42
42
  end
43
43
 
44
44
  def assert_home_direction(expected)
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = '0.9.160'
3
+ VERSION = '0.9.161'
4
4
  FRAMEWORK_VERSION = '0.9.160'
5
5
  end
6
6
  end
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.9.160
4
+ version: 0.9.161
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2013-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -359,9 +359,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
359
359
  version: '0'
360
360
  requirements: []
361
361
  rubyforge_project:
362
- rubygems_version: 2.0.3
362
+ rubygems_version: 2.0.2
363
363
  signing_key:
364
364
  specification_version: 4
365
365
  summary: Client for calabash-ios-server for automated functional testing on iOS
366
366
  test_files:
367
367
  - features/step_definitions/calabash_steps.rb
368
+ has_rdoc: