class OLE_QA::Framework::OLEFS::Load_Report

An OLE Financial System staff upload load report.

Public Class Methods

new(ole_session) click to toggle source

Initializes with Load Summary Lookup URL.

(Requires document ID number to retrieve by URL.)
Calls superclass method OLE_QA::Framework::Page::new
# File lib/olefs/pages/load_report.rb, line 20
def initialize(ole_session)
  url = ole_session.url + 'portal.do?channelTitle=Load%20Reports&channelUrl=batchlookup.do?methodToCall=start&businessObjectClassName=org.kuali.ole.select.businessobject.OleLoadSumRecords&docFormKey=88888888&returnLocation='
  url += ole_session.url + 'portal.do&hideReturnLink=true'
  lookup_url = "acqBatchUpload.do?docId=_DOC_ID_&docTypeName=OLE_ACQBTHUPLOAD&methodToCall=docHandler&command=displayDocSearchView#topOfForm"
  super(ole_session, url, lookup_url)
end

Public Instance Methods

set_elements() click to toggle source

Set load report screen elements.

# File lib/olefs/pages/load_report.rb, line 28
def set_elements
  super
  element(:profile_name)                {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'Name Of Load Profile')]]/following-sibling::td")}
  element(:user_id)                     {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'User ID')]]/following-sibling::td")}
  element(:counts)                      {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'Counts')]]/following-sibling::td")}
  element(:file_name)                   {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'Name Of File')]]/following-sibling::td")}
  element(:number_of_pos)               {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'No. Of POs Created')]]/following-sibling::td")}
  element(:number_of_bibs)              {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'No. Of Bibs Created')]]/following-sibling::td")}
  element(:po_link)                     {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'List Of All POs')]]/following-sibling::td").a}
  element(:bib_link)                    {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'List Of All Bibs')]]/following-sibling::td").a}
  element(:upload_description)          {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'Description')]]/following-sibling::td")}
  element(:upload_date)                 {b.td(:xpath => "//table[@class = 'datatable']/descendant::th[div[contains(text(),'Date Of Load')]]/following-sibling::td")}
end
set_functions() click to toggle source
Calls superclass method OLE_QA::Framework::Page#set_functions
# File lib/olefs/pages/load_report.rb, line 49
def set_functions
  super
  # Total Count from 'Counts' cell.
  # @return [String] The total number of records uploaded.
  function(:total_count)                {counts.text.match(/(?<=TOTAL\: )\d+(?=\s)/).to_s}
  # Success Count from 'Counts' cell.
  # @return [String] The total number of records successfully processed.
  function(:success_count)              {counts.text.match(/(?<=SUCCESS\: )\d+(?=\s)/).to_s}
  # Failure Count from 'Counts' cell.
  # @return [String] The total number of records unsuccessfully processed.
  function(:failure_count)              {counts.text.match(/(?<=FAILED\: )\d+(?=$)/).to_s}
  # Use a regular expression to return the year/month/day value in the upload date field.
  # @return [String] The upload date, in MM/DD/YYYY format.
  function(:upload_date_ymd)            {upload_date.text.match(/\d{2}\/\d{2}\/\d{4}/)}
  # Use a regular expression to return the time-of-day value in the upload date field.
  # @return [String] The upload time, in HH:MM AM/PM format.
  function(:upload_date_tod)            {upload_date.text.match(/\d{2}\:\d{2}\s+[AP]M/)}
end
wait_for_elements() click to toggle source
# File lib/olefs/pages/load_report.rb, line 42
def wait_for_elements
  super
  @wait_on << :counts
  @wait_on << :upload_description
  @wait_on << :upload_date
end