Created
January 3, 2012 05:58
-
-
Save yuliabro/1553728 to your computer and use it in GitHub Desktop.
Page model init
This file contains hidden or 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
| 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