Class: OLE_QA::Framework::OLEFS::Vendor_Lookup

Inherits:
Lookup show all
Defined in:
lib/olefs/pages/vendor_lookup.rb

Overview

The Vendor Lookup Screen in OLEFS

Instance Attribute Summary

Attributes inherited from Page

#lines, #url, #wait_on

Attributes inherited from Common_Object

#elements, #functions, #ole

Instance Method Summary collapse

Methods inherited from Page

#lookup, #lookup_url, #open, #set_line, #wait_for_element, #wait_for_elements, #wait_for_page_to_load

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

#initialize(ole_session) ⇒ Vendor_Lookup

Set URL and initialize.



19
20
21
22
23
24
25
26
# 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

Instance Method Details

#set_elementsObject

Set Vendor Lookup screen elements.



29
30
31
32
33
34
35
36
37
38
# 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_functionsObject



40
41
42
43
44
45
46
47
48
# 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