Class: OLE_QA::Framework::OLEFS::E_Doc

Inherits:
Page show all
Defined in:
lib/olefs/common/e_doc.rb

Overview

This class contains element definitions common to OLE Financial System E-Docs. Element definitions are stored in lib/olefs/e_doc/elements.yml

Direct Known Subclasses

Load_Report, PURAP_Document

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

#initialize, #lookup, #lookup_url, #open, #set_functions, #wait_for_element, #wait_for_page_to_load

Methods included from Page_Helpers

#set_line

Methods inherited from Common_Object

#initialize, #set_functions

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

This class inherits a constructor from OLE_QA::Framework::Page

Instance Method Details

#get_error_arrayObject

Returns an array of both “Errors in this Section” messages and individual error messages from each section.



68
69
70
71
72
73
74
75
76
77
# File 'lib/olefs/common/e_doc.rb', line 68

def get_error_array
  error_array = Array.new
  self.errors_in_tab.each do |error_in_tab|
    error_array << error_in_tab
    error_in_tab.parent.divs.each do |error|
     error_array << error
    end
  end
  error_array
end

#set_elementsObject

Note:

This method is automagically invoked on any Page object. (see Page#initialize)

Automatically set element definitions on the E-Document object.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/olefs/common/e_doc.rb', line 22

def set_elements
  super
  # General Info
  element(:title)                         {b.div(:id => 'headerarea').h1}
  # Header Area
  element(:document_id)                   {b.th(:text => /Doc Nbr\:/).parent.td(:index => 0)}
  element(:document_status)               {b.th(:text => /Status\:/).parent.td(:index => 1)}
  element(:document_type_id)              {b.table(:class => 'headerinfo').tbody.tr(:index => 2).td(:index => 0)}
  element(:document_type_status)          {b.table(:class => 'headerinfo').tbody.tr(:index => 2).td(:index => 1)}
  element(:document_create_date)          {b.table(:class => 'headerinfo').tbody.tr(:index => 1).td(:index => 1)}
  # Document Overview
  element(:document_overview_tab_toggle)  {b.input(:id => 'tab-DocumentOverview-imageToggle')}
  element(:description_field)             {b.text_field(:id => 'document.documentHeader.documentDescription')}
  element(:explanation_field)             {b.text_field(:id => 'document.documentHeader.explanation')}
  # Global Input Buttons
  element(:approve_button)                {b.div(:id => 'globalbuttons').input(:title => 'blanket approve')}
  element(:save_button)                   {b.div(:id => 'globalbuttons').input(:title => 'save')}
  element(:submit_button)                 {b.div(:id => 'globalbuttons').input(:title => 'submit')}
  element(:calculate_button)              {b.div(:id => 'globalbuttons').input(:title => 'Calculate')}
  element(:close_button)                  {b.div(:id => 'globalbuttons').input(:title => 'close')}
  element(:cancel_button)                 {b.div(:id => 'globalbuttons').input(:title => 'cancel')}
  element(:copy_button)                   {b.div(:id => 'globalbuttons').input(:title => 'Copy current document')}
  element(:send_ad_hoc_button)            {b.div(:id => 'globalbuttons').input(:title => 'Send AdHoc Requests')}
  element(:reload_button)                 {b.div(:id => 'globalbuttons').input(:title => 'reload')}
  # Confirmation Screen Buttons
  element(:close_yes_button)              {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button0')}
  element(:close_no_button)               {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button1')}
  element(:cancel_yes_button)             {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button0')}
  element(:cancel_no_button)              {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button1')}
  # Messages
  element(:save_message)                  {b.div(:class => 'left-errmsg').div(:text => /Document was successfully saved\./)}
  element(:submit_message)                {b.div(:class => 'left-errmsg').div(:text => /Document was successfully submitted\./)}
  element(:error_message)                 {b.div(:class => 'left-errmsg').div(:class => 'error', :text => /error/, :text => /found on page/)}
  element(:generic_message)               {b.div(:class => 'left-errmsg').div}
  # Multiple Error Message Components     Watir::HTMLElementCollection
  element(:errors_in_tab)                 {b.strongs(:text => /Errors found in this Section\:/)}
end

#wait_for_elementsObject

Wait for the following elements to be loaded when opening an E-Document page.



61
62
63
64
65
# File 'lib/olefs/common/e_doc.rb', line 61

def wait_for_elements
  @wait_on << :title
  @wait_on << :document_id
  super
end