Skip to content

Instantly share code, notes, and snippets.

@rubemz
Created September 9, 2011 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubemz/1205382 to your computer and use it in GitHub Desktop.
Save rubemz/1205382 to your computer and use it in GitHub Desktop.
Pages and transictions
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