class OLE_QA::Framework::DocStore::Results

The base page object for a given set of DocStore search results. @note Elements in the search results will be vastly different depending on the

type of search performed.  If it matters, then be sure to use the subclass
for the type of search results you are expecting.

Public Class Methods

new(ole_session) click to toggle source
Calls superclass method OLE_QA::Framework::Page::new
# File lib/docstore/common/results.rb, line 21
def initialize(ole_session)
  url = ole_session.docstore_url + 'discovery.do'
  super(ole_session, url)
end

Public Instance Methods

set_elements() click to toggle source
Calls superclass method OLE_QA::Framework::Page#set_elements
# File lib/docstore/common/results.rb, line 26
def set_elements
  super
  element(:revise_search_button)                      {b.button(:id => 'Back')}
  element(:new_search_button)                         {b.button(:name => 'newSearch')}
  element(:page_field)                                {b.text_field(:id => 'pageSpinner')}
  element(:go_to_page_button)                         {b.button(:id => 'gotoPage')}
  element(:page_list)                                 {b.div(:id => 'pageList').b}
  element(:no_results)                                {b.div(:id => 'demo2').b(:text => /^([Nn]o).*(results)/)}
end
set_functions() click to toggle source
Calls superclass method OLE_QA::Framework::Page#set_functions
# File lib/docstore/common/results.rb, line 41
def set_functions
  super
  # Title bar for a given record, ordered by appearance on the screen (1-based).
  # @note Not reliable as a source of textual information!  If there is any highlighting
  #   on this element, the text will be broken up by a <span></span> wherever the
  #   highlighting is applied.
  function(:title_bar)                                { |which| which -= 1 ; b.h3(:class => 'expand', :index => "#{which}").a(:title => 'Expand/Collapse')}
  # Check if results are present and return true or false.
  function(:any_results?)                             { no_results.present? ? false : true}
  # Check if there is more than one page of results listed and return true or false.
  function(:multiple_pages?)                          { page_field.present? }
end
wait_for_elements() click to toggle source
# File lib/docstore/common/results.rb, line 36
def wait_for_elements
  super
  @wait_on << :revise_search_button
end