Class: AwsAccountUtils::Account
- Defined in:
- lib/aws_account_utils/account.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
- #close(account_email, account_password) ⇒ Object
-
#initialize(logger, browser) ⇒ Account
constructor
A new instance of Account.
Methods inherited from Base
Constructor Details
#initialize(logger, browser) ⇒ Account
Returns a new instance of Account.
8 9 10 11 |
# File 'lib/aws_account_utils/account.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/account.rb', line 6 def browser @browser end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/aws_account_utils/account.rb', line 6 def logger @logger end |
Instance Method Details
#close(account_email, account_password) ⇒ 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 |
# File 'lib/aws_account_utils/account.rb', line 13 def close(account_email, account_password) logger.debug "Closing AWS account." Login.new(logger, browser).execute url, account_email, account_password browser.checkbox(:ng_model =>'isClosingAccount').when_present.set screenshot(browser, "3") browser.(:text => /Close Account/).when_present.click screenshot(browser, "2") browser.wait_until{ browser.text.include? 'Are you sure you want to close your account?'} browser.span(:text => /Close Account/).when_present.click screenshot(browser, "3") browser.p(:text => /Are you sure you want to close your account?/).wait_while_present browser.wait_until{ browser.text.include? 'Account has been closed'} rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e screenshot(browser, "error") raise StandardError, "#{self.class.name} - #{e}" end |