Created
September 9, 2011 02:50
-
-
Save rubemz/1205382 to your computer and use it in GitHub Desktop.
Pages and transictions
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
class LoginPage < Page | |
partial :top_menu #something new - hammernight | |
#defining element on a page - existent on taza | |
element :username {text_field :id, 'username'} | |
#filter, so that we can wait for something before access an element - existent on taza | |
filter :username, :wait_until_something | |
def wait_until_something | |
wait_until {'something'} | |
end | |
end | |
class ProductPage < Page | |
element :total_amount {...} | |
end | |
class AccountFlows < Flow | |
def create_new_user_and_buy_a_tv params={} | |
#partial | |
LoginPage.top_menu.login | |
LoginPage.username = "" | |
"..." | |
LoginPage.submit.click | |
"..." | |
HomePage.buy.click | |
"..." | |
return ProductPage #returning the page where the flow ends | |
end | |
end | |
#spec | |
it "should ..." | |
#Accessing an element from returned page | |
App.create_new_user_and_buy_a_tv.total_amount.value.should be_equal "$10.00" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment