Class: AwsAccountUtils::EnterpriseSupport

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#screenshot

Constructor Details

#initialize(logger, browser) ⇒ EnterpriseSupport

Returns a new instance of EnterpriseSupport.



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

def browser
  @browser
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/aws_account_utils/enterprise_support.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
27
28
# File 'lib/aws_account_utils/enterprise_support.rb', line 13

def enable(, )
  logger.debug 'Enabling enterprise support.'
  Login.new(logger, browser).execute support_registration_url,
                                     ,
                                     
  browser.input(:value => "AWSSupportEnterprise").when_present(timeout = 60).click
  browser.span(:text => /Continue/).when_present(timeout = 60).click
  screenshot(browser, "1")
  browser.p(:text => confirmation_text).wait_until_present(timeout = 60)
  screenshot(browser, "2")
  true
rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e
  page_error?
  screenshot(browser, "error")
  raise StandardError, "#{self.class.name} - #{e}"
end

#existing_support?(account_email, account_password) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/aws_account_utils/enterprise_support.rb', line 30

def existing_support?(,)
  logger.debug 'Checking to see if enterprise support is enabled.'
  Login.new(logger, browser).execute support_status_url,
                                     ,
                                     

  screenshot(browser, "1")
  browser.text.include? 'Enterprise Support Plan'
rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e
  page_error?
  screenshot(browser, "error")
  raise StandardError, "#{self.class.name} - #{e}"
end