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.
- data/CHANGELOG.md +882 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +45 -0
- data/LICENSE.md +14 -0
- data/README.md +17 -0
- data/Rakefile.rb +25 -0
- data/examples/README.md +57 -0
- data/examples/create_bib_record.rb +64 -0
- data/examples/create_requisition.rb +96 -0
- data/examples/purap_workflow_test.rb +185 -0
- data/lib/common/common_object.rb +57 -0
- data/lib/common/data_object.rb +21 -0
- data/lib/common/line_object.rb +44 -0
- data/lib/common/page.rb +72 -0
- data/lib/common/subline_object.rb +47 -0
- data/lib/config/default_options.yml +7 -0
- data/lib/docstore/docstore.rb +13 -0
- data/lib/module/qa_data_helpers.rb +17 -0
- data/lib/module/qa_helpers.rb +153 -0
- data/lib/module/qa_page_helpers.rb +33 -0
- data/lib/ole-qa-framework.rb +178 -0
- data/lib/ole_qa_framework/COMPATIBILITY.rb +20 -0
- data/lib/ole_qa_framework/VERSION.rb +20 -0
- data/lib/olefs/common/e_doc.rb +79 -0
- data/lib/olefs/common/line_object.rb +39 -0
- data/lib/olefs/common/lookup.rb +30 -0
- data/lib/olefs/common/purap_document.rb +73 -0
- data/lib/olefs/objects/line_item.rb +105 -0
- data/lib/olefs/objects/new_line_item.rb +44 -0
- data/lib/olefs/objects/new_preq_line_item.rb +43 -0
- data/lib/olefs/objects/new_receiving_line.rb +42 -0
- data/lib/olefs/objects/preq_line_item.rb +68 -0
- data/lib/olefs/objects/receiving_line.rb +88 -0
- data/lib/olefs/pages/building_lookup.rb +36 -0
- data/lib/olefs/pages/main_menu.rb +23 -0
- data/lib/olefs/pages/payment_request.rb +67 -0
- data/lib/olefs/pages/payment_request_creation.rb +44 -0
- data/lib/olefs/pages/purchase_order.rb +68 -0
- data/lib/olefs/pages/receiving_document.rb +49 -0
- data/lib/olefs/pages/requisition.rb +61 -0
- data/lib/olefs/pages/vendor_lookup.rb +40 -0
- data/lib/olefs/subobjects/accounting_line.rb +46 -0
- data/lib/olefs/subobjects/copies_line.rb +32 -0
- data/lib/olefs/subobjects/exception_notes_line.rb +26 -0
- data/lib/olefs/subobjects/invoice_notes_line.rb +25 -0
- data/lib/olefs/subobjects/new_accounting_line.rb +43 -0
- data/lib/olefs/subobjects/new_copies_line.rb +37 -0
- data/lib/olefs/subobjects/new_exception_notes_line.rb +30 -0
- data/lib/olefs/subobjects/new_invoice_notes_line.rb +35 -0
- data/lib/olefs/subobjects/new_notes_line.rb +36 -0
- data/lib/olefs/subobjects/new_receipt_notes_line.rb +35 -0
- data/lib/olefs/subobjects/notes_line.rb +29 -0
- data/lib/olefs/subobjects/processing_line.rb +24 -0
- data/lib/olefs/subobjects/receipt_notes_line.rb +25 -0
- data/lib/olels/common/e_doc.rb +23 -0
- data/lib/olels/common/editor.rb +92 -0
- data/lib/olels/common/line_object.rb +39 -0
- data/lib/olels/common/lookup.rb +30 -0
- data/lib/olels/objects/access_info_line.rb +25 -0
- data/lib/olels/objects/data_line.rb +31 -0
- data/lib/olels/objects/editor_note.rb +79 -0
- data/lib/olels/objects/holdings_note.rb +26 -0
- data/lib/olels/objects/item_note.rb +26 -0
- data/lib/olels/objects/ownership_extent_line.rb +40 -0
- data/lib/olels/pages/bib_editor.rb +63 -0
- data/lib/olels/pages/describe_workbench.rb +42 -0
- data/lib/olels/pages/instance_editor.rb +80 -0
- data/lib/olels/pages/item_editor.rb +91 -0
- data/lib/olels/pages/loan.rb +102 -0
- data/lib/olels/pages/main_menu.rb +31 -0
- data/lib/olels/pages/patron_lookup.rb +44 -0
- data/lib/olels/pages/return.rb +64 -0
- data/lib/olels/subobjects/ownership_note.rb +26 -0
- data/ole-qa-framework.gemspec +30 -0
- data/pkg/ole-qa-framework-2.1.0.gem +0 -0
- data/spec/common/browser_spec.rb +37 -0
- data/spec/common/data_object_spec.rb +37 -0
- data/spec/common/line_object_spec.rb +49 -0
- data/spec/common/page_spec.rb +44 -0
- data/spec/common/subline_object_spec.rb +54 -0
- data/spec/modules/qa_helpers_spec.rb +55 -0
- data/spec/modules/qa_page_helpers_spec.rb +43 -0
- data/spec/olefs/accounting_line_spec.rb +85 -0
- data/spec/olefs/building_lookup_spec.rb +45 -0
- data/spec/olefs/copies_line_spec.rb +70 -0
- data/spec/olefs/edocs_spec.rb +75 -0
- data/spec/olefs/exception_notes_line_spec.rb +52 -0
- data/spec/olefs/invoice_notes_line_spec.rb +45 -0
- data/spec/olefs/line_item_spec.rb +155 -0
- data/spec/olefs/lookup_spec.rb +44 -0
- data/spec/olefs/main_menu_spec.rb +34 -0
- data/spec/olefs/notes_line_spec.rb +65 -0
- data/spec/olefs/patron_lookup_spec.rb +54 -0
- data/spec/olefs/payment_request_spec.rb +85 -0
- data/spec/olefs/preq_creation_spec.rb +43 -0
- data/spec/olefs/preq_line_item_spec.rb +111 -0
- data/spec/olefs/processing_line_spec.rb +44 -0
- data/spec/olefs/purap_document_spec.rb +58 -0
- data/spec/olefs/purchase_order_spec.rb +77 -0
- data/spec/olefs/receipt_notes_line_spec.rb +54 -0
- data/spec/olefs/receive_spec.rb +66 -0
- data/spec/olefs/receiving_line_spec.rb +125 -0
- data/spec/olefs/requisition_spec.rb +83 -0
- data/spec/olefs/vendor_lookup_spec.rb +49 -0
- data/spec/olels/access_info_line_spec.rb +40 -0
- data/spec/olels/bib_editor_spec.rb +84 -0
- data/spec/olels/data_line_spec.rb +44 -0
- data/spec/olels/describe_workbench_spec.rb +44 -0
- data/spec/olels/editor_spec.rb +56 -0
- data/spec/olels/edocs_spec.rb +42 -0
- data/spec/olels/holdings_note_spec_spec.rb +41 -0
- data/spec/olels/instance_editor_spec.rb +81 -0
- data/spec/olels/item_editor_spec.rb +94 -0
- data/spec/olels/item_note_spec.rb +41 -0
- data/spec/olels/loan_spec.rb +104 -0
- data/spec/olels/lookup_spec.rb +38 -0
- data/spec/olels/main_menu_spec.rb +35 -0
- data/spec/olels/ownership_extent_line_spec.rb +58 -0
- data/spec/olels/ownership_note_spec.rb +41 -0
- data/spec/olels/return_spec.rb +72 -0
- data/spec/spec_helper.rb +21 -0
- data/spec/workflows/purap_spec.rb +221 -0
- metadata +313 -0
|
@@ -0,0 +1,104 @@
|
|
|
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 OLELS Loan page' do
|
|
19
|
+
|
|
20
|
+
before :all do
|
|
21
|
+
@ole = OLE_QA::Framework::Session.new
|
|
22
|
+
@loan = OLE_QA::Framework::OLELS::Loan.new(@ole)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after :all do
|
|
26
|
+
@ole.quit
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'should create a new instance' do
|
|
30
|
+
@loan.should be_an_instance_of(OLE_QA::Framework::OLELS::Loan)
|
|
31
|
+
@loan.class.superclass.should == OLE_QA::Framework::Page
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'should have loan screen elements' do
|
|
35
|
+
elements = @loan.elements
|
|
36
|
+
elements.include?(:circulation_desk_selector).should be_true
|
|
37
|
+
elements.include?(:circulation_desk_yes).should be_true
|
|
38
|
+
elements.include?(:circulation_desk_no).should be_true
|
|
39
|
+
elements.include?(:patron_field).should be_true
|
|
40
|
+
elements.include?(:patron_search_button).should be_true
|
|
41
|
+
elements.include?(:item_field).should be_true
|
|
42
|
+
elements.include?(:item_search_button).should be_true
|
|
43
|
+
elements.include?(:fast_add_button).should be_true
|
|
44
|
+
elements.include?(:loan_popup_box).should be_true
|
|
45
|
+
elements.include?(:due_date_field).should be_true
|
|
46
|
+
elements.include?(:due_time_field).should be_true
|
|
47
|
+
elements.include?(:loan_button).should be_true
|
|
48
|
+
elements.include?(:do_not_loan_button).should be_true
|
|
49
|
+
elements.include?(:current_items_toggle).should be_true
|
|
50
|
+
elements.include?(:checked_out_items_toggle).should be_true
|
|
51
|
+
elements.include?(:loan_messages).should be_true
|
|
52
|
+
elements.include?(:return_button).should be_true
|
|
53
|
+
elements.include?(:header_close_button).should be_true
|
|
54
|
+
elements.include?(:header_clear_patron_button).should be_true
|
|
55
|
+
elements.include?(:header_alter_due_date_button).should be_true
|
|
56
|
+
elements.include?(:header_claims_return_button).should be_true
|
|
57
|
+
elements.include?(:header_renew_button).should be_true
|
|
58
|
+
elements.include?(:clear_patron_button).should be_true
|
|
59
|
+
elements.include?(:close_button).should be_true
|
|
60
|
+
elements.include?(:alter_due_date_button).should be_true
|
|
61
|
+
elements.include?(:claims_return_button).should be_true
|
|
62
|
+
elements.include?(:renew_button).should be_true
|
|
63
|
+
elements.include?(:patron_details_toggle).should be_true
|
|
64
|
+
elements.include?(:patron_name).should be_true
|
|
65
|
+
elements.include?(:patron_type).should be_true
|
|
66
|
+
elements.include?(:patron_preferred_address).should be_true
|
|
67
|
+
elements.include?(:patron_phone_number).should be_true
|
|
68
|
+
elements.include?(:patron_email).should be_true
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
it 'should include loan screen functions' do
|
|
72
|
+
functions = @loan.functions
|
|
73
|
+
functions.include?(:item_selector).should be_true
|
|
74
|
+
functions.include?(:item_barcode_link).should be_true
|
|
75
|
+
functions.include?(:item_title).should be_true
|
|
76
|
+
functions.include?(:item_author).should be_true
|
|
77
|
+
functions.include?(:item_location).should be_true
|
|
78
|
+
functions.include?(:item_call_number).should be_true
|
|
79
|
+
functions.include?(:item_number_of_renewals).should be_true
|
|
80
|
+
functions.include?(:item_due_date).should be_true
|
|
81
|
+
functions.include?(:item_claims_return_note).should be_true
|
|
82
|
+
functions.include?(:item_claims_return_date).should be_true
|
|
83
|
+
functions.include?(:co_item_selector).should be_true
|
|
84
|
+
functions.include?(:co_item_barcode_link).should be_true
|
|
85
|
+
functions.include?(:co_item_title).should be_true
|
|
86
|
+
functions.include?(:co_item_author).should be_true
|
|
87
|
+
functions.include?(:co_item_location).should be_true
|
|
88
|
+
functions.include?(:co_item_call_number).should be_true
|
|
89
|
+
functions.include?(:co_item_number_of_renewals).should be_true
|
|
90
|
+
functions.include?(:co_item_due_date).should be_true
|
|
91
|
+
functions.include?(:co_item_claims_return_note).should be_true
|
|
92
|
+
functions.include?(:co_item_claims_return_date).should be_true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
it 'should open the loan screen via URL' do
|
|
96
|
+
main_menu = OLE_QA::Framework::OLELS::Main_Menu.new(@ole)
|
|
97
|
+
main_menu.open
|
|
98
|
+
main_menu.login('dev2')
|
|
99
|
+
@loan.open
|
|
100
|
+
@loan.return_button.present?.should be_true
|
|
101
|
+
@loan.circulation_desk_selector.present?.should be_true
|
|
102
|
+
@loan.patron_field.present?.should be_true
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
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 OLELS Lookup page' do
|
|
19
|
+
|
|
20
|
+
before :all do
|
|
21
|
+
@ole = OLE_QA::Framework::Session.new
|
|
22
|
+
@lookup = OLE_QA::Framework::OLELS::Lookup.new(@ole, @ole.ls_url)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after :all do
|
|
26
|
+
@ole.quit
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'should create a new instance' do
|
|
30
|
+
@lookup.class.should == OLE_QA::Framework::OLELS::Lookup
|
|
31
|
+
@lookup.class.superclass.should == OLE_QA::Framework::Page
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'should have lookup page elements' do
|
|
35
|
+
elements = @lookup.methods
|
|
36
|
+
elements.include?(:title).should be_true
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
|
|
19
|
+
describe "The OLELS Main Menu" do
|
|
20
|
+
|
|
21
|
+
before :all do
|
|
22
|
+
@ole = OLE_QA::Framework::Session.new
|
|
23
|
+
@olels = OLE_QA::Framework::OLELS::Main_Menu.new(@ole)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after :all do
|
|
27
|
+
@ole.quit
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "should open via url" do
|
|
31
|
+
@olels.open
|
|
32
|
+
@ole.browser.title.should == "Kuali Portal Index"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
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 OLELS Ownership Extent Line object' do
|
|
19
|
+
|
|
20
|
+
before :all do
|
|
21
|
+
@ole = OLE_QA::Framework::Session.new
|
|
22
|
+
@browser = @ole.browser
|
|
23
|
+
@ownership_line = OLE_QA::Framework::OLELS::Ownership_Extent_Line.new(@browser, 1)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after :all do
|
|
27
|
+
@ole.quit
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it 'should create a new instance' do
|
|
31
|
+
@ownership_line.class.should == OLE_QA::Framework::OLELS::Ownership_Extent_Line
|
|
32
|
+
@ownership_line.class.superclass.should == OLE_QA::Framework::OLELS::Line_Object
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it 'should have ownership extent line elements' do
|
|
36
|
+
elements = @ownership_line.methods
|
|
37
|
+
elements.include?(:type_selector).should be_true
|
|
38
|
+
elements.include?(:statement_field).should be_true
|
|
39
|
+
elements.include?(:add_button).should be_true
|
|
40
|
+
elements.include?(:remove_button).should be_true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it 'should start with one ownership note' do
|
|
44
|
+
@ownership_line.methods.include?(:ownership_note_1).should be_true
|
|
45
|
+
@ownership_line.ownership_note_1.class.should == OLE_QA::Framework::OLELS::Ownership_Note
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it 'should add an ownership note' do
|
|
49
|
+
@ownership_line.add_ownership_note(2)
|
|
50
|
+
@ownership_line.methods.include?(:ownership_note_2).should be_true
|
|
51
|
+
@ownership_line.ownership_note_2.class.should == OLE_QA::Framework::OLELS::Ownership_Note
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it 'should delete an ownership note' do
|
|
55
|
+
@ownership_line.delete_ownership_note(2)
|
|
56
|
+
@ownership_line.methods.include?(:ownership_note_2).should be_false
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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 OLELS Ownership Note object' do
|
|
19
|
+
|
|
20
|
+
before :all do
|
|
21
|
+
@ole = OLE_QA::Framework::Session.new
|
|
22
|
+
@ownership_note = OLE_QA::Framework::OLELS::Ownership_Note.new(@ole)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after :all do
|
|
26
|
+
@ole.quit
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'should create a new instance' do
|
|
30
|
+
@ownership_note.class.should == OLE_QA::Framework::OLELS::Ownership_Note
|
|
31
|
+
@ownership_note.class.superclass.should == OLE_QA::Framework::Subline_Object
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'should have ownership note elements' do
|
|
35
|
+
elements = @ownership_note.methods
|
|
36
|
+
elements.include?(:note_type_selector).should be_true
|
|
37
|
+
elements.include?(:note_field).should be_true
|
|
38
|
+
elements.include?(:add_button).should be_true
|
|
39
|
+
elements.include?(:remove_button).should be_true
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
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 'My behaviour' do
|
|
19
|
+
|
|
20
|
+
before :all do
|
|
21
|
+
@ole = OLE_QA::Framework::Session.new
|
|
22
|
+
@return_screen = OLE_QA::Framework::OLELS::Return.new(@ole)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after :all do
|
|
26
|
+
@ole.quit
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'should create a new instance' do
|
|
30
|
+
@return_screen.should be_an_instance_of(OLE_QA::Framework::OLELS::Return)
|
|
31
|
+
@return_screen.class.superclass.should == OLE_QA::Framework::Page
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'should have return screen elements' do
|
|
35
|
+
elements = @return_screen.elements
|
|
36
|
+
elements.include?(:loan_button).should be_true
|
|
37
|
+
elements.include?(:end_session_button).should be_true
|
|
38
|
+
elements.include?(:damaged_checkin_checkbox).should be_true
|
|
39
|
+
elements.include?(:checkin_date_field).should be_true
|
|
40
|
+
elements.include?(:checkin_time_field).should be_true
|
|
41
|
+
elements.include?(:item_field).should be_true
|
|
42
|
+
elements.include?(:item_search_button).should be_true
|
|
43
|
+
elements.include?(:items_returned_toggle).should be_true
|
|
44
|
+
elements.include?(:checkin_message_box).should be_true
|
|
45
|
+
elements.include?(:return_button).should be_true
|
|
46
|
+
elements.include?(:do_not_return_button).should be_true
|
|
47
|
+
elements.include?(:circulation_desk_selector).should be_true
|
|
48
|
+
elements.include?(:circulation_desk_yes).should be_true
|
|
49
|
+
elements.include?(:circulation_desk_no).should be_true
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'should have return screen functions' do
|
|
53
|
+
functions = @return_screen.functions
|
|
54
|
+
functions.include?(:item_barcode_link).should be_true
|
|
55
|
+
functions.include?(:item_title).should be_true
|
|
56
|
+
functions.include?(:item_author).should be_true
|
|
57
|
+
functions.include?(:item_location).should be_true
|
|
58
|
+
functions.include?(:item_call_number).should be_true
|
|
59
|
+
functions.include?(:item_checkin_date).should be_true
|
|
60
|
+
functions.include?(:item_status).should be_true
|
|
61
|
+
functions.include?(:item_bill_link).should be_true
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
it 'should open the return screen via URL' do
|
|
65
|
+
main_menu = OLE_QA::Framework::OLELS::Main_Menu.new(@ole)
|
|
66
|
+
main_menu.open
|
|
67
|
+
main_menu.login('dev2')
|
|
68
|
+
@return_screen.open
|
|
69
|
+
@return_screen.loan_button.present?.should be_true
|
|
70
|
+
@return_screen.item_field.present?.should be_true
|
|
71
|
+
end
|
|
72
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
$:<< File.join(File.dirname(__FILE__),'..')
|
|
16
|
+
|
|
17
|
+
require "watir-webdriver"
|
|
18
|
+
require "headless"
|
|
19
|
+
require "open-uri"
|
|
20
|
+
|
|
21
|
+
require 'lib/ole-qa-framework'
|
|
@@ -0,0 +1,221 @@
|
|
|
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
|