Class: AwsAccountUtils::Logout

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#screenshot

Constructor Details

#initialize(logger, browser) ⇒ Logout

Returns a new instance of Logout.



7
8
9
10
# File 'lib/aws_account_utils/logout.rb', line 7

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

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



5
6
7
# File 'lib/aws_account_utils/logout.rb', line 5

def browser
  @browser
end

#loggerObject (readonly)

Returns the value of attribute logger.



5
6
7
# File 'lib/aws_account_utils/logout.rb', line 5

def logger
  @logger
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/aws_account_utils/logout.rb', line 12

def execute
  logger.debug "Logging out of AWS."
  browser.goto url
  screenshot(browser, "1")
  browser.wait_until{ browser.url.include? 'https://aws.amazon.com/'}
  browser.text.include?('Sign In to the Console') || browser.text.include?('Create a Free Account')
rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e
  screenshot(browser, "error")
  raise StandardError, "#{self.class.name} - #{e}"
end