Class: OLE_QA::Framework::OLELS::Return

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

Overview

The Return page 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) ⇒ Return

Returns a new instance of Return.



18
19
20
21
22
# File 'lib/olels/pages/return.rb', line 18

def initialize(ole_session)
  url = ole_session.url + 'portal.do?channelTitle=Loan&channelUrl='
  url += ole_session.url + 'ole-kr-krad/loancontroller?viewId=ReturnItemView&methodToCall=start'
  super(ole_session, url)
end

Instance Method Details

#set_elementsObject

Set elements for return page.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/olels/pages/return.rb', line 25

def set_elements
  super
  # General Elements
  element(:loan_button)                               {b.button(:id => 'LoanScreenLinkView-buttons')}
  element(:end_session_button)                        {b.button(:id => 'endSessionButton')}
  # Checkin Elements
  element(:damaged_checkin_checkbox)                  {b.checkbox(:id => 'DamagedCheckIn_control')}
  element(:checkin_date_field)                        {b.text_field(:id => 'CheckInDate_control')}
  element(:checkin_time_field)                        {b.text_field(:id => 'CheckInTime_control')}
  element(:item_field)                                {b.text_field(:id => 'CheckInItem_control')}
  element(:item_search_button)                        {b.fieldset(:id => 'CheckInItem_fieldset').input(:title => 'Search Field')}
  element(:items_returned_toggle)                     {b.a(:id => 'ItemReturnedList-HorizontalBoxSection_toggle')}
  # Checkin Message Elements
  element(:checkin_message_box)                       {b.div(:id => 'MessagePopupSectionForReturn')}
  element(:return_button)                             {b.button(:id => 'returnBtn')}
  element(:do_not_return_button)                      {b.button(:id => 'noReturnBtn')}
  # Circulation desk elements
  element(:circulation_desk_selector)                 {b.select_list(:id => 'LoanCirculationDesk_control')}
  element(:circulation_desk_yes)                      {b.button(:id => 'ChangeCirculationLocationBtn')}
  element(:circulation_desk_no)                       {b.button(:id => 'CirculationLocationCloseBtn')}
end

#set_functionsObject

Set commonly used functions on return page.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/olels/pages/return.rb', line 54

def set_functions
  super
  function(:item_barcode_link)                        {|which = 1|  b.div(:id => "returnBarcode_line#{which-1}").a}
  function(:item_title)                               {|which = 1|  b.span(:id => "returnTitle_line#{which-1}_control")}
  function(:item_author)                              {|which = 1|  b.span(:id => "returnAuthor_line#{which-1}_control")}
  function(:item_location)                            {|which = 1|  b.span(:id => "returnItemLocation_line#{which-1}_control")}
  function(:item_call_number)                         {|which = 1|  b.span(:id => "returnItemCallNumber_line#{which-1}_control")}
  function(:item_checkin_date)                        {|which = 1|  b.span(:id => "returnCheckInDate_line#{which-1}_control")}
  function(:item_status)                              {|which = 1|  b.span(:id => "returnItemStatus_line#{which-1}_control")}
  function(:item_bill_link)                           {|which = 1|  b.div(:id => "returnBill_line#{which-1}").a}
end

#wait_for_elementsObject

Wait for the loan button and item barcode field to be present.



48
49
50
51
# File 'lib/olels/pages/return.rb', line 48

def wait_for_elements
  @wait_on << :loan_button
  @wait_on << :item_field
end