Class: AwsAccountUtils::EmailPreferences
- Defined in:
- lib/aws_account_utils/email_preferences.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
-
#initialize(logger, browser) ⇒ EmailPreferences
constructor
A new instance of EmailPreferences.
- #opt_out(account_email, account_password) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(logger, browser) ⇒ EmailPreferences
Returns a new instance of EmailPreferences.
8 9 10 11 |
# File 'lib/aws_account_utils/email_preferences.rb', line 8 def initialize(logger, browser) @logger = logger @browser = browser end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
6 7 8 |
# File 'lib/aws_account_utils/email_preferences.rb', line 6 def browser @browser end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/aws_account_utils/email_preferences.rb', line 6 def logger @logger end |
Instance Method Details
#opt_out(account_email, account_password) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/aws_account_utils/email_preferences.rb', line 13 def opt_out(account_email, account_password) logger.debug "Setting email preferences." Login.new(logger, browser).execute url, account_email, account_password browser.input(:id => 'email_preferences_optout_all_true').when_present.click screenshot(browser, "1") browser.input(:value => 'Save Changes').when_present.click browser.h3(:text => /You have successfully updated your email preferences/).wait_until_present rescue Watir::Wait::TimeoutError, Net::ReadTimeout => e screenshot(browser, "error") raise StandardError, "#{self.class.name} - #{e}" end |