ole-qa-framework 2.7.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/CHANGELOG.md +15 -0
  2. data/lib/common/common_object.rb +1 -1
  3. data/lib/common/line_object.rb +35 -10
  4. data/lib/common/page.rb +5 -0
  5. data/lib/common/subline_object.rb +8 -24
  6. data/lib/module/qa_helpers.rb +1 -1
  7. data/lib/module/qa_page_helpers.rb +24 -0
  8. data/lib/ole_qa_framework/VERSION.rb +1 -1
  9. data/lib/olefs/common/purap_document.rb +20 -25
  10. data/lib/olefs/objects/invoice_current_item.rb +1 -1
  11. data/lib/olefs/objects/invoice_line.rb +5 -2
  12. data/lib/olefs/objects/line_item.rb +44 -50
  13. data/lib/olefs/objects/receiving_line.rb +22 -52
  14. data/lib/olefs/pages/invoice.rb +5 -2
  15. data/lib/olefs/pages/payment_request.rb +0 -39
  16. data/lib/olefs/pages/purchase_order.rb +1 -11
  17. data/lib/olefs/pages/receiving_document.rb +1 -11
  18. data/lib/olefs/pages/requisition.rb +1 -11
  19. data/lib/olefs/subobjects/accounting_line.rb +16 -16
  20. data/lib/olefs/subobjects/copies_line.rb +9 -7
  21. data/lib/olefs/subobjects/exception_notes_line.rb +3 -3
  22. data/lib/olefs/{objects → subobjects}/invoice_line_item.rb +34 -45
  23. data/lib/olefs/subobjects/notes_line.rb +5 -5
  24. data/lib/olefs/subobjects/processing_line.rb +2 -2
  25. data/lib/olefs/subobjects/receipt_notes_line.rb +2 -2
  26. data/lib/olels/common/e_doc.rb +0 -17
  27. data/lib/olels/common/editor.rb +0 -17
  28. data/lib/olels/objects/access_info_line.rb +4 -4
  29. data/lib/olels/objects/control_006_line.rb +6 -6
  30. data/lib/olels/objects/control_007_line.rb +6 -6
  31. data/lib/olels/objects/data_line.rb +7 -7
  32. data/lib/olels/objects/editor_note.rb +3 -3
  33. data/lib/olels/objects/holdings_note.rb +5 -5
  34. data/lib/olels/objects/item_note.rb +5 -5
  35. data/lib/olels/objects/ownership_extent_line.rb +6 -16
  36. data/lib/olels/objects/patron_address_line.rb +33 -33
  37. data/lib/olels/objects/patron_email_line.rb +10 -10
  38. data/lib/olels/objects/patron_phone_line.rb +14 -14
  39. data/lib/olels/pages/bib_editor.rb +3 -44
  40. data/lib/olels/pages/instance_editor.rb +3 -33
  41. data/lib/olels/pages/item_editor.rb +1 -13
  42. data/lib/olels/pages/patron.rb +4 -33
  43. data/lib/olels/pages/return.rb +1 -0
  44. data/lib/olels/pages/staff_upload.rb +1 -0
  45. data/lib/olels/subobjects/ownership_note.rb +4 -4
  46. data/spec/common/line_object_spec.rb +41 -8
  47. data/spec/common/subline_object_spec.rb +9 -19
  48. data/spec/modules/qa_page_helpers_spec.rb +54 -0
  49. data/spec/olefs/accounting_line_spec.rb +9 -30
  50. data/spec/olefs/copies_line_spec.rb +1 -16
  51. data/spec/olefs/exception_notes_line_spec.rb +3 -13
  52. data/spec/olefs/invoice_current_item_spec.rb +1 -1
  53. data/spec/olefs/invoice_line_item_spec.rb +5 -5
  54. data/spec/olefs/invoice_line_spec.rb +2 -2
  55. data/spec/olefs/invoice_spec.rb +2 -2
  56. data/spec/olefs/line_item_spec.rb +32 -67
  57. data/spec/olefs/notes_line_spec.rb +5 -17
  58. data/spec/olefs/payment_request_spec.rb +1 -43
  59. data/spec/olefs/processing_line_spec.rb +5 -4
  60. data/spec/olefs/purap_document_spec.rb +23 -1
  61. data/spec/olefs/purchase_order_spec.rb +4 -18
  62. data/spec/olefs/receipt_notes_line_spec.rb +5 -14
  63. data/spec/olefs/receive_spec.rb +3 -18
  64. data/spec/olefs/receiving_line_spec.rb +35 -74
  65. data/spec/olefs/requisition_spec.rb +5 -19
  66. data/spec/olels/access_info_line_spec.rb +1 -1
  67. data/spec/olels/bib_editor_spec.rb +8 -56
  68. data/spec/olels/data_line_spec.rb +2 -2
  69. data/spec/olels/editor_spec.rb +0 -4
  70. data/spec/olels/{holdings_note_spec_spec.rb → holdings_note_spec.rb} +1 -1
  71. data/spec/olels/instance_editor_spec.rb +8 -31
  72. data/spec/olels/item_editor_spec.rb +4 -14
  73. data/spec/olels/item_note_spec.rb +2 -2
  74. data/spec/olels/ownership_extent_line_spec.rb +6 -16
  75. data/spec/olels/ownership_note_spec.rb +2 -1
  76. data/spec/olels/patron_address_line_spec.rb +1 -1
  77. data/spec/olels/patron_email_line_spec.rb +1 -1
  78. data/spec/olels/patron_phone_line_spec.rb +2 -2
  79. data/spec/olels/patron_spec.rb +8 -40
  80. metadata +7 -30
  81. data/lib/olefs/common/invoice_line_object.rb +0 -37
  82. data/lib/olefs/common/line_object.rb +0 -39
  83. data/lib/olefs/objects/new_line_item.rb +0 -48
  84. data/lib/olefs/objects/new_preq_line_item.rb +0 -43
  85. data/lib/olefs/objects/new_receiving_line.rb +0 -42
  86. data/lib/olefs/objects/preq_line_item.rb +0 -68
  87. data/lib/olefs/pages/payment_request_creation.rb +0 -44
  88. data/lib/olefs/subobjects/invoice_notes_line.rb +0 -25
  89. data/lib/olefs/subobjects/new_accounting_line.rb +0 -43
  90. data/lib/olefs/subobjects/new_copies_line.rb +0 -37
  91. data/lib/olefs/subobjects/new_exception_notes_line.rb +0 -30
  92. data/lib/olefs/subobjects/new_invoice_notes_line.rb +0 -35
  93. data/lib/olefs/subobjects/new_notes_line.rb +0 -36
  94. data/lib/olefs/subobjects/new_receipt_notes_line.rb +0 -35
  95. data/lib/olels/common/line_object.rb +0 -39
  96. data/spec/olefs/invoice_line_object_spec.rb +0 -49
  97. data/spec/olefs/invoice_notes_line_spec.rb +0 -49
  98. data/spec/olefs/preq_creation_spec.rb +0 -47
  99. data/spec/olefs/preq_line_item_spec.rb +0 -111
  100. data/spec/workflows/purap_spec.rb +0 -221
@@ -1,35 +0,0 @@
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 new Invoice Notes Line on an OLE Financial System Payment Request Line.
17
- class New_Invoice_Notes_Line < OLE_QA::Framework::Subline_Object
18
- # Initialize as a subclass of {OLE_QA::Framework::Subline_Object} with a subline_number of 0.
19
- def initialize(ole_session, line_number, which)
20
- super(ole_session, line_number, 0)
21
- end
22
-
23
- # Set elements on a New Invoice Notes Line object.
24
- # @note {OLE_QA::Framework::Line_Object} @line_number and @line_id will be used to
25
- # perform substitutions in identifiers.
26
- # @note {OLE_QA::Framework::Subline_Object} @line_number and @line_id will not be
27
- # need in finding element IDs, as there will only ever be one new
28
- # subline object on each line object.
29
- def set_elements
30
- super
31
- element(:note_field) {b.text_field(:id => "document.item[#{@line_number}].note")}
32
- element(:add_button) {b.input(:name => "methodToCall.addNote.line#{@line_number}")}
33
- end
34
- end
35
- end
@@ -1,36 +0,0 @@
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 new Notes Line on an OLE Financial System PURAP Line Object
17
- class New_Notes_Line < OLE_QA::Framework::Subline_Object
18
- # Initialize as a subclass of {OLE_QA::Framework::Subline_Object} with a subline_number of 0.
19
- def initialize(ole_session, line_number, which)
20
- super(ole_session, line_number, 0)
21
- end
22
-
23
- # Set elements on a New Notes Line object.
24
- # @note {OLE_QA::Framework::Line_Object} @line_number and @line_id will be used to
25
- # perform substitutions in identifiers.
26
- # @note {OLE_QA::Framework::Subline_Object} @line_number and @line_id will not be
27
- # need in finding element IDs, as there will only ever be one new
28
- # subline object on each line object.
29
- def set_elements
30
- super
31
- element(:note_type_selector) {b.select_list(:id => "document.item[#{@line_id}].noteTypeId")}
32
- element(:note_field) {b.text_field(:id => "document.item[#{@line_id}].note")}
33
- element(:add_button) {b.input(:name => "methodToCall.addNote.line#{@line_id}")}
34
- end
35
- end
36
- end
@@ -1,35 +0,0 @@
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 new Receipt Notes Line on an OLE Financial System Receiving Document
17
- class New_Receipt_Notes_Line < OLE_QA::Framework::Subline_Object
18
- # Initialize as a subclass of {OLE_QA::Framework::Subline_Object} with a subline_number of 0.
19
- def initialize(ole_session, line_number, which)
20
- super(ole_session, line_number, 0)
21
- end
22
-
23
- # Set elements on a New Receipt Notes Line object.
24
- # @note {OLE_QA::Framework::Line_Object} @line_number and @line_id will be used to
25
- # perform substitutions in identifiers.
26
- # @note {OLE_QA::Framework::Subline_Object} @line_number and @line_id will not be
27
- # need in finding element IDs, as there will only ever be one new
28
- # subline object on each line object.
29
- def set_elements
30
- super
31
- element(:note_type_selector) {b.select_list(:id => "document.item[#{@line_id}].noteTypeId")}
32
- element(:note_field) {b.text_field(:id => "document.item[#{@line_id}].receiptNotes")}
33
- end
34
- end
35
- end
@@ -1,39 +0,0 @@
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::OLELS
16
- # An OLE Library System Line Object
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)
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::OLELS.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
@@ -1,49 +0,0 @@
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
- require 'rspec'
16
- require 'spec_helper'
17
-
18
- describe 'The OLEFS Invoice Line Object base class' do
19
-
20
- before :all do
21
- @ole = OLE_QA::Framework::Session.new
22
- @line_object = OLE_QA::Framework::OLEFS::Invoice_Line_Object.new(@ole, 1)
23
- end
24
-
25
- after :all do
26
- @ole.quit
27
- end
28
-
29
- it 'should create a new instance' do
30
- @line_object.class.should == OLE_QA::Framework::OLEFS::Invoice_Line_Object
31
- @line_object.class.superclass.should == OLE_QA::Framework::Common_Object
32
- end
33
-
34
- it 'should have a line_number accessor method' do
35
- @line_object.methods.include?(:line_number).should be_true
36
- @line_object.methods.include?(:line_number=).should be_true
37
- end
38
-
39
- it 'should have a line_id reader method' do
40
- @line_object.methods.include?(:line_id).should be_true
41
- @line_object.methods.include?(:line_id=).should be_false
42
- end
43
-
44
- it 'should set the line ID equal to the line number minus one' do
45
- @line_object.line_id.should == 0
46
- @line_object.line_number = 2
47
- @line_object.line_id.should == 1
48
- end
49
- end
@@ -1,49 +0,0 @@
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
- require 'rspec'
16
- require 'spec_helper'
17
-
18
- describe 'An OLEFS Invoice Notes Line object' do
19
-
20
- before :all do
21
- @ole = OLE_QA::Framework::Session.new
22
- @browser = @ole.browser
23
- @invoice_notes = OLE_QA::Framework::OLEFS::Invoice_Notes_Line.new(@ole, 1, 1)
24
- @new_invoice_notes = OLE_QA::Framework::OLEFS::New_Invoice_Notes_Line.new(@ole, 1, 0)
25
- end
26
-
27
- after :all do
28
- @ole.quit
29
- end
30
-
31
- it 'should create a new instance' do
32
- @invoice_notes.class.should == OLE_QA::Framework::OLEFS::Invoice_Notes_Line
33
- @invoice_notes.class.superclass.should == OLE_QA::Framework::Subline_Object
34
- @new_invoice_notes.class.should == OLE_QA::Framework::OLEFS::New_Invoice_Notes_Line
35
- @new_invoice_notes.class.superclass.should == OLE_QA::Framework::Subline_Object
36
- end
37
-
38
- it 'should have invoice notes line elements' do
39
- methods = @invoice_notes.methods
40
- methods.include?(:note_field).should be_true
41
- methods.include?(:delete_button).should be_true
42
- end
43
-
44
- it 'should have new invoice notes line elements' do
45
- methods = @new_invoice_notes.methods
46
- methods.include?(:note_field).should be_true
47
- methods.include?(:add_button).should be_true
48
- end
49
- end
@@ -1,47 +0,0 @@
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
- require 'rspec'
16
- require 'spec_helper'
17
-
18
- describe 'An OLEFS Payment Request Creation page' do
19
-
20
- before :all do
21
- @ole = OLE_QA::Framework::Session.new
22
- @preq_screen = OLE_QA::Framework::OLEFS::PREQ_Creation.new(@ole)
23
- end
24
-
25
- after :all do
26
- @ole.quit
27
- end
28
-
29
- it 'should create a new instance' do
30
- @preq_screen.class.should == OLE_QA::Framework::OLEFS::PREQ_Creation
31
- @preq_screen.class.superclass.should == OLE_QA::Framework::OLEFS::E_Doc
32
- end
33
-
34
- it 'should have PREQ creation screen elements' do
35
- elements = @preq_screen.methods
36
- elements.include?(:purchase_order_number_field).should be_true
37
- elements.include?(:invoice_number_field).should be_true
38
- elements.include?(:invoice_date_field).should be_true
39
- elements.include?(:invoice_amount_field).should be_true
40
- elements.include?(:special_handling_line_1).should be_true
41
- elements.include?(:special_handling_line_2).should be_true
42
- elements.include?(:special_handling_line_3).should be_true
43
- elements.include?(:foreign_invoice_amount_field).should be_true
44
- elements.include?(:continue_button).should be_true
45
- elements.include?(:clear_button).should be_true
46
- end
47
- end
@@ -1,111 +0,0 @@
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
- require 'rspec'
16
- require 'spec_helper'
17
-
18
- describe 'An OLEFS Preq Line Item object' do
19
-
20
- before :all do
21
- @ole = OLE_QA::Framework::Session.new
22
- @browser = @ole.browser
23
- @preq_line_item = OLE_QA::Framework::OLEFS::PREQ_Line_Item.new(@ole, 1)
24
- @new_preq_line = OLE_QA::Framework::OLEFS::New_PREQ_Line_Item.new(@ole, 1)
25
- end
26
-
27
- after :all do
28
- @ole.quit
29
- end
30
-
31
- it 'should create a new instance' do
32
- @preq_line_item.class.should == OLE_QA::Framework::OLEFS::PREQ_Line_Item
33
- @preq_line_item.class.superclass.should == OLE_QA::Framework::OLEFS::Line_Object
34
- @new_preq_line.class.should == OLE_QA::Framework::OLEFS::New_PREQ_Line_Item
35
- @new_preq_line.class.superclass.should == OLE_QA::Framework::OLEFS::Line_Object
36
- end
37
-
38
- it 'should have a browser accessor' do
39
- @preq_line_item.browser.class.should == @ole.browser.class
40
- @new_preq_line.browser.class.should == @ole.browser.class
41
- end
42
-
43
- it 'should have a line number of 1' do
44
- @preq_line_item.line_number.should == 1
45
- end
46
-
47
- it 'should have PREQ line item elements' do
48
- methods = @preq_line_item.methods
49
- methods.include?(:open_quantity_field).should be_true
50
- methods.include?(:po_unit_price_field).should be_true
51
- methods.include?(:format_field).should be_true
52
- methods.include?(:vendor_item_identifier_field).should be_true
53
- methods.include?(:prorated_surcharge_field).should be_true
54
- methods.include?(:unit_cost_field).should be_true
55
- methods.include?(:extended_cost_field).should be_true
56
- methods.include?(:assigned_to_trade_in_field).should be_true
57
- methods.include?(:description_field).should be_true
58
- methods.include?(:number_of_copies_ordered_field).should be_true
59
- methods.include?(:number_of_parts_ordered_field).should be_true
60
- methods.include?(:list_price_field).should be_true
61
- methods.include?(:discount_field).should be_true
62
- methods.include?(:discount_type_selector).should be_true
63
- methods.include?(:edit_bib_button).should be_true
64
- methods.include?(:delete_button).should be_true
65
- methods.include?(:invoice_notes_toggle).should be_true
66
- methods.include?(:accounting_lines_toggle).should be_true
67
- end
68
-
69
- it 'should have new PREQ line elements' do
70
- elements = @new_preq_line.methods
71
- elements.include?(:po_unit_price_field).should be_true
72
- elements.include?(:format_selector).should be_true
73
- elements.include?(:vendor_item_identifier_field).should be_true
74
- elements.include?(:number_of_copies_ordered_field).should be_true
75
- elements.include?(:number_of_parts_ordered_field).should be_true
76
- elements.include?(:list_price_field).should be_true
77
- elements.include?(:discount_field).should be_true
78
- elements.include?(:discount_type_selector).should be_true
79
- elements.include?(:assigned_to_trade_in_checkbox).should be_true
80
- elements.include?(:description_field).should be_true
81
- elements.include?(:new_bib_button).should be_true
82
- elements.include?(:receipt_status_selector).should be_true
83
- elements.include?(:add_button).should be_true
84
- end
85
-
86
- it 'should have sublines' do
87
- @preq_line_item.methods.include?(:new_invoice_notes_line).should be_true
88
- @preq_line_item.methods.include?(:new_accounting_line).should be_true
89
- end
90
-
91
- it 'should create additional sublines' do
92
- @preq_line_item.create_accounting_line(1)
93
- @preq_line_item.methods.include?(:accounting_line_1).should be_true
94
- @preq_line_item.accounting_line_1.class.should == OLE_QA::Framework::OLEFS::Accounting_Line
95
- @preq_line_item.create_invoice_notes_line(1)
96
- @preq_line_item.methods.include?(:invoice_notes_line_1).should be_true
97
- @preq_line_item.invoice_notes_line_1.class.should == OLE_QA::Framework::OLEFS::Invoice_Notes_Line
98
- end
99
-
100
- it 'should remove sublines' do
101
- @preq_line_item.remove_accounting_line(1)
102
- @preq_line_item.methods.include?(:accounting_line_1).should be_false
103
- @preq_line_item.remove_invoice_notes_line(1)
104
- @preq_line_item.methods.include?(:invoice_notes_line_1).should be_false
105
- end
106
-
107
- it 'should not remove sublines which do not exist' do
108
- lambda {@preq_line_item.remove_accounting_line(1)}.should raise_error
109
- lambda {@preq_line_item.remove_invoice_notes_line(1)}.should raise_error
110
- end
111
- end
@@ -1,221 +0,0 @@
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
- require 'rspec'
16
- require 'spec_helper'
17
-
18
- describe 'The OLEFS PURAP workflow' do
19
-
20
- before :all do
21
- @ole = OLE_QA::Framework::Session.new
22
- @requisition = OLE_QA::Framework::OLEFS::Requisition.new(@ole)
23
- @purchase_order = OLE_QA::Framework::OLEFS::Purchase_Order.new(@ole)
24
- @receiving_doc = OLE_QA::Framework::OLEFS::Receiving_Document.new(@ole)
25
- @payment_request = OLE_QA::Framework::OLEFS::Payment_Request.new(@ole)
26
- end
27
-
28
- after :all do
29
- @ole.quit
30
- end
31
-
32
- context "requisition" do
33
-
34
- it 'should open a requisition' do
35
- @requisition.open
36
- @requisition.title.text.strip.should == "Requisition"
37
- end
38
-
39
- it 'should set the description field to PURAP Workflow Test' do
40
- @requisition.description_field.set("PURAP Workflow Test")
41
- @requisition.description_field.value.should == "PURAP Workflow Test"
42
- @requisition.description_field.set("PURAP Workflow Test - #{Time.now}")
43
- end
44
-
45
- it 'should set the building to Wells Library, room 100' do
46
- @requisition.delivery_tab_toggle.click
47
- @requisition.building_search_icon.click
48
- building_lookup = OLE_QA::Framework::OLEFS::Building_Lookup.new(@ole)
49
- building_lookup.wait_for_page_to_load
50
- building_lookup.building_name_field.set("Wells Library")
51
- building_lookup.search_button.click
52
- building_lookup.browser.a(:xpath => "//td[contains(text(),'Wells Library')]/preceding-sibling::td[3]/a").click
53
- @requisition.room_field.set("100")
54
- @requisition.building_field.text.strip.should == "Wells Library"
55
- @requisition.room_field.value.strip.should == "100"
56
- @requisition.delivery_tab_toggle.click
57
- end
58
-
59
- it 'should set the vendor to YBP' do
60
- @requisition.vendor_tab_toggle.click
61
- @requisition.vendor_search_icon.click
62
- vendor_lookup = OLE_QA::Framework::OLEFS::Vendor_Lookup.new(@ole)
63
- vendor_lookup.wait_for_page_to_load
64
- vendor_lookup.vendor_name_field.set("YBP")
65
- vendor_lookup.search_button.click
66
- vendor_lookup.browser.a(:xpath => "//td[a[contains(text(),'YBP Library Services')]]/preceding-sibling::td[1]/a").click
67
- @requisition.closed_vendor_name_field.text.strip.should == "YBP Library Services"
68
- end
69
-
70
- it 'should create a Bib Record' do
71
- @requisition.new_line_item.new_bib_button.click
72
- @ole.browser.windows[-1].use
73
- bib_editor = OLE_QA::Framework::OLELS::Bib_Editor.new(@ole)
74
- bib_editor.wait_for_page_to_load
75
- bib_editor.control_008_link.click
76
- bib_editor.control_008_field.present?.should be_true
77
- bib_editor.control_008_field.set("HELLOWORLD")
78
- bib_editor.control_008_field.value.should == "HELLOWORLD"
79
- bib_editor.data_line_1.tag_field.set("245")
80
- bib_editor.data_line_1.data_field.set("|aTitle of Book")
81
- bib_editor.data_line_1.tag_field.value.should == "245"
82
- bib_editor.data_line_1.data_field.value.should == "|aTitle of Book"
83
- bib_editor.set_button.click
84
- bib_editor.leader_field.value.should_not be_empty
85
- bib_editor.submit_button.click
86
- bib_editor.message.text.include?("successfully created").should be_true
87
- bib_editor.close_button.click
88
- @ole.browser.windows[0].use
89
- end
90
-
91
- it 'should add the line item' do
92
- @requisition.new_line_item.list_price_field.set("235")
93
- @requisition.new_line_item.add_button.click
94
- @requisition.add_line_item(1)
95
- @requisition.line_item_1.list_price_field.value.should == "235.00"
96
- @requisition.line_item_1.description_field.text.strip.should == "Title of Book"
97
- end
98
-
99
- it 'should add an accounting line' do
100
- @requisition.line_item_1.accounting_lines_toggle.click
101
- @requisition.line_item_1.new_accounting_line.chart_selector.wait_until_present
102
- @requisition.line_item_1.new_accounting_line.chart_selector.select("BL")
103
- @requisition.line_item_1.new_accounting_line.account_number_field.set("2947494")
104
- @requisition.line_item_1.new_accounting_line.object_field.set("7112")
105
- @requisition.line_item_1.new_accounting_line.percent_field.set("100.00")
106
- @requisition.line_item_1.new_accounting_line.add_button.click
107
- @requisition.line_item_1.add_accounting_line(1)
108
- @requisition.line_item_1.accounting_line_1.chart_selector.wait_until_present
109
- @requisition.line_item_1.accounting_line_1.chart_selector.value.should == "BL"
110
- @requisition.line_item_1.accounting_line_1.account_number_field.value.should == "2947494"
111
- @requisition.line_item_1.accounting_line_1.object_field.value.should == "7112"
112
- @requisition.line_item_1.accounting_line_1.percent_field.value.should == "100.00"
113
- end
114
-
115
- it 'should set the additional info phone number' do
116
- @requisition.additional_info_tab_toggle.click
117
- @requisition.additional_info_phone_number_field.set("812-555-5555")
118
- @requisition.additional_info_phone_number_field.value.should == "812-555-5555"
119
- @requisition.additional_info_tab_toggle.click
120
- end
121
-
122
- it 'should submit the requisition' do
123
- @requisition.submit_button.click
124
- @requisition.wait_for_page_to_load
125
- @requisition.generic_message.wait_until_present
126
- @requisition.submit_message.present?.should be_true
127
- end
128
-
129
- it 'should go to final status' do
130
- sleep 15
131
- @requisition.reload_button.click
132
- @requisition.wait_for_page_to_load
133
- outcome = @requisition.document_status.text.strip
134
- outcome.should == "FINAL"
135
- end
136
-
137
- it 'should have a related PO' do
138
- @requisition.view_related_tab_toggle.click
139
- @requisition.view_related_po_link.wait_until_present
140
- @requisition.view_related_po_link.href.should_not be_empty
141
- end
142
-
143
- after :all do
144
- @ole.browser.goto(@requisition.view_related_po_link.href)
145
- end
146
- end
147
-
148
- context "purchase order" do
149
-
150
- it 'should create a new purchase order' do
151
- @purchase_order = OLE_QA::Framework::OLEFS::Purchase_Order.new(@ole)
152
- end
153
-
154
- it 'should wait for the purchase order to load' do
155
- @purchase_order.wait_for_page_to_load
156
- end
157
-
158
- it 'should be a purchase order' do
159
- @purchase_order.title.text.strip.should == "Purchase Order"
160
- end
161
- end
162
-
163
- context "receive and pay" do
164
- before :all do
165
- @po_number = @purchase_order.document_type_id.text.strip
166
- @po_total = @purchase_order.grand_total_field.text.strip
167
- end
168
-
169
- it 'should receive the purchase order' do
170
- @purchase_order.receiving_button.click
171
- @receiving_doc.wait_for_page_to_load
172
- end
173
-
174
- it 'should fill in the receiving document' do
175
- @receiving_doc.create_receiving_line(1)
176
- @receiving_doc.receiving_line_1.item_received_quantity_field.value.should == "1"
177
- @receiving_doc.receiving_line_1.item_received_parts_field.value.should == "1"
178
- end
179
-
180
- it 'should submit the receiving document' do
181
- @receiving_doc.submit_button.click
182
- @receiving_doc.wait_for_page_to_load
183
- @receiving_doc.submit_message.present?.should be_true
184
- end
185
-
186
- it 'should create a payment request' do
187
- preq_creation_screen = OLE_QA::Framework::OLEFS::PREQ_Creation.new(@ole)
188
- preq_creation_screen.open
189
- preq_creation_screen.purchase_order_number_field.set(@po_number)
190
- preq_creation_screen.purchase_order_number_field.value.strip.should == @po_number
191
- foo = Time.now.strftime("%m/%d/%y")
192
- preq_creation_screen.invoice_date_field.set(foo)
193
- preq_creation_screen.invoice_date_field.value.strip.should == foo
194
- bar = Array.new(12){rand(36).to_s(36)}.join
195
- preq_creation_screen.invoice_number_field.set(bar)
196
- preq_creation_screen.invoice_number_field.value.strip.should == bar
197
- preq_creation_screen.invoice_amount_field.set(@po_total)
198
- preq_creation_screen.invoice_amount_field.value.strip.should == @po_total
199
- preq_creation_screen.continue_button.click
200
- end
201
-
202
- it 'should open the payment request' do
203
- @payment_request.wait_for_page_to_load
204
- @payment_request.title.text.strip.should == "Payment Request"
205
- end
206
-
207
- it 'should set the payment method to be used' do
208
- @payment_request.payment_method_selector.select("Check")
209
- @payment_request.payment_method_selector.selected?("Check").should be_true
210
- end
211
-
212
- it 'should calculate the payment request' do
213
- @payment_request.calculate_button.click
214
- end
215
-
216
- it 'should blanket approve the payment request' do
217
- @payment_request.approve_button.click
218
- @ole.browser.title.should == "Kuali Portal Index"
219
- end
220
- end
221
- end