Class: OpsManagerUiDrivers::Version17::UserSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/ops_manager_ui_drivers/version17/user_settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(browser:) ⇒ UserSettings

Returns a new instance of UserSettings.



4
5
6
# File 'lib/ops_manager_ui_drivers/version17/user_settings.rb', line 4

def initialize(browser:)
  @browser = browser
end

Instance Method Details

#switch_to_internal_authentication(user:, password:, decryption_passphrase:) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/ops_manager_ui_drivers/version17/user_settings.rb', line 8

def switch_to_internal_authentication(user: , password:, decryption_passphrase:)
  browser.visit '/settings/edit'
  browser.fill_in 'change_auth_service[admin_user_name]', with: user
  browser.fill_in 'change_auth_service[admin_password]', with: password
  browser.fill_in 'change_auth_service[admin_password_confirmation]', with: password
  browser.fill_in 'change_auth_service[decryption_passphrase]', with: decryption_passphrase
  browser.click_on 'update-auth-service-action'
  wait_for_availability!
end

#switch_to_saml_authentication(idp_metadata:, decryption_passphrase:) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/ops_manager_ui_drivers/version17/user_settings.rb', line 18

def switch_to_saml_authentication(idp_metadata:, decryption_passphrase:)
  browser.visit '/settings/edit'
  browser.fill_in 'change_auth_service[saml_idp_metadata]', with: 
  browser.fill_in 'change_auth_service[decryption_passphrase]', with: decryption_passphrase
  browser.click_on 'update-auth-service-action'
  wait_for_availability!
end

#wait_for_availability!Object



26
27
28
29
30
31
32
# File 'lib/ops_manager_ui_drivers/version17/user_settings.rb', line 26

def wait_for_availability!
  Timeout.timeout(150) do
    while browser.current_path.include?('ensure_availability')
      sleep 1
    end
  end
end