Class: AwsAccountUtils::AlternateContacts

Inherits:
Base
  • Object
show all
Defined in:
lib/aws_account_utils/alternate_contacts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#screenshot

Constructor Details

#initialize(logger, browser) ⇒ AlternateContacts

Returns a new instance of AlternateContacts.



8
9
10
11
# File 'lib/aws_account_utils/alternate_contacts.rb', line 8

def initialize(logger, browser)
  @logger = logger
  @browser = browser
end

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



6
7
8
# File 'lib/aws_account_utils/alternate_contacts.rb', line 6

def browser
  @browser
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/aws_account_utils/alternate_contacts.rb', line 6

def logger
  @logger
end

Instance Method Details

#set(account_email, account_password, contact_info = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/aws_account_utils/alternate_contacts.rb', line 13

def set(, , contact_info = {})
  logger.debug "Setting alternate account contacts."
  Login.new(logger, browser).execute url,
                                     ,
                                     
  browser.a(:xpath => '//a[@ng-click="toggleEditingAlternateContactsInfoState()"]').when_present.click
  form_inputs(contact_info)
  screenshot(browser, "1")
  browser.button(:xpath => '//button[@ng-click="updateAlternateContacts()"]').when_present.click
  browser.div(:xpath => '//div[@ng-show="options.status == \'success\'"]').wait_until_present
  true
rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e
  screenshot(browser, "error")
  raise StandardError, "#{self.class.name} - #{e}"
end