Sha256: e816d7311ce0724378d1d5d4f246d1ea4e8efaa6520b510eca39dfcdd9fdc241

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

module OpsManagerUiDrivers
  module Version17

    class UserSettings
      def initialize(browser:)
        @browser = browser
      end

      def switch_to_internal_authentication(user: , password:)
        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.click_on 'update-auth-service-action'
        wait_for_availability!
      end

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

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

      private

      attr_reader :browser
    end
  end
end



Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-2.5.1 lib/ops_manager_ui_drivers/version17/user_settings.rb
ops_manager_ui_drivers-2.5.0 lib/ops_manager_ui_drivers/version17/user_settings.rb
ops_manager_ui_drivers-2.4.2 lib/ops_manager_ui_drivers/version17/user_settings.rb