Class: OLE_QA::Framework::OLELS::Batch_File_List

Inherits:
Page show all
Defined in:
lib/olels/pages/batch_file_list.rb

Overview

A File List screen for a Batch Export in the OLE Library System

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_page_to_load

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

#initialize(ole_session) ⇒ Batch_File_List

Uses Batch Job Details page link.



19
20
21
22
23
# File 'lib/olels/pages/batch_file_list.rb', line 19

def initialize(ole_session)
  url = ole_session.url + 'portal.do?channelTitle=Batch Process Job Details&channelUrl='
  url += ole_session.url + 'ole-kr-krad/oleBatchProcessJobController?viewId=OLEBatchProcessJobDetailsView&methodToCall=jobDocHandler&command=initiate&documentClass=org.kuali.ole.batch.bo.OLEBatchProcessJobDetailsBo'
  super(ole_session, url)
end

Instance Method Details

#set_elementsObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/olels/pages/batch_file_list.rb', line 25

def set_elements
  super
  element(:title)                               {b.span(:class => 'uif-headerText-span')}
  element(:entries_selector)                    {b.label(:text => /^Show/,:text => /entries$/).select_list(:index => 0)}
  element(:entries_text)                        {b.div(:class => 'dataTables_info',:text => /Showing \d+ to \d+ of \d+ entries/)}
  element(:next_button)                         {b.a(:class => 'paginate_active',:class => 'next')}
  element(:previous_button)                     {b.a(:class => 'paginate_active',:class => 'previous')}
  element(:first_button)                        {b.a(:class => 'paginate_active',:class => 'first')}
  element(:last_button)                         {b.a(:class => 'paginate_active',:class => 'last')}
end

#set_functionsObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/olels/pages/batch_file_list.rb', line 36

def set_functions
  super
  # Return the link to a file by searching for the given string or regular expression in the filename.
  function(:link_by_filename)                   {|which| b.div(:class => 'uif-linkField',:id => /fileList_line\d+/,:text => which).a}
  # Return whether the link to a file with the given text or regular expression is present.
  function(:link_by_filename?)                  {|which| link_by_filename(which).present?}
  # Return how many total entries exist for this staging area directory.
  #   e.g. Y in 'Showing 1 to X of Y entries'
  function(:total_entries)                      { entries_text.present? ? entries_list.text.match(/\d+(?= entries)/)[0] : 0}
end

#wait_for_elementsObject



47
48
49
50
51
52
# File 'lib/olels/pages/batch_file_list.rb', line 47

def wait_for_elements
  super
  @wait_on << :title
  @wait_on << :entries_text
  @wait_on << :next_button << :previous_button
end