class OLE_QA::Framework::OLEFS::Vendor_Lookup

The Vendor Lookup Screen in OLEFS

Public Class Methods

new(ole_session) click to toggle source

Set URL and initialize.

Calls superclass method OLE_QA::Framework::Page::new
# File lib/olefs/pages/vendor_lookup.rb, line 19
def initialize(ole_session)
  # Set @url instance variable from OLE Base URL Variable
  url = ole_session.url + \
    'portal.do?channelTitle=Vendor&channelUrl=kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.ole.vnd.businessobject.VendorDetail&docFormKey=88888888&returnLocation=' \
    + ole_session.url + \
    'portal.do&hideReturnLink=true'
  super(ole_session, url)
end

Public Instance Methods

set_elements() click to toggle source

Set Vendor Lookup screen elements.

# File lib/olefs/pages/vendor_lookup.rb, line 29
def set_elements
  super
  element(:vendor_name_field)                     {b.text_field(:id => "vendorName")}
  element(:tax_number_field)                      {b.text_field(:id => "vendorHeader.vendorTaxNumber")}
  element(:vendor_number_field)                   {b.text_field(:id => "vendorNumber")}
  element(:vendor_type_selector)                  {b.select_list(:id => "vendorHeader.vendorTypeCode")}
  element(:state_field)                           {b.text_field(:id => "vendorAddresses.vendorStateCode")}
  element(:commodity_code_field)                  {b.text_field(:id => "vendorCommodities.purchasingCommodityCode")}
  element(:supplier_diversity_selector)           {b.select_list(:id => "vendorHeader.vendorSupplierDiversities.vendorSupplierDiversityCode")}
end
set_functions() click to toggle source
# File lib/olefs/pages/vendor_lookup.rb, line 40
def set_functions
  super
  # Return the TD element containing the given text, if it exists in the search results.
  function(:text_in_results)                      {|which| b.td(:index => 1).a(:text => which)}
  # Return true or false based on whether the given text exists in the search results.
  function(:text_in_results?)                     {|which| text_in_results(which).present?}
  # Get the 'return result' link for the given text in the search results.
  function(:return_result)                        {|which| b.td(:index => 1).a(:text => which).parent.parent.td(:index => 0).a}
end