Class: OLE_QA::Framework::OLELS::Staff_Upload

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

Overview

The OLE Library System Staff Upload page, accessible from the OLE Financial System main menu.

Instance Attribute Summary

Attributes inherited from Page

#lines, #url

Attributes inherited from Common_Object

#elements, #functions, #ole

Instance Method Summary collapse

Methods inherited from Page

#lookup, #lookup_url, #open, #wait_for_element, #wait_for_page_to_load

Methods included from Page_Helpers

#set_line

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

#initialize(ole_session) ⇒ Staff_Upload

Returns a new instance of Staff_Upload.



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

def initialize(ole_session)
  url = ole_session.url + 'portal.do?channelTitle=Staff%20Upload&channelUrl='
  url += ole_session.url + 'ole-kr-krad/staffuploadcontroller?viewId=StaffUploadView&methodToCall=start&__login_user=admin&user=ole-khuntley'
  super(ole_session, url)
end

Instance Method Details

#set_elementsObject

Set elements for Staff upload screen.



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/olels/pages/staff_upload.rb', line 26

def set_elements
  super
  element(:title)                   {browser.h1(:class => 'uif-headerText').span}
  element(:marc_field)              {browser.input(:id => "StaffUploadView-marcFileUpload_control").to_subtype}
  element(:edi_field)               {browser.input(:id => "StaffUploadView-ediFileUpload_control").to_subtype}
  element(:profile_selector)        {browser.select_list(:id => "StaffUploadView-agenda_control")}
  element(:description_field)       {browser.input(:id => "StaffUploadView-agendaDescription_control").to_subtype}
  element(:upload_button)           {browser.button(:id => "uploadButton")}
  element(:cancel_button)           {browser.button(:id => "cancelButton")}
  element(:load_reports_button)     {browser.button(:id => "loadReportsButton")}
  element(:message)                 {browser.div(:id => 'MessageFieldSection').span}
end

#set_functionsObject

Add commonly-used functions for staff upload screen.



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

def set_functions
  super
  # Clicks the upload button and waits for a message to appear.
  # - Returns the text of the upload message.
  function(:upload)                 {upload_button.click ; wait_for_page_to_load ; message.when_present.text.strip }
end

#wait_for_elementsObject

Wait for title to appear.



40
41
42
43
# File 'lib/olels/pages/staff_upload.rb', line 40

def wait_for_elements
  @wait_on << :title
  super
end