Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Sample gesture tests

  • Loading branch information...
commit 9bb6b851caaffce1a4ea99c8397dd6d854b255db 1 parent f021e8b
@moredip authored
View
18 example/EmployeeAdmin/features/gestures.feature
@@ -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"
View
13 example/EmployeeAdmin/features/step_definitions/frank_steps.rb
@@ -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
View
4 example/EmployeeAdmin/features/support/env.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.