Class: AwsAccountUtils::CustomerInformation
- Defined in:
- lib/aws_account_utils/customer_information.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger, browser) ⇒ CustomerInformation
constructor
A new instance of CustomerInformation.
- #submit(account_email, account_password, customer_details) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(logger, browser) ⇒ CustomerInformation
Returns a new instance of CustomerInformation.
8 9 10 11 |
# File 'lib/aws_account_utils/customer_information.rb', line 8 def initialize(logger, browser) @logger = logger @browser = browser end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
6 7 8 |
# File 'lib/aws_account_utils/customer_information.rb', line 6 def browser @browser end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/aws_account_utils/customer_information.rb', line 6 def logger @logger end |
Instance Method Details
#submit(account_email, account_password, customer_details) ⇒ Object
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.(: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 |