Sha256: 7b2e951946e334e903a2c6caaaf32ad6851c9c653bc45937bfab139d21ad8f08

Contents?: true

Size: 1004 Bytes

Versions: 40

Compression:

Stored size: 1004 Bytes

Contents

require 'date'

module OpsManagerUiDrivers
  module Version17
    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

40 entries across 40 versions & 1 rubygems

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