Skip to content

Instantly share code, notes, and snippets.

@yuliabro
Created January 3, 2012 05:58
Show Gist options
  • Select an option

  • Save yuliabro/1553728 to your computer and use it in GitHub Desktop.

Select an option

Save yuliabro/1553728 to your computer and use it in GitHub Desktop.
Page model init
class Page
# include IknowNavigationHelper #NOTE - This must precede SeleniumTestHelper or else test setup will fail
# include SeleniumTestHelper
def initialize(driver, test_case) # method that passes the selenium object
@driver = driver
@test = test_case
setup_instance_elements(driver)
end
def all_elements_displayed?
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
@elements.all? do |name, elem|
elem.displayed?
end
end
def method_missing(method, *args)
if /^assert/ =~ method.to_s
@test.send(method, *args)
else
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment