Created
April 14, 2012 16:43
-
-
Save jmoody/2385776 to your computer and use it in GitHub Desktop.
cucumber step for calabash-ios that scrolls a view until a name is match or a limit is reached
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /^I scroll (left|right|up|down) until I see "([^"]*)" limit (\d+)$/ do |dir,name,limit| | |
if (not element_exists("view marked:'#{name}'")) | |
count = 0 | |
begin | |
scroll("scrollView index:0", dir) | |
sleep(STEP_PAUSE) | |
count = count + 1 | |
end while ((not element_exists("view marked:'#{name}'")) and count < limit.to_i) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am novice ruby/gherkin programmer and I could use some help cleaning this step.