Class: AwsAccountUtils::IamBilling
- Defined in:
- lib/aws_account_utils/iam_billing.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
- #enable(account_email, account_password) ⇒ Object
-
#initialize(logger, browser) ⇒ IamBilling
constructor
A new instance of IamBilling.
Methods inherited from Base
Constructor Details
#initialize(logger, browser) ⇒ IamBilling
Returns a new instance of IamBilling.
8 9 10 11 |
# File 'lib/aws_account_utils/iam_billing.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/iam_billing.rb', line 6 def browser @browser end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/aws_account_utils/iam_billing.rb', line 6 def logger @logger end |
Instance Method Details
#enable(account_email, account_password) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/aws_account_utils/iam_billing.rb', line 13 def enable(account_email, account_password) logger.debug "Enabling IAM User Access to Billing Information" Login.new(logger, browser).execute url, account_email, account_password browser.a(:xpath => '//a[@ng-click="toggleEditingIAMPreferencesInfoState()"]').when_present(timeout = 120).click browser.label(:xpath => '//label[@ng-show="isEditingIAMPreferencesInfo"]').when_present.click screenshot(browser, "1") browser.(:xpath => '//button[@ng-click="updateIAMPreferences()"]').when_present.click browser.strong(:text => /IAM user access to billing information is activated./).wait_until_present rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e screenshot(browser, "error") raise StandardError, "#{self.class.name} - #{e}" end |