ole-qa-framework 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. data/CHANGELOG.md +882 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +45 -0
  4. data/LICENSE.md +14 -0
  5. data/README.md +17 -0
  6. data/Rakefile.rb +25 -0
  7. data/examples/README.md +57 -0
  8. data/examples/create_bib_record.rb +64 -0
  9. data/examples/create_requisition.rb +96 -0
  10. data/examples/purap_workflow_test.rb +185 -0
  11. data/lib/common/common_object.rb +57 -0
  12. data/lib/common/data_object.rb +21 -0
  13. data/lib/common/line_object.rb +44 -0
  14. data/lib/common/page.rb +72 -0
  15. data/lib/common/subline_object.rb +47 -0
  16. data/lib/config/default_options.yml +7 -0
  17. data/lib/docstore/docstore.rb +13 -0
  18. data/lib/module/qa_data_helpers.rb +17 -0
  19. data/lib/module/qa_helpers.rb +153 -0
  20. data/lib/module/qa_page_helpers.rb +33 -0
  21. data/lib/ole-qa-framework.rb +178 -0
  22. data/lib/ole_qa_framework/COMPATIBILITY.rb +20 -0
  23. data/lib/ole_qa_framework/VERSION.rb +20 -0
  24. data/lib/olefs/common/e_doc.rb +79 -0
  25. data/lib/olefs/common/line_object.rb +39 -0
  26. data/lib/olefs/common/lookup.rb +30 -0
  27. data/lib/olefs/common/purap_document.rb +73 -0
  28. data/lib/olefs/objects/line_item.rb +105 -0
  29. data/lib/olefs/objects/new_line_item.rb +44 -0
  30. data/lib/olefs/objects/new_preq_line_item.rb +43 -0
  31. data/lib/olefs/objects/new_receiving_line.rb +42 -0
  32. data/lib/olefs/objects/preq_line_item.rb +68 -0
  33. data/lib/olefs/objects/receiving_line.rb +88 -0
  34. data/lib/olefs/pages/building_lookup.rb +36 -0
  35. data/lib/olefs/pages/main_menu.rb +23 -0
  36. data/lib/olefs/pages/payment_request.rb +67 -0
  37. data/lib/olefs/pages/payment_request_creation.rb +44 -0
  38. data/lib/olefs/pages/purchase_order.rb +68 -0
  39. data/lib/olefs/pages/receiving_document.rb +49 -0
  40. data/lib/olefs/pages/requisition.rb +61 -0
  41. data/lib/olefs/pages/vendor_lookup.rb +40 -0
  42. data/lib/olefs/subobjects/accounting_line.rb +46 -0
  43. data/lib/olefs/subobjects/copies_line.rb +32 -0
  44. data/lib/olefs/subobjects/exception_notes_line.rb +26 -0
  45. data/lib/olefs/subobjects/invoice_notes_line.rb +25 -0
  46. data/lib/olefs/subobjects/new_accounting_line.rb +43 -0
  47. data/lib/olefs/subobjects/new_copies_line.rb +37 -0
  48. data/lib/olefs/subobjects/new_exception_notes_line.rb +30 -0
  49. data/lib/olefs/subobjects/new_invoice_notes_line.rb +35 -0
  50. data/lib/olefs/subobjects/new_notes_line.rb +36 -0
  51. data/lib/olefs/subobjects/new_receipt_notes_line.rb +35 -0
  52. data/lib/olefs/subobjects/notes_line.rb +29 -0
  53. data/lib/olefs/subobjects/processing_line.rb +24 -0
  54. data/lib/olefs/subobjects/receipt_notes_line.rb +25 -0
  55. data/lib/olels/common/e_doc.rb +23 -0
  56. data/lib/olels/common/editor.rb +92 -0
  57. data/lib/olels/common/line_object.rb +39 -0
  58. data/lib/olels/common/lookup.rb +30 -0
  59. data/lib/olels/objects/access_info_line.rb +25 -0
  60. data/lib/olels/objects/data_line.rb +31 -0
  61. data/lib/olels/objects/editor_note.rb +79 -0
  62. data/lib/olels/objects/holdings_note.rb +26 -0
  63. data/lib/olels/objects/item_note.rb +26 -0
  64. data/lib/olels/objects/ownership_extent_line.rb +40 -0
  65. data/lib/olels/pages/bib_editor.rb +63 -0
  66. data/lib/olels/pages/describe_workbench.rb +42 -0
  67. data/lib/olels/pages/instance_editor.rb +80 -0
  68. data/lib/olels/pages/item_editor.rb +91 -0
  69. data/lib/olels/pages/loan.rb +102 -0
  70. data/lib/olels/pages/main_menu.rb +31 -0
  71. data/lib/olels/pages/patron_lookup.rb +44 -0
  72. data/lib/olels/pages/return.rb +64 -0
  73. data/lib/olels/subobjects/ownership_note.rb +26 -0
  74. data/ole-qa-framework.gemspec +30 -0
  75. data/pkg/ole-qa-framework-2.1.0.gem +0 -0
  76. data/spec/common/browser_spec.rb +37 -0
  77. data/spec/common/data_object_spec.rb +37 -0
  78. data/spec/common/line_object_spec.rb +49 -0
  79. data/spec/common/page_spec.rb +44 -0
  80. data/spec/common/subline_object_spec.rb +54 -0
  81. data/spec/modules/qa_helpers_spec.rb +55 -0
  82. data/spec/modules/qa_page_helpers_spec.rb +43 -0
  83. data/spec/olefs/accounting_line_spec.rb +85 -0
  84. data/spec/olefs/building_lookup_spec.rb +45 -0
  85. data/spec/olefs/copies_line_spec.rb +70 -0
  86. data/spec/olefs/edocs_spec.rb +75 -0
  87. data/spec/olefs/exception_notes_line_spec.rb +52 -0
  88. data/spec/olefs/invoice_notes_line_spec.rb +45 -0
  89. data/spec/olefs/line_item_spec.rb +155 -0
  90. data/spec/olefs/lookup_spec.rb +44 -0
  91. data/spec/olefs/main_menu_spec.rb +34 -0
  92. data/spec/olefs/notes_line_spec.rb +65 -0
  93. data/spec/olefs/patron_lookup_spec.rb +54 -0
  94. data/spec/olefs/payment_request_spec.rb +85 -0
  95. data/spec/olefs/preq_creation_spec.rb +43 -0
  96. data/spec/olefs/preq_line_item_spec.rb +111 -0
  97. data/spec/olefs/processing_line_spec.rb +44 -0
  98. data/spec/olefs/purap_document_spec.rb +58 -0
  99. data/spec/olefs/purchase_order_spec.rb +77 -0
  100. data/spec/olefs/receipt_notes_line_spec.rb +54 -0
  101. data/spec/olefs/receive_spec.rb +66 -0
  102. data/spec/olefs/receiving_line_spec.rb +125 -0
  103. data/spec/olefs/requisition_spec.rb +83 -0
  104. data/spec/olefs/vendor_lookup_spec.rb +49 -0
  105. data/spec/olels/access_info_line_spec.rb +40 -0
  106. data/spec/olels/bib_editor_spec.rb +84 -0
  107. data/spec/olels/data_line_spec.rb +44 -0
  108. data/spec/olels/describe_workbench_spec.rb +44 -0
  109. data/spec/olels/editor_spec.rb +56 -0
  110. data/spec/olels/edocs_spec.rb +42 -0
  111. data/spec/olels/holdings_note_spec_spec.rb +41 -0
  112. data/spec/olels/instance_editor_spec.rb +81 -0
  113. data/spec/olels/item_editor_spec.rb +94 -0
  114. data/spec/olels/item_note_spec.rb +41 -0
  115. data/spec/olels/loan_spec.rb +104 -0
  116. data/spec/olels/lookup_spec.rb +38 -0
  117. data/spec/olels/main_menu_spec.rb +35 -0
  118. data/spec/olels/ownership_extent_line_spec.rb +58 -0
  119. data/spec/olels/ownership_note_spec.rb +41 -0
  120. data/spec/olels/return_spec.rb +72 -0
  121. data/spec/spec_helper.rb +21 -0
  122. data/spec/workflows/purap_spec.rb +221 -0
  123. metadata +313 -0
@@ -0,0 +1,178 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Copyright 2005-2013 The Kuali Foundation
4
+ #
5
+ # Licensed under the Educational Community License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at:
8
+ #
9
+ # http://www.opensource.org/licenses/ecl2.php
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ module OLE_QA
18
+ module Framework
19
+ # Load open-uri for DocStore Page Parsing
20
+ require 'open-uri'
21
+ require 'yaml'
22
+ require 'headless'
23
+ require 'watir-webdriver'
24
+
25
+ # Add absolute directory to $LOAD_PATH
26
+ @libdir = File.expand_path(File.dirname(__FILE__))
27
+ $LOAD_PATH.unshift(@libdir) unless $LOAD_PATH.include?(@libdir)
28
+
29
+ # Return absolute path from which the file was run
30
+ def self.load_dir
31
+ @libdir
32
+ end
33
+
34
+ # Load libraries from absolute path
35
+ def self.load_libs(filedir, filename = "*.rb")
36
+ Dir[@libdir + filedir + filename].sort.each do |file|
37
+ require file
38
+ end
39
+ end
40
+
41
+ # Load main class libraries
42
+ load_libs("/ole_qa_framework/")
43
+
44
+ # Load all independent modules
45
+ load_libs("/module/")
46
+
47
+ # Load Page & Element Definitions.
48
+ # Main directory is loaded first, then subdirectories in alphabetical order.
49
+ # If pages or elements need to be inherited by subclasses, put them in a (foo)/common/ directory.
50
+ # Subobject directories (foo)/subobjects/ should be loaded before object directories (foo)/objects/ for inheritance.
51
+ load_libs("/common/")
52
+ # load_libs("/olefs/")
53
+ load_libs("/olefs/common/")
54
+ load_libs("/olefs/subobjects/")
55
+ load_libs("/olefs/objects/")
56
+ load_libs("/olefs/pages/")
57
+ load_libs("/olels/common/")
58
+ load_libs("/olels/subobjects/")
59
+ load_libs("/olels/objects/")
60
+ load_libs("/olels/pages/")
61
+ # load_libs("/docstore/")
62
+
63
+ # Initialize wait variables to 0 for now. They will be set programatically in {OLE_QA::Framework::Session}.
64
+ @explicit_wait = 0
65
+ @doc_wait = 0
66
+
67
+ # Set accessor methods for explicit_wait & doc_wait, to be used mainly by OLE_QA::Tools (ole-qa-tools).
68
+ class << self
69
+ attr_reader :explicit_wait, :doc_wait
70
+ end
71
+
72
+ # Handle Browser Functions, Headless Session
73
+ # Invoke with @ole = Session.new(opts)
74
+ # Exit with @ole.quit
75
+ #
76
+ # Default options loaded from
77
+ # lib/config/default_options.yml
78
+ #
79
+ class Session
80
+
81
+ # OLE Installation Base URL
82
+ # - Also serves as OLE Financial System Main Menu URL
83
+ attr_reader :base_url
84
+ alias :fs_url :base_url
85
+
86
+ # OLE Library System Base URL
87
+ attr_reader :ls_url
88
+
89
+ # Wait period (in seconds) used by OLE QAF Web Element functions
90
+ attr_accessor :explicit_wait
91
+
92
+ # The options with which this OLE_QA Framework Session was invoked
93
+ attr_reader :options
94
+
95
+ # Options hash keys:
96
+ # :base_url => "http://tst.ole.kuali.org/"
97
+ # (URL for OLE Installation)
98
+ # :ls_url => "http://tst.rice2.ole.kuali.org"
99
+ # (URL for OLE Library System Rice Instance)
100
+ # :headless => true/false
101
+ # (Use Headless gem to handle XVFB session)
102
+ # :implicit_wait => NN
103
+ # (Set Selenium Webdriver's default wait period)
104
+ # :explicit_wait => NN
105
+ # (Set the wait period used by custom wait functions)
106
+ # :doc_wait => NN
107
+ # (Set the wait period for eDoc routing to complete)
108
+ # :browser => selenium_webdriver
109
+ # (Where browser is a Selenium WebDriver session)
110
+ #
111
+ # To configure the default options, edit
112
+ # lib/config/default_options.yml
113
+ #
114
+ def initialize( options={} )
115
+ yaml_configuration = File.open(OLE_QA::Framework::load_dir + '/config/default_options.yml', 'r')
116
+ options_defaults = YAML.load(yaml_configuration)
117
+ yaml_configuration.close
118
+ @options = options_defaults.merge(options)
119
+
120
+ # Start headless session if requested
121
+ if @options[:headless?]
122
+ @headless = Headless.new
123
+ @headless.start
124
+ end
125
+
126
+ # Globalize options to accessors
127
+ @base_url = @options[:base_url]
128
+ @ls_url = @options[:ls_url]
129
+ @explicit_wait = @options[:explicit_wait]
130
+ @doc_wait = @options[:doc_wait]
131
+
132
+ # Pass explicit_wait to a module accessor for use with OLE_QA::Tools
133
+ OLE_QA::Framework.instance_variable_set(:@explicit_wait,@options[:explicit_wait])
134
+
135
+ # Pass doc_wait to a module accessor for use with OLE_QA::Tools
136
+ OLE_QA::Framework.instance_variable_set(:@doc_wait,@options[:doc_wait])
137
+
138
+ # Browser Start
139
+ if @options.has_key?(:browser) && @options[:browser].class == Watir::Browser
140
+ @browser = @options[:browser]
141
+ else
142
+ @browser = Watir::Browser.new :firefox
143
+ @browser.driver.manage.timeouts.implicit_wait = @options[:implicit_wait]
144
+ end
145
+
146
+ end
147
+
148
+ # Access Watir-Webdriver's browser session.
149
+ def browser
150
+ @browser
151
+ end
152
+
153
+ # Access Watir-Webdriver's Window Handling Method
154
+ def windows
155
+ @browser.windows
156
+ end
157
+
158
+ # Open a page via URL. (Defaults to @base_url.)
159
+ def open(url = @base_url)
160
+ @browser.goto(url)
161
+ end
162
+
163
+ # Teardown the OLE QA Framework.
164
+ # - Exit the Selenium WebDriver browser session.
165
+ # - Exit the Headless (XVFB) session if necessary.
166
+ def quit
167
+ @browser.quit
168
+ if @options[:headless?] then
169
+ @headless.destroy
170
+ end
171
+ end
172
+ end
173
+
174
+ # Define OLE_QA::Framework::Error.
175
+ class Error < StandardError
176
+ end
177
+ end
178
+ end
@@ -0,0 +1,20 @@
1
+ # Copyright 2005-2013 The Kuali Foundation
2
+ #
3
+ # Licensed under the Educational Community License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+ #
7
+ # http://www.opensource.org/licenses/ecl2.php
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module OLE_QA
16
+ module Framework
17
+ # The most recent version of OLE with which this framework is compatible.
18
+ OLE_VERSION = '0.8.0 - 1.0.0-M1-r12784 2013-07-03'
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # Copyright 2005-2013 The Kuali Foundation
2
+ #
3
+ # Licensed under the Educational Community License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+ #
7
+ # http://www.opensource.org/licenses/ecl2.php
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module OLE_QA
16
+ module Framework
17
+ # The version number for this project.
18
+ VERSION = '2.1.0'
19
+ end
20
+ end
@@ -0,0 +1,79 @@
1
+ # Copyright 2005-2013 The Kuali Foundation
2
+ #
3
+ # Licensed under the Educational Community License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+ #
7
+ # http://www.opensource.org/licenses/ecl2.php
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module OLE_QA::Framework::OLEFS
16
+
17
+ # This class contains element definitions common to OLE Financial System E-Docs.
18
+ # Element definitions are stored in lib/olefs/e_doc/elements.yml
19
+ class E_Doc < OLE_QA::Framework::Page
20
+ # Automatically set element definitions on the E-Document object.
21
+ # @note This method is automagically invoked on any Page object. (see {OLE_QA::Framework::OLEFS::Page#initialize})
22
+ def set_elements
23
+ super
24
+ # General Info
25
+ element(:title) {b.div(:id => 'headerarea').h1}
26
+ # Header Area
27
+ element(:document_id) {b.th(:text => /Doc Nbr\:/).parent.td(:index => 0)}
28
+ element(:document_status) {b.th(:text => /Status\:/).parent.td(:index => 1)}
29
+ element(:document_type_id) {b.table(:class => 'headerinfo').tbody.tr(:index => 2).td(:index => 0)}
30
+ element(:document_type_status) {b.table(:class => 'headerinfo').tbody.tr(:index => 2).td(:index => 1)}
31
+ element(:document_create_date) {b.table(:class => 'headerinfo').tbody.tr(:index => 1).td(:index => 1)}
32
+ # Document Overview
33
+ element(:document_overview_tab_toggle) {b.input(:id => 'tab-DocumentOverview-imageToggle')}
34
+ element(:description_field) {b.text_field(:id => 'document.documentHeader.documentDescription')}
35
+ element(:explanation_field) {b.text_field(:id => 'document.documentHeader.explanation')}
36
+ # Global Input Buttons
37
+ element(:approve_button) {b.div(:id => 'globalbuttons').input(:title => 'blanket approve')}
38
+ element(:save_button) {b.div(:id => 'globalbuttons').input(:title => 'save')}
39
+ element(:submit_button) {b.div(:id => 'globalbuttons').input(:title => 'submit')}
40
+ element(:calculate_button) {b.div(:id => 'globalbuttons').input(:title => 'Calculate')}
41
+ element(:close_button) {b.div(:id => 'globalbuttons').input(:title => 'close')}
42
+ element(:cancel_button) {b.div(:id => 'globalbuttons').input(:title => 'cancel')}
43
+ element(:copy_button) {b.div(:id => 'globalbuttons').input(:title => 'Copy current document')}
44
+ element(:send_ad_hoc_button) {b.div(:id => 'globalbuttons').input(:title => 'Send AdHoc Requests')}
45
+ element(:reload_button) {b.div(:id => 'globalbuttons').input(:title => 'reload')}
46
+ # Confirmation Screen Buttons
47
+ element(:close_yes_button) {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button0')}
48
+ element(:close_no_button) {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button1')}
49
+ element(:cancel_yes_button) {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button0')}
50
+ element(:cancel_no_button) {b.div(:id => 'globalbuttons').input(:name => 'methodToCall.processAnswer.button1')}
51
+ # Messages
52
+ element(:save_message) {b.div(:class => 'left-errmsg').div(:text => /Document was successfully saved\./)}
53
+ element(:submit_message) {b.div(:class => 'left-errmsg').div(:text => /Document was successfully submitted\./)}
54
+ element(:error_message) {b.div(:class => 'left-errmsg').div(:class => 'error', :text => /error/, :text => /found on page/)}
55
+ element(:generic_message) {b.div(:class => 'left-errmsg').div}
56
+ # Multiple Error Message Components Watir::HTMLElementCollection
57
+ element(:errors_in_tab) {b.strongs(:text => /Errors found in this Section\:/)}
58
+ end
59
+
60
+ # Wait for the following elements to be loaded when opening an E-Document page.
61
+ def wait_for_elements
62
+ @wait_on << :title
63
+ @wait_on << :document_id
64
+ super
65
+ end
66
+
67
+ # Returns an array of both "Errors in this Section" messages and individual error messages from each section.
68
+ def get_error_array
69
+ error_array = Array.new
70
+ self.errors_in_tab.each do |error_in_tab|
71
+ error_array << error_in_tab
72
+ error_in_tab.parent.divs.each do |error|
73
+ error_array << error
74
+ end
75
+ end
76
+ error_array
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,39 @@
1
+ # Copyright 2005-2013 The Kuali Foundation
2
+ #
3
+ # Licensed under the Educational Community License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+ #
7
+ # http://www.opensource.org/licenses/ecl2.php
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module OLE_QA::Framework::OLEFS
16
+ # A line object with methods specific to OLEFS line objects.
17
+ class Line_Object < OLE_QA::Framework::Line_Object
18
+ def initialize(ole_session, line_number)
19
+ super(ole_session, line_number)
20
+ set_sublines if defined?(self.set_sublines)
21
+ end
22
+
23
+ def create_subline(instance_name, class_name, which=0)
24
+ raise StandardError, "Subline object already exists. (#{instance_name})" if self.instance_variables.include?("@#{instance_name}".to_sym)
25
+ new_line_name = instance_name
26
+ make_accessor(:"#{new_line_name}")
27
+ klas = OLE_QA::Framework::OLEFS.const_get(:"#{class_name}")
28
+ instance_variable_set(:"@#{new_line_name}", klas.new(@ole, @line_number, which))
29
+ end
30
+ alias_method(:add_subline,:create_subline)
31
+
32
+ def remove_subline(instance_name)
33
+ raise StandardError, "Subline object does not exist. (#{instance_name})" unless self.instance_variables.include?("@#{instance_name}".to_sym)
34
+ remove_instance_variable("@#{instance_name}".to_sym)
35
+ unmake_attr(instance_name.to_sym)
36
+ end
37
+ alias_method(:delete_subline,:remove_subline)
38
+ end
39
+ end
@@ -0,0 +1,30 @@
1
+ # Copyright 2005-2013 The Kuali Foundation
2
+ #
3
+ # Licensed under the Educational Community License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+ #
7
+ # http://www.opensource.org/licenses/ecl2.php
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module OLE_QA::Framework::OLEFS
16
+ # A Lookup Screen in OLEFS
17
+ class Lookup < OLE_QA::Framework::Page
18
+ # Set lookup page elements.
19
+ def set_elements
20
+ super
21
+ element(:title) {b.h1(:xpath => "//div[@id='headerarea-small']/h1")}
22
+ element(:active_indicator_yes) {b.radio(:id => "activeYes")}
23
+ element(:active_indicator_no) {b.radio(:id => "activeNo")}
24
+ element(:active_indicator_both) {b.radio(:id => "activeBoth")}
25
+ element(:search_button) {b.input(:title => "search")}
26
+ element(:clear_button) {b.input(:title => "clear")}
27
+ element(:cancel_button) {b.input(:title => "cancel")}
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,73 @@
1
+ # Copyright 2005-2013 The Kuali Foundation
2
+ #
3
+ # Licensed under the Educational Community License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at:
6
+ #
7
+ # http://www.opensource.org/licenses/ecl2.php
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module OLE_QA::Framework::OLEFS
16
+ # An OLE Financial System PURchasing/Accounts Payable Document
17
+ class PURAP_Document < E_Doc
18
+ def initialize(ole_session, url)
19
+ super(ole_session, url)
20
+ set_lines if defined?(self.set_lines)
21
+ end
22
+
23
+ # Set PURAP Document Elements.
24
+ def set_elements
25
+ super
26
+ # View Related Documents Tab
27
+ element(:view_related_tab_toggle) {b.input(:id => "tab-ViewRelatedDocuments-imageToggle")}
28
+ element(:view_related_po_link) {b.a(:xpath => "//div[@id='tab-ViewRelatedDocuments-div']/descendant::h3[contains(text(),'Purchase Order')]/a")}
29
+ element(:view_related_requisition_link) {b.a(:xpath => "//div[@id='tab-ViewRelatedDocuments-div']/descendant::h3[contains(text(),'Requisition')]/a")}
30
+ # Delivery Tab
31
+ element(:delivery_tab_toggle) {b.input(:id => "tab-Delivery-imageToggle")}
32
+ element(:building_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/div/table/tbody/tr[2]/td[1]")}
33
+ element(:campus_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/div/table/tbody/tr[1]/td[1]")}
34
+ element(:closed_room_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/div/table/tbody/tr[5]/td[1]")}
35
+ element(:closed_building_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/div/table/tbody/tr[2]/td[1]")}
36
+ element(:closed_campus_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/div/table/tbody/tr[1]/td[1]")}
37
+ element(:closed_address_1_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[3]/th[1]/following-sibling::td[1]")}
38
+ element(:closed_address_2_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[4]/th[1]/following-sibling::td[1]")}
39
+ element(:closed_city_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[6]/th[1]/following-sibling::td[1]")}
40
+ element(:closed_state_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[7]/th[1]/following-sibling::td[1]")}
41
+ element(:closed_postal_code_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[8]/th[1]/following-sibling::td[1]")}
42
+ element(:closed_country_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[9]/th[1]/following-sibling::td[1]")}
43
+ element(:closed_delivery_to_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[1]/th[1]/following-sibling::td[2]")}
44
+ element(:closed_delivery_phone_number_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[2]/th[1]/following-sibling::td[2]")}
45
+ element(:closed_email_field) {b.td(:xpath => "//div[@id='tab-Delivery-div']/descendant::tr[3]/th[1]/following-sibling::td[2]")}
46
+ # Vendor Tab
47
+ element(:vendor_tab_toggle) {b.input(:id => "tab-Vendor-imageToggle")}
48
+ element(:closed_vendor_name_field) {b.td(:xpath => "//tr/th[div[contains(text(),'Suggested Vendor:')]]/following-sibling::td[1]")}
49
+ # Route Log Tab
50
+ element(:route_log_tab_toggle) {b.input(:id => "tab-RouteLog-imageToggle")}
51
+ # element(:actions_taken) {b.bs(:xpath => "//div[@id='tab-ActionsTaken-div']/div[1]/table/tbody/tr/td[1]/b")}
52
+ # element(:actions_taken_by) {b.as(:xpath => "//div[@id='tab-ActionsTaken-div']/div[1]/table/tbody/tr/td[2]/a")}
53
+ end
54
+
55
+ # Create a Line Object on a PURAP Document page.
56
+ def create_line(instance_name, class_name, which=0)
57
+ raise StandardError, "Line object already exists. (#{instance_name})" if self.instance_variables.include?("@#{instance_name}".to_sym)
58
+ new_line_name = instance_name
59
+ make_accessor(:"#{instance_name}")
60
+ klas = OLE_QA::Framework::OLEFS.const_get(:"#{class_name}")
61
+ instance_variable_set(:"@#{new_line_name}", klas.new(@ole, which))
62
+ end
63
+ alias_method(:add_line,:create_line)
64
+
65
+ # Remove a Line Object from a PURAP Document page.
66
+ def remove_line(instance_name)
67
+ raise StandardError, "Line object does not exist. (#{instance_name})" unless self.instance_variables.include?("@#{instance_name}".to_sym)
68
+ remove_instance_variable("@#{instance_name}".to_sym)
69
+ unmake_attr(instance_name.to_sym)
70
+ end
71
+ alias_method(:delete_line,:remove_line)
72
+ end
73
+ end