Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@ file 'app/build/Debug-iphonesimulator/Universal.app/Universal' do
sh "cd app && xcodebuild -target Universal -configuration Debug -sdk #{ICuke::SDK.fullname}"
end
task :app => 'app/build/Debug-iphonesimulator/Universal.app/Universal'
task :features => :app

task :lib do
sh 'cd ext/iCuke && rake'
sh 'cd ext && rake'
end

begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)

task :features => :check_dependencies
task :features => [:app, :lib]
task :features => [:lib, :app]
rescue LoadError
task :features do
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
Expand Down
3 changes: 3 additions & 0 deletions lib/icuke/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def configuration
simulator_driver.tap(label)
end

When /^I tap (\d+),(\d+)$/ do |x,y|
simulator_driver.tap_at_point(x.to_i, y.to_i)
end
When /^I type "([^\"]*)" in "([^\"]*)"$/ do |text, textfield|
simulator_driver.type(textfield, text)
end
Expand Down
9 changes: 9 additions & 0 deletions lib/icuke/simulator_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def response
def record
@simulator.record
end

def tap_at_point(x, y, options={})
options = {
:pause => true
}.merge(options)
@simulator.fire_event(Tap.new(x,y,options))
sleep(options[:pause] ? 2 : 0.2)
refresh
end

def tap(label, options = {}, &block)
options = {
Expand Down