Sha256: b572c2b1573f369f8ec4059d0fc15ad530d39802bc80401946af4747f135d429

Contents?: true

Size: 1.15 KB

Versions: 58

Compression:

Stored size: 1.15 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

      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

      private

      attr_reader :browser
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-1.28.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.28.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.27.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.26.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.26.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.25.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.25.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.24.4 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.24.3 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.24.2 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.24.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.24.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.23.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.22.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.21.1 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.21.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.20.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.19.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.18.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb
ops_manager_ui_drivers-1.17.0 lib/ops_manager_ui_drivers/version16/state_change_progress.rb