lib/calabash-cucumber/rotation_helpers.rb in calabash-cucumber-0.12.0.pre4 vs lib/calabash-cucumber/rotation_helpers.rb in calabash-cucumber-0.12.0.pre5
- old
+ new
@@ -88,11 +88,11 @@
puts "try to rotate to '#{dir_sym}' using '#{candidate}'"
end
playback(candidate)
# need a longer sleep for cloud testing
sleep(0.4)
- touch(nil,offset:{x:1,y:1})
+ recalibrate_after_rotation()
res = status_bar_orientation
if res.nil?
screenshot_and_raise "expected 'status_bar_orientation' to return a non-nil value"
else
@@ -163,13 +163,18 @@
if full_console_logging?
puts "Could not rotate device in direction '#{dir}' with orientation '#{current_orientation} - will do nothing"
end
else
result = playback("rotate_#{rotate_cmd}")
- touch(nil,offset:{x:1,y:1})
+ recalibrate_after_rotation
result
end
end
+
+ def recalibrate_after_rotation
+ uia_tap_offset(x:0,y:0)
+ end
+
end
end
end
\ No newline at end of file