Class: AwsAccountUtils::Login
- Defined in:
- lib/aws_account_utils/login.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(url, aws_email, password) ⇒ Object
-
#initialize(logger, browser) ⇒ Login
constructor
A new instance of Login.
Methods inherited from Base
Constructor Details
#initialize(logger, browser) ⇒ Login
Returns a new instance of Login.
7 8 9 10 |
# File 'lib/aws_account_utils/login.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/login.rb', line 5 def browser @browser end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
5 6 7 |
# File 'lib/aws_account_utils/login.rb', line 5 def logger @logger end |
Instance Method Details
#execute(url, aws_email, password) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/aws_account_utils/login.rb', line 12 def execute(url, aws_email, password) browser.goto url return true unless login_page? logger.debug "Logging into AWS." screenshot(browser, "1") browser.text_field(:id => 'ap_email').when_present.set aws_email browser.text_field(:id => 'ap_password').when_present.set password screenshot(browser, "2") browser.(:id => 'signInSubmit-input').when_present.click rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e screenshot(browser, "error") raise StandardError, "#{self.class.name} - #{e}" end |