Created
February 20, 2013 18:28
-
-
Save eyston/4997793 to your computer and use it in GitHub Desktop.
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
## env.rb ## | |
PageObject.javascript_framework = :jquery | |
## login.rb ## | |
class LoginPage | |
include PageObject | |
## stuff for every page ## | |
div(:loading_overlay, :id => 'loading-overlay') | |
def initialize_page | |
## this is for the first page you visit -- we deliver a static page and load javascript async | |
## static page has loading overlay that gets removed from dom when javascript executes | |
wait_until(10, "Page did not finish loading in 10 seconds") do | |
!loading_overlay? | |
end | |
## every page may or may not do ajax via jquery | |
wait_for_ajax | |
end | |
## end stuff ## | |
page_url "http://localhost:8080/login" | |
text_field(:email, :id => 'inputEmail') | |
text_field(:password, :id => 'inputPassword') | |
button(:login, :class => 'login') | |
def login_with(email, password) | |
self.email = email | |
self.password = password | |
login | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment