Skip to content

Instantly share code, notes, and snippets.

@scudco
Created February 16, 2009 19:40
Show Gist options
  • Save scudco/65323 to your computer and use it in GitHub Desktop.
Save scudco/65323 to your computer and use it in GitHub Desktop.
# this could be in a folder with other modules 'lib/sites/ecom/pages/checkout/'
module Ecom
class CheckoutPage < ::Taza::Site
filter :billing_ready?, :billing
page_module :billing do
element(:first_name) { browser.text_field(:id => 'billing_first_name') }
end
def billing_ready?
true
end
end
end
# This could even be split into multiple files in a 'checkout' folder
describe 'Checkout Page' do
describe 'Billing Module' do
Ecom.new do |ecom|
ecom.checkout_page(:billing) do |b|
b.first_name.set 'John'
end
end
end
describe 'Shipping Module' do
Ecom.new do |ecom|
ecom.checkout_page(:shipping) do |s|
s.first_name.set 'John'
end
end
end
end
# this could be in a folder with other modules 'lib/sites/ecom/pages/checkout/'
module Ecom
class CheckoutPage < ::Taza::Site
filter :shipping_ready?, :shipping
page_module :shipping do
element(:first_name) { browser.text_field(:id => 'shipping_first_name') }
end
def shipping_ready?
true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment