Class: AwsAccountUtils::CompanyName

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#screenshot

Constructor Details

#initialize(logger, browser) ⇒ CompanyName

Returns a new instance of CompanyName.



8
9
10
11
# File 'lib/aws_account_utils/company_name.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/company_name.rb', line 6

def browser
  @browser
end

#loggerObject (readonly)

Returns the value of attribute logger.



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

def logger
  @logger
end

Instance Method Details

#set(account_email, account_password, company_name) ⇒ Object



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

def set(, , company_name)
  logger.debug "Updating Company Name details."
  Login.new(logger, browser).execute url,
                                     ,
                                     
  browser.a(:xpath => '//a[@ng-click="toggleEditingContactInfoState()"]').when_present.click
  browser.input(:xpath => '//input[@ng-model="address.company"]').to_subtype.set(company_name)
  # screenshot(browser, "1")
  browser.button(:xpath => '//button[@ng-click="updateContactInformation()"]').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