Sha256: b38fa5bd4b8a276a4fb68475c4328205c8a46d30f9df4fd93cf52740299e836f

Contents?: true

Size: 1.14 KB

Versions: 93

Compression:

Stored size: 1.14 KB

Contents

module OpsManagerUiDrivers
  module Version16
    class StateChangeProgress
      def initialize(browser:)
        @browser = browser
      end

      def state_change_success?
        open_install_progress
        browser.all('#install-success-modal').any?
      end

      def errand_ran?(errand_name)
        open_install_progress
        browser.find('#install-output .output', visible: false).text(:all).
          include?("Errand `#{errand_name}' completed successfully (exit code 0)")
      end

      def errand_ran_with_text?(errand_name)
        {
          errand_ran: errand_ran?(errand_name),
          output:     browser.find('#install-output .output', {visible: false}).text(:all),
        }
      end

      private

      attr_reader :browser

      def open_install_progress
        browser.visit '/install' unless install_progress_open?
        browser.fail_early('Install probably aborted immediately') unless install_progress_open?
        browser.fail_early('Install failed') if browser.all('#install-failure-modal').any?
      end

      def install_progress_open?
        browser.current_path =~ %r(^/+install)
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-2.10.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.9.6 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.9.5 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.9.4 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.9.3 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.9.2 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.9.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.9.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.8.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.7.3 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.7.2 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.7.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.7.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.6.4 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.6.3 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.6.2 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.6.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.6.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.5.2 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-2.5.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb