class OLE_QA::Framework::OLELS::Request_Lookup

The request lookup screen in the OLE Library System.

Public Class Methods

new(ole_session) click to toggle source
Calls superclass method OLE_QA::Framework::Page::new
# File lib/olels/pages/request_lookup.rb, line 18
def initialize(ole_session)
  url = ole_session.url + 'portal.do?channelTitle=Request&channelUrl='
  url += ole_session.url + 'ole-kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.ole.deliver.bo.OleDeliverRequestBo&returnLocation='
  url += ole_session.url + 'portal.do&hideReturnLink=true&showMaintenanceLinks=true'
  super(ole_session,url)
end

Public Instance Methods

set_elements() click to toggle source
# File lib/olels/pages/request_lookup.rb, line 25
def set_elements
  super
  element(:patron_barcode_field)              {b.text_field(:id => 'olePatronBarcode_control')}
  element(:patron_barcode_icon)               {b.fieldset(:id => 'olePatronBarcode_fieldset').input(:class => 'uif-actionImage')}
  element(:patron_first_name_field)           {b.text_field(:id => 'olePatronFName_control')}
  element(:patron_last_name_field)            {b.text_field(:id => 'olePatronLName_control')}
  element(:item_barcode_field)                {b.text_field(:id => 'itemId_control')}
  element(:item_barcode_icon)                 {b.fieldset(:id => 'itemId_fieldset').input(:class => 'uif-actionImage')}
  element(:item_title_field)                  {b.text_field(:id => 'title_control')}
  element(:search_button)                     {b.button(:id => 'searchReqBtn')}
  element(:clear_button)                      {b.button(:id => 'clearReqBtn')}
  element(:cancel_button)                     {b.button(:id => 'cancelReqBtn')}
  element(:message)                           {b.li(:class => 'uif-infoMessageItem')}
end
set_functions() click to toggle source
Calls superclass method OLE_QA::Framework::Page#set_functions
# File lib/olels/pages/request_lookup.rb, line 46
def set_functions
  super
  # Return the span element containing the given text, if it exists in the search results.
  function(:text_in_results)                {|which| b.span(:xpath => "//td/div/span[contains(text(),'#{which}')]")}
  # Return whether the given text is found in the search results.
  function(:text_in_results?)               {|which| text_in_results(which).present?}
  # Return the cancel request link for a line containing the given text in the search results.
  function(:cancel_by_text)                 {|which| b.a(:xpath => "//tr/td[div/span[contains(text(),'#{which}')]]/preceding-sibling::td/div/fieldset/div/div/a[contains(text(),'cancel')]")}
  # Return the edit request link for a line containing the given text in the search results.
  function(:edit_by_text)                   {|which| b.a(:xpath => "//tr/td[div/span[contains(text(),'#{which}')]]/preceding-sibling::td/div/fieldset/div/div/a[contains(text(),'edit')]")}
  # Return the text of the Queue Position entry for a line containing the given text.
  function(:position_by_text)               {|which| b.span(:xpath => "//tr/td[div/span[contains(text(),'#{which}')]]/preceding-sibling::td/div/span[starts-with(@id,'result-borrowerQueuePosition_line')]").text}
end
wait_for_elements() click to toggle source
# File lib/olels/pages/request_lookup.rb, line 40
def wait_for_elements
  super
  @wait_on << :patron_barcode_field << :patron_first_name_field << :patron_last_name_field
  @wait_on << :item_barcode_field << :item_title_field
end