lib/ilesspainfulclient-cucumber/lesspainful_steps.rb in ilesspainfulclient-cucumber-0.0.9 vs lib/ilesspainfulclient-cucumber/lesspainful_steps.rb in ilesspainfulclient-cucumber-0.1.0
- old
+ new
@@ -1,6 +1,6 @@
-WAIT_TIMEOUT = ENV['WAIT_TIMEOUT'] || 60
+WAIT_TIMEOUT = ENV['WAIT_TIMEOUT'] || 30
STEP_PAUSE = ENV['STEP_PAUSE'].to_f || 0.3
require 'rspec/expectations'
Given /^(my|the) app is running$/ do |_|
@@ -66,33 +66,35 @@
sleep(STEP_PAUSE)
end
# alias
When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |text_field, text_to_type|
- When %Q|I type "#{text_to_type}" into the "#{text_field}" text field|
+ When %Q|I enter "#{text_to_type}" into the "#{text_field}" text field|
end
When /^I fill in text fields as follows:$/ do |table|
table.hashes.each do |row|
- When %Q|I type "#{row['text']}" into the "#{row['field']}" text field|
+ When %Q|I enter "#{row['text']}" into the "#{row['field']}" text field|
end
end
Then /^I enter "([^\"]*)" into input field number (\d+)$/ do |text, index|
index = index.to_i
raise "Index should be positive (was: #{index})" if (index<=0)
set_text("textField index:#{index-1}",text)
+ sleep(STEP_PAUSE)
end
When /^I clear "([^\"]*)"$/ do |name|
When %Q|I type "" into the "#{name}" text field|
end
Then /^I clear input field number (\d+)$/ do |index|
index = index.to_i
raise "Index should be positive (was: #{index})" if (index<=0)
set_text("textField index:#{index-1}","")
+ sleep(STEP_PAUSE)
end
@@ -145,11 +147,18 @@
Then /^I wait$/ do
sleep 2
end
+Then /^I wait and wait$/ do
+ sleep 4
+end
+Then /^I wait and wait and wait\.\.\.$/ do
+ sleep 10
+end
+
Then /^I go back$/ do
touch("navigationItemButtonView first")
sleep(STEP_PAUSE)
end
@@ -163,10 +172,15 @@
Then /^I swipe (left|right)$/ do |dir|
swipe(dir)
sleep(STEP_PAUSE)
end
+Then /^I swipe (left|right) on "([^\"]*)"$/ do |dir, mark|
+ swipe(dir, {:query => "view marked:'#{mark}'"})
+ sleep(STEP_PAUSE)
+end
+
Then /^I swipe on cell number (\d+)$/ do |index|
index = index.to_i
raise "Index should be positive (was: #{index})" if (index<=0)
cell_swipe({:query => "tableViewCell index:#{index-1}"})
sleep(STEP_PAUSE)
@@ -284,10 +298,10 @@
Then /^I touch user location$/ do
touch("view:'MKUserLocationView'")
end
-Then /^I touch done$/ do
+Then /^I (touch|press) (done|search)$/ do |_,__|
done
end
#** TODO /^I dont see the text "([^\"]*)"$/