class OLE_QA::Framework::OLELS::Old_Describe_Workbench

The OLE Library System Describe Workbench Screen (Deprecated as of 1.5.0-M2-r18095, 2014-03-20)

Public Class Methods

new(ole_session) click to toggle source

Set URL

Calls superclass method OLE_QA::Framework::Page::new
# File lib/olels/pages/old_describe_workbench.rb, line 19
def initialize(ole_session)
  url = ole_session.url + 'portal.do?channelTitle=Describe Workbench&channelUrl='
  url += ole_session.url + 'ole-kr-krad/describeworkbenchcontroller?viewId=DescribeWorkBenchView&methodToCall=start'
  super(ole_session, url)
end

Public Instance Methods

set_elements() click to toggle source

Set OLELS Describe Workbench page elements.

# File lib/olels/pages/old_describe_workbench.rb, line 26
def set_elements
  super
  # Search Control Elements
  element(:search_button)                   {b.button(:id => "search_button")}
  element(:clear_button)                    {b.button(:id => "clear_button")}
  element(:doc_type_bib)                    {b.radio(:id => 'SearchPanel-docType-Section_control_0')}
  element(:doc_type_holdings)               {b.radio(:id => 'SearchPanel-docType-Section_control_1')}
  element(:doc_type_item)                   {b.radio(:id => 'SearchPanel-docType-Section_control_2')}
  element(:doc_type_e_holdings)             {b.radio(:id => 'SearchPanel-docType-Section_control_3')}
  element(:link_to_order_button)            {b.button(:id => 'submit_button')}
  element(:export_to_xml_button)            {b.button(:id => 'export_button1')}
  element(:close_button)                    {b.button(:id => 'cancel_button')}
  # Search Fields
  element(:search_field_1)                  {b.text_field(:id => "searchText_id_line0_control")}
  element(:search_which_selector_1)         {b.select_list(:id => "operator_id_line0_control")}
  element(:search_field_selector_1)         {b.select_list(:id => "docField_id_line0_control")}
  element(:search_scope_1_and)              {b.radio(:id => 'searchScope_id_line0_control_0')}
  element(:search_scope_1_or)               {b.radio(:id => 'searchScope_id_line0_control_1')}
  element(:search_scope_1_not)              {b.radio(:id => 'searchScope_id_line0_control_2')}
  element(:search_field_2)                  {b.text_field(:id => 'searchText_id_line1_control')}
  element(:search_which_selector_2)         {b.select_list(:id => 'operator_id_line1_control')}
  element(:search_field_selector_2)         {b.select_list(:id => 'docField_id_line1_control')}
  element(:search_scope_2_and)              {b.radio(:id => 'searchScope_id_line1_control_0')}
  element(:search_scope_2_or)               {b.radio(:id => 'searchScope_id_line1_control_1')}
  element(:search_scope_2_not)              {b.radio(:id => 'searchScope_id_line1_control_2')}
  # Search Results Elements
  element(:next_link)                       {b.a(:text => 'Next')}
  element(:previous_link)                   {b.a(:text => 'Previous')}
end
set_functions() click to toggle source
Calls superclass method OLE_QA::Framework::Page#set_functions
# File lib/olels/pages/old_describe_workbench.rb, line 61
def set_functions
  super
  # Check whether the given text exists within the search results table.
  # - Returns true or false based on whether the given string was found.
  function(:result_present?)                {|str| b.td(:xpath => "//table/tbody/tr/td[div/*[contains(text(),\"#{str}\")]]").present?}
  # Return the TD element containing the given text, if it exists.
  function(:text_in_results)                {|text| b.td(:xpath => "//table/tbody/tr/td[div/*[contains(text(),\"#{text}\")]]")}
  # Return true or false based on whether the given text exists in the search results.
  function(:text_in_results?)               {|text| text_in_results(text).present?}
  # Return the checkbox for the results line containing the given text.
  # Usage:
  #   workbench.select_by_text("Foo").set(true|false)
  # - Searches both link text (for Local ID element) and regular text in span (for all other fields).
  # - Returns nil if element not found.
  function(:select_by_text)                 {|str| element = b.checkbox(:xpath => "//table/tbody/tr[td[div/*[contains(text(),\"#{str}\")]]]/td[1]/div/input[@type='checkbox']") ; if element.present? then element else nil end}
  # Return the 'view' link for the results line containing the given text.
  # Usage:
  #   workbench.view_by_text.click
  # - Searches both link text (for Local ID element) and regular text in span (for all other fields).
  # - Returns nil if element not found.
  function(:view_by_text)                   {|str| element = b.a(:xpath => "//table/tbody/tr[td[div/*[contains(text(),\"#{str}\")]]]/td/div/fieldset/div/div/a[contains(text(),'View')]") ; if element.present? then element else nil end}
  # Return the 'view' link for the results line containing the given text.
  # Usage:
  #   workbench.view_by_text.click
  # - Searches both link text (for Local ID element) and regular text in span (for all other fields).
  # - Returns nil if element not found.
  function(:edit_by_text)                   {|str| element = b.a(:xpath => "//table/tbody/tr[td[div/*[contains(text(),\"#{str}\")]]]/td/div/fieldset/div/div/a[contains(text(),'Edit')]") ; if element.present? then element else nil end}
  # Return the 'overlay' link for the results line containing the given text.
  # Usage:
  #   workbench.overlay_by_text.click
  # - Searches both link text (for Local ID element) and regular text in span (for all other fields).
  # - Returns nil if element not found.
  function(:overlay_by_text)                {|str| element = b.a(:xpath => "//table/tbody/tr[td[div/*[contains(text(),\"#{str}\")]]]/td/div/fieldset/div/div/a[contains(text(),'OverLay')]") ; if element.present? then element else nil end}
  # Return the 'create instance' link for the results line containing the given text.
  # Usage:
  #   workbench.create_instance_by_text.click
  # - Searches both link text (for Local ID element) and regular text in span (for all other fields).
  # - Returns nil if element not found.
  function(:create_instance_by_text)        {|str| element = b.a(:xpath => "//table/tbody/tr[td[div/*[contains(text(),\"#{str}\")]]]/td/div/fieldset/div/div/a[contains(text(),'Create Instance')]") ; if element.present? then element else nil end}
end
wait_for_elements() click to toggle source
# File lib/olels/pages/old_describe_workbench.rb, line 56
def wait_for_elements
  super
  @wait_on << :search_button
end