Class: AwsAccountUtils::Logout
- Defined in:
- lib/aws_account_utils/logout.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
- #execute ⇒ Object
-
#initialize(logger, browser) ⇒ Logout
constructor
A new instance of Logout.
Methods inherited from Base
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
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
5 6 7 |
# File 'lib/aws_account_utils/logout.rb', line 5 def browser @browser end |
#logger ⇒ Object (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
#execute ⇒ Object
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 |