class OLE_QA::Framework::OLELS::Location_Level_Lookup

The location level 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/location_level_lookup.rb, line 18
def initialize(ole_session)
  url = ole_session.url + 'portal.do?channelTitle=Location Level&channelUrl='
  url += ole_session.url + 'ole-kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.ole.describe.bo.OleLocationLevel&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/location_level_lookup.rb, line 25
def set_elements
  super
  element(:level_id_icon)                                       {b.input(:title => 'Direct Inquiry')}
  element(:level_code_field)                                    {b.text_field(:name => 'lookupCriteria[levelCode]')}
  element(:level_name_field)                                    {b.text_field(:name => 'lookupCriteria[levelName]')}
  element(:search_button)                                       {b.button(:text => /[Ss]earch/)}
  element(:clear_button)                                        {b.button(:text => /[Cc]lear/)}
  element(:cancel_button)                                       {b.button(:text => /[Cc]ancel/)}
end
set_functions() click to toggle source
Calls superclass method OLE_QA::Framework::Page#set_functions
# File lib/olels/pages/location_level_lookup.rb, line 35
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}')]")}
  # Query whether the given text value exists in the search results.
  function(:text_in_results?)                                   {|which| text_in_results(which).present?}
  # Return the 'edit' link for a search results line containing a given value.
  function(:edit_by_text)                                       {|which| b.a(:xpath => "//tr[td/div/span[contains(text(),'#{which}')]]/td[1]/div/fieldset/div/div/a[contains(text(),'edit')]")}
  # Return the 'Level ID' link for a search results line containing a given value.
  function(:id_by_text)                                         {|which| b.a(:xpath => "//tr[td/div/span[contains(text(),'#{which}')]]/td[2]/div/span/a")}
  # Return the 'Parent Level ID' link for a search results line containing a given value.
  function(:parent_id_by_text)                                  {|which| b.a(:xpath => "//tr[td/div/span[contains(text(),'#{which}')]]/td[5]/div/span/a")}
end
wait_for_elements() click to toggle source
# File lib/olels/pages/location_level_lookup.rb, line 49
def wait_for_elements
  super
  @wait_on << :level_code_field
  @wait_on << :search_button
end