Skip to content

Instantly share code, notes, and snippets.

@yratof
Last active August 29, 2015 14:24
Show Gist options
  • Save yratof/fe8878a67acb40031178 to your computer and use it in GitHub Desktop.
Save yratof/fe8878a67acb40031178 to your computer and use it in GitHub Desktop.
Testing checkout pages with Watir
irb
require 'watir-webdriver'
b = Watir::Browser.new
b.goto 'http://demo.woothemes.com/canvas/shop/woo-single-1/'
b.button(:class => 'single_add_to_cart_button').click
b.goto 'http://demo.woothemes.com/canvas/checkout/'
b.text_field(:id => 'billing_first_name').set 'Andrew'
b.text_field(:id => 'billing_last_name').set 'Lazarus'
b.text_field(:id => 'billing_address_1').set '51 Sneinton Dale'
b.text_field(:id => 'billing_city').set 'Nottingham'
b.text_field(:id => 'billing_postcode').set 'NG2 4LG'
b.text_field(:id => 'billing_email').set '[email protected]'
b.text_field(:id => 'billing_phone').set '0162345687985'
b.text_field(:id => 'account_password').set 'password'
b.checkbox(:id => 'ship-to-different-address-checkbox').click
b.button(:id => 'place_order').click
gem install watir-webdriver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment