Created
September 9, 2011 00:52
-
-
Save lucastorri/1205219 to your computer and use it in GitHub Desktop.
thinking about page object tester
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
#apps/orkut:D/pages/login.rb | |
class LoginPage < Page | |
@username_field = ... | |
@password_field = ... | |
@submit_button = ... | |
end | |
#apps/orkut:D/flows/home.rb | |
class LoginPage < Flow | |
def login user, pwd | |
username_field = user | |
password_field = pwd | |
submit_button.click | |
HomePage | |
end | |
end | |
#apps/orkut:D/pages/home.rb | |
class HomePage < Page | |
#@fields_necessary | |
def send_scrap to, msg | |
#... | |
ScrapPage | |
end | |
end | |
it "should login" do | |
page = login_page. | |
login('silvio_santos', 'maoe'). | |
send_scrap('lombardi', 'oi!'). | |
#... outras acoes em cima da page, dando pra encadear acoes | |
page.should be_scrap_page | |
page.scraps.first.should == 'oi!' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment