Permalink
Browse files

Sample gesture tests

  • Loading branch information...
1 parent f021e8b commit 9bb6b851caaffce1a4ea99c8397dd6d854b255db @moredip committed Jul 10, 2011
@@ -0,0 +1,18 @@
+Feature: Demonstrating gesture support
+
+Background:
+ Given I launch the app
+
+Scenario: Starting to delete a user by swiping
+ When I swipe "Larry Stooge" rightwards
+ Then I should see "Delete"
+
+Scenario: Touching absolute position on the screen
+ When I tap "Larry Stooge"
+ When I wait to see a navigation bar titled "User Profile"
+ And I tap "User Roles"
+ And I wait to see a navigation bar titled "User Roles"
+ And I tap "User Profile"
+ And I wait to see a navigation bar titled "User Profile"
+ And I tap "Users"
+ And I wait to see a navigation bar titled "Users"
@@ -26,10 +26,19 @@
touch( "navigationButton marked:'#{mark}'" )
end
-When /^I touch the screen at \((\d+),(\d+)\)$/ do |x, y|
- frankly_map( "view:'UILayoutContainerView'", "touchx:y:", x, y )
+When /^I tap "([^\"]*)"$/ do |mark|
+ frankly_map( "view marked:'#{mark}' first", "tap" )
end
+When /^I tap the screen at \((\d+),(\d+)\)$/ do |x, y|
+ frankly_map( "view first", "tapAtPoint:", serialize_point(x,y) )
+end
+
+When /^I swipe "([^\"]*)" (.*)wards$/ do |mark,dir|
+ frankly_map( "label marked:'#{mark}'", "swipeInDirection:", dir )
+end
+
+
Then /^I should see an alert view saying "([^\"]*)"$/ do |expected_mark|
check_element_exists( "alertView view marked:'#{expected_mark}'" )
end
@@ -1,3 +1,7 @@
require 'frank-cucumber'
APP_BUNDLE_PATH = File.dirname(__FILE__) + "/../../build/Debug-iphonesimulator/EmployeeAdmin.app"
+
+def serialize_point( x, y )
+ "{#{x},#{y}}"
+end

0 comments on commit 9bb6b85

Please sign in to comment.