Last active
August 29, 2015 14:24
-
-
Save yratof/fe8878a67acb40031178 to your computer and use it in GitHub Desktop.
Testing checkout pages with Watir
This file contains hidden or 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
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 |
This file contains hidden or 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
gem install watir-webdriver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment