13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/aws_account_utils/customer_information.rb', line 13
def submit(account_email, account_password, customer_details)
logger.debug "Entering customer details."
Login.new(logger, browser).execute url,
account_email,
account_password
browser.wait_until{ browser.text.include? 'AWS Customer Agreement'}
browser.select_list(:ng_model =>'address.countryCode').when_present.select 'United States'
customer_details.each do |k,v|
browser.text_field(:name => k).when_present.set v
end
browser.checkbox(:name, /ccepted/).when_present.set
screenshot(browser, "1")
browser.button(:text=> /Continue/).when_present.click
browser.h2(:text => /Payment Information/).wait_until_present
screenshot(browser, "2")
raise StandardError if browser.text.include? 'error'
browser.input(:id => "accountId", :value => "").wait_while_present(30)
browser.input(:id => "accountId").value
rescue StandardError
screenshot(browser, 'error')
raise StandardError, 'Aws returned error on the page when submitting customer information.'
rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e
screenshot(browser, "error")
raise StandardError, "#{self.class.name} - #{e}"
end
|