Skip to content

Instantly share code, notes, and snippets.

@jmoody
Created April 14, 2012 16:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmoody/2385776 to your computer and use it in GitHub Desktop.
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
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
@jmoody
Copy link
Author

jmoody commented Apr 14, 2012

I am novice ruby/gherkin programmer and I could use some help cleaning this step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment