Skip to content

Instantly share code, notes, and snippets.

@jarmo
Created October 31, 2011 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarmo/1328007 to your computer and use it in GitHub Desktop.
Save jarmo/1328007 to your computer and use it in GitHub Desktop.
# lib/app/page/main.rb
module App
module Page
class Main < WatirSplash::Page::Base
# ...
def search_button
modify button(:name => "go"),
:click => lambda {redirect_to Results}
end
end
end
end
# lib/app/page/results.rb
module App
module Page
class Results < WatirSplash::Page::Base
def results
modify ul(:id => "wg0"),
:count => lambda {results.lis(:class => "sa_wr").size},
:[] => lambda {|i| results.li(:class => "sa_wr", :index => i)}
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment