Skip to content

ss81/watir-kickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watir Kickstart

Watir Kickstart is the base set of files, which could be used for creation of Watir Tests. This set is optimized to be ran as Jenkins job.

Example of Registration module

module Registration
  def goto_reg_page
    link(:text, "Create new account").click
  end

  def fill_reg_form(user, with_shipping = false)
    text_field(:name, "name").set(user[:username])
    text_field(:name, "mail").set(user[:email])

    text_field(:name, "egility_field_fname[0][value]").set(user[:first_name])
    text_field(:name, "egility_field_lname[0][value]").set(user[:last_name])
    text_field(:name, "egility_field_contact_phone[0][value]").set(user[:phone])

    text_field(:name, "location_name_ba").set(user[:billing_name])
    text_field(:name, "location_address1_ba").set(user[:billing_street1])
    text_field(:name, "location_address2_ba").set(user[:billing_street2])
    text_field(:name, "location_city_ba").set(user[:billing_city])
    select_list(:name, "location_country_ba").select(user[:billing_country])
    sleep 5 # Wait 5 seconds. The State select list should be updated by AJAX call.
    select_list(:name, "location_state_ba").select(user[:billing_state])
    text_field(:name, "location_postal_ba").set(user[:billing_zip])
    text_field(:name, "location_phone_ba").set(user[:billing_phone])
  end

  def submit_reg_form
    button(:name, "op").click
  end
end

About

Watir Kickstart

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages