Sha256: 2cbb08d6d27f5b353552656d8563686326e720beccc86b60c4fb9ed75e097d5a

Contents?: true

Size: 1009 Bytes

Versions: 102

Compression:

Stored size: 1009 Bytes

Contents

require 'date'

module OpsManagerUiDrivers
  module Version15
    class ProductLogs
      def initialize(browser:, product_name:)
        @browser      = browser
        @product_name = product_name
      end

      def request_job_logs(job_name)
        browser.visit('/')
        browser.click_on("show-#{product_name}-configure-action")
        browser.click_on('show-status-action')
        browser.find(%Q(a[id^="download-#{job_name}-"][id$="-0-log-action"])).click
      end

      def most_recent_log_creation_time
        browser.visit('/')
        browser.click_on("show-#{product_name}-configure-action")
        browser.click_on('show-logs-action')

        log_row = browser.all('#downloaded_logs tr').
          select { |e| e.find(%Q(a[href^="/products/#{product_name}"])) }.
          last

        return unless log_row

        date_string = log_row.all('td').last.text
        DateTime.parse(date_string)
      end

      private

      attr_reader :product_name, :browser
    end
  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
ops_manager_ui_drivers-2.42.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.41.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.40.1 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.40.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.39.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.38.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.37.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.36.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.35.2 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.35.1 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.35.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.34.1 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.34.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.33.1 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.33.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.32.1 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.32.0 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.31.3 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.31.2 lib/ops_manager_ui_drivers/version15/product_logs.rb
ops_manager_ui_drivers-2.31.1 lib/ops_manager_ui_drivers/version15/product_logs.rb