ole-qa-framework 2.4.1 → 2.5.2
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 +20 -0
- data/lib/common/page.rb +1 -0
- data/lib/ole-qa-framework.rb +0 -1
- data/lib/ole_qa_framework/VERSION.rb +2 -2
- data/lib/olels/common/e_doc.rb +31 -0
- data/lib/olels/common/editor.rb +6 -0
- data/lib/olels/objects/patron_address_line.rb +88 -0
- data/lib/olels/objects/patron_email_line.rb +40 -0
- data/lib/olels/objects/patron_phone_line.rb +48 -0
- data/lib/olels/pages/bib_editor.rb +6 -2
- data/lib/olels/pages/instance_editor.rb +0 -2
- data/lib/olels/pages/item_editor.rb +0 -3
- data/lib/olels/pages/patron.rb +122 -0
- data/lib/olels/pages/patron_lookup.rb +1 -1
- data/spec/common/page_spec.rb +11 -6
- data/spec/modules/qa_helpers_spec.rb +5 -1
- data/spec/olefs/exception_notes_line_spec.rb +5 -1
- data/spec/olefs/invoice_notes_line_spec.rb +5 -1
- data/spec/olefs/line_item_spec.rb +5 -1
- data/spec/olefs/load_report_spec.rb +5 -1
- data/spec/olefs/load_summary_lookup_spec.rb +5 -1
- data/spec/olefs/preq_creation_spec.rb +5 -1
- data/spec/olels/bib_editor_spec.rb +4 -1
- data/spec/olels/describe_workbench_spec.rb +5 -1
- data/spec/olels/editor_spec.rb +4 -0
- data/spec/olels/edocs_spec.rb +9 -1
- data/spec/olels/item_editor_spec.rb +5 -4
- data/spec/olels/patron_address_line_spec.rb +55 -0
- data/spec/olels/patron_email_line_spec.rb +44 -0
- data/spec/olels/patron_phone_line_spec.rb +47 -0
- data/spec/olels/patron_spec.rb +125 -0
- data/spec/spec_helper.rb +1 -1
- metadata +14 -2
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
### v2.5.2 - 2013/08/15
|
2
|
+
|
3
|
+
* Editor Fixes
|
4
|
+
* move all message elements to Editor base class (OLE_QA::Framework::OLELS::Editor)/.
|
5
|
+
* fix message definition
|
6
|
+
* add messages definition (multiple elements returned)
|
7
|
+
* add message_header definition
|
8
|
+
* add message_count function (returns "0" if message_header not present)
|
9
|
+
|
10
|
+
### v2.5.1 - 2013/08/13
|
11
|
+
|
12
|
+
* Small Fixes
|
13
|
+
* Update spec/common/page_spec.rb
|
14
|
+
* Update specs to ensure @ole.quit
|
15
|
+
is run after each full spec
|
16
|
+
|
17
|
+
### v2.5.0 - 2013/08/05
|
18
|
+
|
19
|
+
* Add Patron Record Screen
|
20
|
+
|
1
21
|
### v2.4.1 - 2013/07/30
|
2
22
|
|
3
23
|
* Small Fixes
|
data/lib/common/page.rb
CHANGED
@@ -78,6 +78,7 @@ module OLE_QA::Framework
|
|
78
78
|
element(:login_button) {@browser.input(:class => 'go', :value => 'Login')}
|
79
79
|
element(:logout_button) {@browser.input(:class => 'go', :value => 'Logout')}
|
80
80
|
element(:login_confirmation) {@browser.div(:id => 'login-info').strong(:text => /Impersonating User\:/)}
|
81
|
+
element(:loading_message) {@browser.body.div.h1.img(:alt => 'Loading...')}
|
81
82
|
end
|
82
83
|
|
83
84
|
# Set functions common to most or all pages across the OLE interface.
|
data/lib/ole-qa-framework.rb
CHANGED
@@ -49,7 +49,6 @@ module OLE_QA
|
|
49
49
|
# If pages or elements need to be inherited by subclasses, put them in a (foo)/common/ directory.
|
50
50
|
# Subobject directories (foo)/subobjects/ should be loaded before object directories (foo)/objects/ for inheritance.
|
51
51
|
load_libs("/common/")
|
52
|
-
# load_libs("/olefs/")
|
53
52
|
load_libs("/olefs/common/")
|
54
53
|
load_libs("/olefs/subobjects/")
|
55
54
|
load_libs("/olefs/objects/")
|
data/lib/olels/common/e_doc.rb
CHANGED
@@ -17,7 +17,38 @@ module OLE_QA::Framework::OLELS
|
|
17
17
|
class E_Doc < OLE_QA::Framework::Page
|
18
18
|
# Set elements common to all OLELS E-Document pages.
|
19
19
|
def set_elements
|
20
|
+
super
|
21
|
+
element(:title) {b.h1(:class => 'uif-headerText').span(:class => 'uif-headerText-span')}
|
20
22
|
element(:description_field) {b.text_field(:xpath => "//tr/th[descendant::label[contains(text(),'Description:')]]/following-sibling::td[1]/descendant::input[1]")}
|
23
|
+
element(:explanation_field) {b.text_field(:xpath => "//tr/th[descendant::label[contains(text(),'Explanation:')]]/following-sibling::td[1]/descendant::textarea[1]")}
|
24
|
+
element(:org_doc_number_field) {b.text_field(:xpath => "//tr/th[descendant::label[contains(text(),'Organization Document Number:')]]/following-sibling::td[1]/descendant::input[1]")}
|
25
|
+
element(:document_id) {b.span(:xpath => "//table[@class='uif-gridLayout']/descendant::th[span/label[contains(text(),'Document Number:')]]/following-sibling::td[1]/div/span")}
|
26
|
+
element(:initiator_id) {b.span(:xpath => "//table[@class='uif-gridLayout']/descendant::th[span/label[contains(text(),'Initiator Network Id:')]]/following-sibling::td[1]/div/span")}
|
27
|
+
element(:document_status) {b.span(:xpath => "//table[@class='uif-gridLayout']/descendant::th[span/label[contains(text(),'Document Status:')]]/following-sibling::td[1]/div/span")}
|
28
|
+
element(:creation_timestamp) {b.span(:xpath => "//table[@class='uif-gridLayout']/descendant::th[span/label[contains(text(),'Creation Timestamp:')]]/following-sibling::td[1]/div/span")}
|
29
|
+
end
|
30
|
+
|
31
|
+
# FIXME - Make this a single flexible method during namespace revision.
|
32
|
+
# Create a line object on a page.
|
33
|
+
def create_line(instance_name, class_name, which=0)
|
34
|
+
raise StandardError, "Line object already exists. (#{instance_name})" if self.instance_variables.include?("@#{instance_name}".to_sym)
|
35
|
+
new_line_name = instance_name
|
36
|
+
make_accessor(:"#{instance_name}")
|
37
|
+
klas = OLE_QA::Framework::OLELS.const_get(:"#{class_name}")
|
38
|
+
instance_variable_set(:"@#{new_line_name}", klas.new(@ole, which))
|
39
|
+
end
|
40
|
+
|
41
|
+
# Remove a line object from a page.
|
42
|
+
def remove_line(instance_name)
|
43
|
+
raise StandardError, "Line object does not exist. (#{instance_name})" unless self.instance_variables.include?("@#{instance_name}".to_sym)
|
44
|
+
remove_instance_variable("@#{instance_name}".to_sym)
|
45
|
+
unmake_attr(instance_name.to_sym)
|
46
|
+
end
|
47
|
+
|
48
|
+
def wait_for_elements
|
49
|
+
super
|
50
|
+
@wait_on << :title
|
51
|
+
@wait_on << :document_id
|
21
52
|
end
|
22
53
|
end
|
23
54
|
end
|
data/lib/olels/common/editor.rb
CHANGED
@@ -45,6 +45,9 @@ module OLE_QA::Framework::OLELS
|
|
45
45
|
def set_elements
|
46
46
|
super
|
47
47
|
element(:title) {b.h2(:class => "uif-headerText").span}
|
48
|
+
element(:message) {b.li(:class => 'uif-infoMessageItem')}
|
49
|
+
element(:messages) {b.lis(:class => 'uif-infoMessageItem')}
|
50
|
+
element(:message_header) {b.h3(:class => 'uif-pageValidationHeader')}
|
48
51
|
element(:submit_button) {b.button(:id => "submitEditor")}
|
49
52
|
element(:cancel_button) {b.button(:id => "cancelEditor")}
|
50
53
|
element(:close_button) {b.button(:id => "closeEditor")}
|
@@ -75,6 +78,9 @@ module OLE_QA::Framework::OLELS
|
|
75
78
|
# This function takes two arguments - the first is the holdings element to which it belongs, and the second is its position.
|
76
79
|
# e.g., item_link(1,1) will return the first item under the first holdings link, item_link(2,2) will return the second item under the second holdings link.
|
77
80
|
function(:item_link) {|which_holdings = 1, which_item = 1| b.a(:xpath => "//div[@id='holdingsItemTree_tree']/ul[@class='jstree-no-icons']/li[#{which_holdings}]/ul/li[#{which_item}]/a")}
|
81
|
+
# Return the number of messages found in the .message_header text.
|
82
|
+
# - If .message_header is not present, a "0" will be returned.
|
83
|
+
function(:message_count) { if message_header.present? then message_header.text.match(/\d(?=\smessage)/).to_s else "0" end}
|
78
84
|
end
|
79
85
|
|
80
86
|
# Create a Line Object on an Editor page.
|
@@ -0,0 +1,88 @@
|
|
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 address line on an individual patron record.
|
17
|
+
class Patron_Address_Line < Line_Object
|
18
|
+
# Define screen elements for patron record address line.
|
19
|
+
def set_elements
|
20
|
+
# Format id string based on @line_id .
|
21
|
+
# @note Address line 0 has no numerical identifier.
|
22
|
+
element(:details_link) {(@line_id == 0) ?
|
23
|
+
id_str = 'OlePatronDocument-Address_detLink_add' :
|
24
|
+
id_str = "OlePatronDocument-Address_detLink_line#{@line_id - 1}"
|
25
|
+
b.a(:id => id_str)}
|
26
|
+
element(:address_type_selector) {(@line_id == 0) ?
|
27
|
+
id_str = 'addressTypeCode_add_control' :
|
28
|
+
id_str = "addressTypeCode_line#{@line_id - 1}_control"
|
29
|
+
b.select_list(:id => id_str)}
|
30
|
+
element(:address_source_selector) {(@line_id == 0) ?
|
31
|
+
id_str = 'addressSource_add_control' :
|
32
|
+
id_str = "addressSource_line#{@line_id - 1}_control"
|
33
|
+
b.select_list(:id => id_str)}
|
34
|
+
element(:valid_from_date_field) {(@line_id == 0) ?
|
35
|
+
id_str = 'addressValidFrom_add_control' :
|
36
|
+
id_str = "addressValidFrom_line#{@line_id - 1}_control"
|
37
|
+
b.text_field(:id => id_str)}
|
38
|
+
element(:valid_to_date_field) {(@line_id == 0) ?
|
39
|
+
id_str = 'addressValidTo_add_control' :
|
40
|
+
id_str = "addressValidTo_line#{@line_id - 1}_control"
|
41
|
+
b.text_field(:id => id_str)}
|
42
|
+
element(:verified_checkbox) {(@line_id == 0) ?
|
43
|
+
id_str = 'addressVerified_add_control' :
|
44
|
+
id_str = "addressVerified_line#{@line_id - 1}_control"
|
45
|
+
b.checkbox(:id => id_str)}
|
46
|
+
element(:preferred_checkbox) {(@line_id == 0) ?
|
47
|
+
id_str = 'defaultValue_add_control' :
|
48
|
+
id_str = "defaultValue_line#{@line_id - 1}_control"
|
49
|
+
b.checkbox(:id => id_str)}
|
50
|
+
element(:active_checkbox) {(@line_id == 0) ?
|
51
|
+
id_str = 'active_add_control' :
|
52
|
+
id_str = "active_line#{@line_id - 1}_control"
|
53
|
+
b.checkbox(:id => id_str)}
|
54
|
+
# Details Area
|
55
|
+
element(:line_1_field) {(@line_id == 0) ?
|
56
|
+
id_str = 'line1_add_control' :
|
57
|
+
id_str = "line1_line#{@line_id - 1}_control"
|
58
|
+
b.text_field(:id => id_str)}
|
59
|
+
element(:line_2_field) {(@line_id == 0) ?
|
60
|
+
id_str = 'line2_add_control' :
|
61
|
+
id_str = "line2_line#{@line_id - 1}_control"
|
62
|
+
b.text_field(:id => id_str)}
|
63
|
+
element(:line_3_field) {(@line_id == 0) ?
|
64
|
+
id_str = 'line3_add_control' :
|
65
|
+
id_str = "line3_line#{@line_id - 1}_control"
|
66
|
+
b.text_field(:id => id_str)}
|
67
|
+
element(:city_field) {(@line_id == 0) ?
|
68
|
+
id_str = 'city_add_control' :
|
69
|
+
id_str = "city_line#{@line_id - 1}_control"
|
70
|
+
b.text_field(:id => id_str)}
|
71
|
+
element(:state_selector) {(@line_id == 0) ?
|
72
|
+
id_str = 'state_add_control' :
|
73
|
+
id_str = "state_line#{@line_id - 1}_control"
|
74
|
+
b.select_list(:id => id_str)}
|
75
|
+
element(:postal_code_field) {(@line_id == 0) ?
|
76
|
+
id_str = 'postalCode_add_control' :
|
77
|
+
id_str = "postalCode_line#{@line_id - 1}_control"
|
78
|
+
b.text_field(:id => id_str)}
|
79
|
+
element(:country_selector) {(@line_id == 0) ?
|
80
|
+
id_str = 'country_add_control' :
|
81
|
+
id_str = "country_line#{@line_id - 1}_control"
|
82
|
+
b.select_list(:id => id_str)}
|
83
|
+
# Add/Delete
|
84
|
+
element(:add_button) {b.button(:id => 'OlePatronDocument-Address_add')}
|
85
|
+
element(:delete_button) {b.button(:id => "OlePatronDocument-Address_del_line#{@line_id - 1}")}
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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
|
+
# A line of email address information on a patron record.
|
17
|
+
class Patron_Email_Line < Line_Object
|
18
|
+
# Set screen elements on patron record email info line.
|
19
|
+
def set_elements
|
20
|
+
element(:email_type_selector) {(@line_id == 0) ?
|
21
|
+
id_str = 'emailTypeCode_add_control' :
|
22
|
+
id_str = "emailTypeCode_line#{@line_id - 1}_control"
|
23
|
+
b.select_list(:id => id_str)}
|
24
|
+
element(:email_address_field) {(@line_id == 0) ?
|
25
|
+
id_str = 'emailAddress_add_control' :
|
26
|
+
id_str = "emailAddress_line#{@line_id - 1}_control"
|
27
|
+
b.text_field(:id => id_str)}
|
28
|
+
element(:preferred_checkbox) {(@line_id == 0) ?
|
29
|
+
id_str = 'email_defaultValue_add_control' :
|
30
|
+
id_str = "email_defaultValue_line#{@line_id - 1}_control"
|
31
|
+
b.checkbox(:id => id_str)}
|
32
|
+
element(:active_checkbox) {(@line_id == 0) ?
|
33
|
+
id_str = 'email_active_add_control' :
|
34
|
+
id_str = "email_active_line#{@line_id - 1}_control"
|
35
|
+
b.checkbox(:id => id_str)}
|
36
|
+
element(:add_button) {b.button(:id => 'OlePatronDocument-Email_add')}
|
37
|
+
element(:delete_button) {b.button(:id => "OlePatronDocument-Email_del_line#{@line_id - 1}")}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,48 @@
|
|
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
|
+
# A phone number info line on a single patron record.
|
17
|
+
class Patron_Phone_Line < Line_Object
|
18
|
+
# Set screen elements for patron phone number info line.
|
19
|
+
def set_elements
|
20
|
+
element(:phone_type_selector) {(@line_id == 0) ?
|
21
|
+
id_str = 'phoneTypeCode_add_control' :
|
22
|
+
id_str = "phoneTypeCode_line#{@line_id - 1}_control"
|
23
|
+
b.select_list(:id => id_str)}
|
24
|
+
element(:phone_number_field) {(@line_id == 0) ?
|
25
|
+
id_str = 'phoneNumber_add_control' :
|
26
|
+
id_str = "phoneNumber_line#{@line_id - 1}_control"
|
27
|
+
b.text_field(:id => id_str)}
|
28
|
+
element(:extension_field) {(@line_id == 0) ?
|
29
|
+
id_str = 'extensionNumber_add_control' :
|
30
|
+
id_str = "extensionNumber_line#{@line_id - 1}_control"
|
31
|
+
b.text_field(:id => id_str)}
|
32
|
+
element(:country_selector) {(@line_id == 0) ?
|
33
|
+
id_str = 'countryCode_add_control' :
|
34
|
+
id_str = "countryCode_line#{@line_id - 1}_control"
|
35
|
+
b.select_list(:id => id_str)}
|
36
|
+
element(:preferred_checkbox) {(@line_id == 0) ?
|
37
|
+
id_str = 'phoneNumber_defaultValue_add_control' :
|
38
|
+
id_str = "phoneNumber_defaultValue_line#{@line_id - 1}_control"
|
39
|
+
b.checkbox(:id => id_str)}
|
40
|
+
element(:active_checkbox) {(@line_id == 0) ?
|
41
|
+
id_str = 'phoneNumber_active_add_control' :
|
42
|
+
id_str = "phoneNumber_active_line#{@line_id - 1}_control"
|
43
|
+
b.checkbox(:id => id_str)}
|
44
|
+
element(:add_button) {b.button(:id => 'OlePatronDocument-Phone_add')}
|
45
|
+
element(:delete_button) {b.button(:id => "OlePatronDocument-Phone_del_line#{@line_id - 1}")}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -20,10 +20,9 @@ module OLE_QA::Framework::OLELS
|
|
20
20
|
# {OLE_QA::Framework::OLELS::Data_Line}
|
21
21
|
def set_elements
|
22
22
|
super
|
23
|
-
element(:message) {b.span(:id => "workMessageSection_span")}
|
24
|
-
element(:leader_field) {b.text_field(:id => "LeaderTextInputField_control")}
|
25
23
|
element(:bib_record_status_selector) {b.select_list(:id => "StatusFieldSection_control")}
|
26
24
|
element(:set_button) {b.button(:id => "set_button")}
|
25
|
+
element(:leader_field) {b.text_field(:id => "LeaderTextInputField_control")}
|
27
26
|
# Control Field Buttons
|
28
27
|
element(:control_003_link) {b.a(:id => "003FieldLink")}
|
29
28
|
element(:control_005_link) {b.a(:id => "005FieldLink")}
|
@@ -48,6 +47,11 @@ module OLE_QA::Framework::OLELS
|
|
48
47
|
element(:control_008_field) {b.text_field(:id => "008Field_control")}
|
49
48
|
end
|
50
49
|
|
50
|
+
def set_functions
|
51
|
+
super
|
52
|
+
|
53
|
+
end
|
54
|
+
|
51
55
|
# Add the first Marc Data Line to a new Bib Editor record.
|
52
56
|
# @note There will always be at least one Marc Data Line on a newly-opened record,
|
53
57
|
# whether newly-created or previously extant.
|
@@ -18,8 +18,6 @@ module OLE_QA::Framework::OLELS
|
|
18
18
|
# Set OLELS Instance Editor page elements.
|
19
19
|
def set_elements
|
20
20
|
super
|
21
|
-
# Override :message element on Editor base class.
|
22
|
-
element(:message) {b.span(:id => "workInstanceMessage_span")}
|
23
21
|
element(:location_toggle) {b.a(:id => "OleLocationInformationSection_toggle")}
|
24
22
|
element(:location_field) {b.text_field(:id => "OleHoldingLocation_control")}
|
25
23
|
element(:call_number_toggle) {b.a(:id => "OleCallNumberInformation_toggle")}
|
@@ -18,9 +18,6 @@ module OLE_QA::Framework::OLELS
|
|
18
18
|
# Set Item Editor screen elements.
|
19
19
|
def set_elements
|
20
20
|
super
|
21
|
-
# Override message in Editor base class, add multi-message element.
|
22
|
-
element(:message) {b.span(:id => "workItemMessage_span")}
|
23
|
-
element(:messages) {b.span(:id => "workItemMessage_span").font}
|
24
21
|
# Holdings Location/Call Number Information
|
25
22
|
element(:holdings_location_field) {b.span(:id => "OleHoldingLocationLevelName_control")}
|
26
23
|
element(:holdings_prefix_field) {b.span(:id => "OleHoldingCallNumberPrefix_control")}
|
@@ -0,0 +1,122 @@
|
|
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
|
+
# A single patron record in the OLE Library System.
|
17
|
+
# @note Use of this page may require a special login. The default user,
|
18
|
+
# ole-khuntley, does not have sufficient permissions to create a new
|
19
|
+
# patron record (as of 1.0.0-M2-r13397, 07/31/2013).
|
20
|
+
class Patron < E_Doc
|
21
|
+
# The page object will open a new patron record by default.
|
22
|
+
def initialize(ole_session)
|
23
|
+
url = ole_session.url + 'ole-kr-krad/patronMaintenance?viewTypeName=MAINTENANCE&returnLocation='
|
24
|
+
url += ole_session.url + 'portal.do&methodToCall=start&dataObjectClassName=org.kuali.ole.deliver.bo.OlePatronDocument'
|
25
|
+
super(ole_session, url)
|
26
|
+
|
27
|
+
# Set up initial contact info lines, one of each.
|
28
|
+
add_address_line(1)
|
29
|
+
add_phone_line(1)
|
30
|
+
add_email_line(1)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Define screen elements for patron record screen.
|
34
|
+
def set_elements
|
35
|
+
super
|
36
|
+
element(:patron_id) {b.a(:xpath => "//th[span/label[contains(text(),'Patron Id:')]]/following-sibling::td[1]/div/span/a")}
|
37
|
+
element(:barcode_field) {b.text_field(:id => 'barcode_control')}
|
38
|
+
element(:borrower_type_selector) {b.select_list(:id => 'borrowerType_control')}
|
39
|
+
element(:source_selector) {b.select_list(:id => 'sourceType_control')}
|
40
|
+
element(:patron_image_field) {b.input(:id => 'attachment_Files_control').to_subtype}
|
41
|
+
element(:upload_image_button) {b.button(:id => 'uploadButton_patron')}
|
42
|
+
element(:statistical_category_selector) {b.select_list(:id => 'statisticalCategory_control')}
|
43
|
+
element(:activation_date_field) {b.text_field(:id => 'activationDate_control')}
|
44
|
+
element(:expiration_date_field) {b.text_field(:id => 'expirationDate_control')}
|
45
|
+
element(:active_checkbox) {b.checkbox(:id => 'activeIndicator_control')}
|
46
|
+
element(:name_type) {b.span(:id => /nameType.*control/)}
|
47
|
+
element(:title_selector) {b.select_list(:id => /namePrefix.*control/)}
|
48
|
+
element(:first_name_field) {b.text_field(:id => /firstName.*control/)}
|
49
|
+
element(:middle_name_field) {b.text_field(:id => /middleName.*control/)}
|
50
|
+
element(:last_name_field) {b.text_field(:id => /lastName.*control/)}
|
51
|
+
element(:suffix_selector) {b.select_list(:id => /nameSuffix.*control/)}
|
52
|
+
element(:affiliation_toggle) {b.a(:id => 'OlePatronDocument-Affiliation_toggle')}
|
53
|
+
element(:library_policies_toggle) {b.a(:id => 'OlePatronDocument-LibraryPoliciesSection_toggle')}
|
54
|
+
element(:loaned_records_toggle) {b.a(:id => 'OlePatronDocument-PatronLoanedRecords_toggle')}
|
55
|
+
element(:requested_records_toggle) {b.a(:id => 'OlePatronDocument-PatronRequestedRecords_toggle')}
|
56
|
+
element(:temp_circ_history_toggle) {b.a(:id => 'OlePatronDocument-TemporaryCirculationHistoryRecords_toggle')}
|
57
|
+
element(:note_toggle) {b.a(:id => 'OlePatronDocument-NotesSection_toggle')}
|
58
|
+
element(:proxy_patron_toggle) {b.a(:id => 'OlePatronDocument-ProxySection_toggle')}
|
59
|
+
element(:proxy_for_toggle) {b.a(:id => 'OlePatronDocument-ProxyForSection_toggle')}
|
60
|
+
element(:local_id_toggle) {b.a(:id => 'OlePatronDocument-PatronLocalIdSection_toggle')}
|
61
|
+
element(:lost_barcode_toggle) {b.a(:id => 'OlePatronDocument-InvalidOrLostBarcodeSection_toggle')}
|
62
|
+
# TODO Check on OLE-4523 for the establishment of the element ID in the ad_hoc_toggle link.
|
63
|
+
element(:ad_hoc_toggle) {b.a(:id => 'OlePatronDocument-AdHocRecipientsSection_toggle')}
|
64
|
+
# TODO Check on OLE-4526 for the establishment of the element ID in the route_log_toggle link.
|
65
|
+
element(:route_log_toggle) {b.a(:id => 'OlePatronDocument-RouteLogSection_toggle')}
|
66
|
+
element(:contacts_toggle) {b.a(:id => 'OlePatronDocument-ContactsSection_toggle')}
|
67
|
+
element(:overview_toggle) {b.a(:id => 'OlePatronDocument-OverviewSection_toggle')}
|
68
|
+
element(:name_toggle) {b.a(:id => 'OlePatronDocument-Name_toggle')}
|
69
|
+
element(:address_toggle) {b.a(:id => 'OlePatronDocument-Address_toggle')}
|
70
|
+
element(:phone_toggle) {b.a(:id => 'OlePatronDocument-Phone_toggle')}
|
71
|
+
element(:email_toggle) {b.a(:id => 'OlePatronDocument-Email_toggle')}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Define commonly used functions for patron record screen.
|
75
|
+
def set_functions
|
76
|
+
super
|
77
|
+
# If the .patron_image_field has already been set once, IDs of related elements change.
|
78
|
+
# Use this method to update element IDs on the page object. It will return true if the IDs have been updated, false if the default IDs are still being used.
|
79
|
+
function(:redefine_patron_image_elements) do
|
80
|
+
if b.input(:id => 'attachment_File_edit_control').present?
|
81
|
+
set_element(:patron_image_field, true) {b.input(:id => 'attachment_File_edit_control').to_subtype}
|
82
|
+
set_element(:upload_image_button,true) {b.button(:id => 'uploadButton_edit')}
|
83
|
+
true
|
84
|
+
else
|
85
|
+
set_element(:patron_image_field, true) {b.input(:id => 'attachment_Files_control').to_subtype}
|
86
|
+
set_element(:upload_image_button, true) {b.button(:id => 'uploadButton_patron')}
|
87
|
+
false
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def create_address_line(which = 1)
|
93
|
+
create_line("address_line_#{which}","Patron_Address_Line", which)
|
94
|
+
end
|
95
|
+
alias_method(:add_address_line, :create_address_line)
|
96
|
+
|
97
|
+
def create_phone_line(which = 1)
|
98
|
+
create_line("phone_line_#{which}","Patron_Phone_Line", which)
|
99
|
+
end
|
100
|
+
alias_method(:add_phone_line, :create_phone_line)
|
101
|
+
|
102
|
+
def create_email_line(which = 1)
|
103
|
+
create_line("email_line_#{which}","Patron_Email_Line", which)
|
104
|
+
end
|
105
|
+
alias_method(:add_email_line, :create_email_line)
|
106
|
+
|
107
|
+
def remove_address_line(which = 1)
|
108
|
+
remove_line("address_line_#{which}")
|
109
|
+
end
|
110
|
+
alias_method(:delete_address_line, :remove_address_line)
|
111
|
+
|
112
|
+
def remove_phone_line(which = 1)
|
113
|
+
remove_line("phone_line_#{which}")
|
114
|
+
end
|
115
|
+
alias_method(:delete_phone_line, :remove_phone_line)
|
116
|
+
|
117
|
+
def remove_email_line(which = 1)
|
118
|
+
remove_line("email_line_#{which}")
|
119
|
+
end
|
120
|
+
alias_method(:delete_email_line, :remove_email_line)
|
121
|
+
end
|
122
|
+
end
|
@@ -17,7 +17,7 @@ module OLE_QA::Framework::OLELS
|
|
17
17
|
class Patron_Lookup < Lookup
|
18
18
|
def initialize(ole_session)
|
19
19
|
url = ole_session.url + 'portal.do?channelTitle=Patron&channelUrl='
|
20
|
-
url += ole_session.url + 'ole-kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.ole.
|
20
|
+
url += ole_session.url + 'ole-kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.ole.deliver.bo.OlePatronDocument&returnLocation='
|
21
21
|
url += ole_session.url + 'portal.do&hideReturnLink=true&showMaintenanceLinks=true'
|
22
22
|
super(ole_session, url)
|
23
23
|
end
|
data/spec/common/page_spec.rb
CHANGED
@@ -23,6 +23,10 @@ describe "A Page" do
|
|
23
23
|
@page = OLE_QA::Framework::Page.new(@ole, @ole.base_url)
|
24
24
|
end
|
25
25
|
|
26
|
+
after :all do
|
27
|
+
@ole.quit
|
28
|
+
end
|
29
|
+
|
26
30
|
it "should open via url" do
|
27
31
|
@page.open
|
28
32
|
@ole.browser.title.should == "Kuali Portal Index"
|
@@ -36,11 +40,6 @@ describe "A Page" do
|
|
36
40
|
@page.url.should == @ole.base_url
|
37
41
|
end
|
38
42
|
|
39
|
-
it 'should set a frame element on the browser if one is present' do
|
40
|
-
@page.browser.link(:text => "Requisition").click
|
41
|
-
@page.browser.class.should == Watir::Frame
|
42
|
-
end
|
43
|
-
|
44
43
|
it 'should be able to login as another user' do
|
45
44
|
@page.open
|
46
45
|
@page.login('ole-abeal').should be_true
|
@@ -54,4 +53,10 @@ describe "A Page" do
|
|
54
53
|
@ole.open('www.google.com')
|
55
54
|
lambda {@page.login}.should raise_error(error=OLE_QA::Framework::Error)
|
56
55
|
end
|
57
|
-
|
56
|
+
|
57
|
+
it 'should set a frame element on the browser if one is present' do
|
58
|
+
OLE_QA::Framework::OLEFS::Requisition.new(@ole).open
|
59
|
+
@page.browser.class.should == Watir::Frame
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -38,6 +38,10 @@ describe 'The Helpers module' do
|
|
38
38
|
@test_object = TestObject.new(@ole)
|
39
39
|
end
|
40
40
|
|
41
|
+
after :all do
|
42
|
+
@ole.quit
|
43
|
+
end
|
44
|
+
|
41
45
|
it 'should do create an accessor attribute' do
|
42
46
|
@test_object.foo.should == "foo"
|
43
47
|
@test_object.foo = "foo bar baz"
|
@@ -52,4 +56,4 @@ describe 'The Helpers module' do
|
|
52
56
|
@test_object.xyzzy = "xyzzy"
|
53
57
|
@test_object.give_xyzzy.should == "xyzzy"
|
54
58
|
end
|
55
|
-
end
|
59
|
+
end
|
@@ -24,6 +24,10 @@ describe 'An OLEFS Exception Notes Line object' do
|
|
24
24
|
@new_exception_notes_line = OLE_QA::Framework::OLEFS::New_Exception_Notes_Line.new(@ole, 1, 0)
|
25
25
|
end
|
26
26
|
|
27
|
+
after :all do
|
28
|
+
@ole.quit
|
29
|
+
end
|
30
|
+
|
27
31
|
it 'should create a new instance' do
|
28
32
|
@exception_notes_line.class.should == OLE_QA::Framework::OLEFS::Exception_Notes_Line
|
29
33
|
@exception_notes_line.class.superclass.should == OLE_QA::Framework::Subline_Object
|
@@ -49,4 +53,4 @@ describe 'An OLEFS Exception Notes Line object' do
|
|
49
53
|
elements.include?(:note_field).should be_true
|
50
54
|
elements.include?(:note_type_selector).should be_true
|
51
55
|
end
|
52
|
-
end
|
56
|
+
end
|
@@ -24,6 +24,10 @@ describe 'An OLEFS Invoice Notes Line object' do
|
|
24
24
|
@new_invoice_notes = OLE_QA::Framework::OLEFS::New_Invoice_Notes_Line.new(@ole, 1, 0)
|
25
25
|
end
|
26
26
|
|
27
|
+
after :all do
|
28
|
+
@ole.quit
|
29
|
+
end
|
30
|
+
|
27
31
|
it 'should create a new instance' do
|
28
32
|
@invoice_notes.class.should == OLE_QA::Framework::OLEFS::Invoice_Notes_Line
|
29
33
|
@invoice_notes.class.superclass.should == OLE_QA::Framework::Subline_Object
|
@@ -42,4 +46,4 @@ describe 'An OLEFS Invoice Notes Line object' do
|
|
42
46
|
methods.include?(:note_field).should be_true
|
43
47
|
methods.include?(:add_button).should be_true
|
44
48
|
end
|
45
|
-
end
|
49
|
+
end
|
@@ -25,6 +25,10 @@ describe 'An OLEFS line item' do
|
|
25
25
|
@new_line_item = OLE_QA::Framework::OLEFS::New_Line_Item.new(@ole, @line_number)
|
26
26
|
end
|
27
27
|
|
28
|
+
after :all do
|
29
|
+
@ole.quit
|
30
|
+
end
|
31
|
+
|
28
32
|
it 'should should create a new instance' do
|
29
33
|
@line_item.class.should == OLE_QA::Framework::OLEFS::Line_Item
|
30
34
|
@new_line_item.class.should == OLE_QA::Framework::OLEFS::New_Line_Item
|
@@ -152,4 +156,4 @@ describe 'An OLEFS line item' do
|
|
152
156
|
lambda {@line_item.remove_notes_line(1)}.should raise_error
|
153
157
|
lambda {@line_item.remove_copies_line(1)}.should raise_error
|
154
158
|
end
|
155
|
-
end
|
159
|
+
end
|
@@ -22,6 +22,10 @@ describe 'My behaviour' do
|
|
22
22
|
@page = OLE_QA::Framework::OLEFS::Load_Report.new(@ole)
|
23
23
|
end
|
24
24
|
|
25
|
+
after :all do
|
26
|
+
@ole.quit
|
27
|
+
end
|
28
|
+
|
25
29
|
it 'should create a new instance' do
|
26
30
|
@page.should be_an_instance_of(OLE_QA::Framework::OLEFS::Load_Report)
|
27
31
|
@page.class.superclass.should == OLE_QA::Framework::OLEFS::E_Doc
|
@@ -49,4 +53,4 @@ describe 'My behaviour' do
|
|
49
53
|
functions.should include(:upload_date_ymd)
|
50
54
|
functions.should include(:upload_date_tod)
|
51
55
|
end
|
52
|
-
end
|
56
|
+
end
|
@@ -22,6 +22,10 @@ describe 'An OLEFS Load Summary Lookup page' do
|
|
22
22
|
@page = OLE_QA::Framework::OLEFS::Load_Summary_Lookup.new(@ole)
|
23
23
|
end
|
24
24
|
|
25
|
+
after :all do
|
26
|
+
@ole.quit
|
27
|
+
end
|
28
|
+
|
25
29
|
it 'should create a new instance' do
|
26
30
|
@page.should be_an_instance_of(OLE_QA::Framework::OLEFS::Load_Summary_Lookup)
|
27
31
|
@page.class.superclass.should == OLE_QA::Framework::OLEFS::Lookup
|
@@ -46,4 +50,4 @@ describe 'An OLEFS Load Summary Lookup page' do
|
|
46
50
|
@page.open
|
47
51
|
@page.title.text.strip.should == 'Load Summary Lookup'
|
48
52
|
end
|
49
|
-
end
|
53
|
+
end
|
@@ -22,6 +22,10 @@ describe 'An OLEFS Payment Request Creation page' do
|
|
22
22
|
@preq_screen = OLE_QA::Framework::OLEFS::PREQ_Creation.new(@ole)
|
23
23
|
end
|
24
24
|
|
25
|
+
after :all do
|
26
|
+
@ole.quit
|
27
|
+
end
|
28
|
+
|
25
29
|
it 'should create a new instance' do
|
26
30
|
@preq_screen.class.should == OLE_QA::Framework::OLEFS::PREQ_Creation
|
27
31
|
@preq_screen.class.superclass.should == OLE_QA::Framework::OLEFS::E_Doc
|
@@ -40,4 +44,4 @@ describe 'An OLEFS Payment Request Creation page' do
|
|
40
44
|
elements.include?(:continue_button).should be_true
|
41
45
|
elements.include?(:clear_button).should be_true
|
42
46
|
end
|
43
|
-
end
|
47
|
+
end
|
@@ -34,7 +34,6 @@ describe 'The Bib Editor' do
|
|
34
34
|
|
35
35
|
it 'should have bib editor elements' do
|
36
36
|
elements = @bib_editor.elements
|
37
|
-
elements.include?(:message).should be_true
|
38
37
|
elements.include?(:leader_field).should be_true
|
39
38
|
elements.include?(:bib_record_status_selector).should be_true
|
40
39
|
elements.include?(:set_button).should be_true
|
@@ -58,6 +57,10 @@ describe 'The Bib Editor' do
|
|
58
57
|
elements.include?(:control_008_field).should be_true
|
59
58
|
end
|
60
59
|
|
60
|
+
it 'should have bib editor functions' do
|
61
|
+
functions = @bib_editor.functions
|
62
|
+
end
|
63
|
+
|
61
64
|
it 'should start with one data line added' do
|
62
65
|
@bib_editor.data_line_1.class.should == OLE_QA::Framework::OLELS::Data_Line
|
63
66
|
end
|
@@ -22,6 +22,10 @@ describe 'An OLELS Describe Workbench page' do
|
|
22
22
|
@workbench = OLE_QA::Framework::OLELS::Describe_Workbench.new(@ole)
|
23
23
|
end
|
24
24
|
|
25
|
+
after :all do
|
26
|
+
@ole.quit
|
27
|
+
end
|
28
|
+
|
25
29
|
it 'should create a new instance' do
|
26
30
|
@workbench.class.should == OLE_QA::Framework::OLELS::Describe_Workbench
|
27
31
|
@workbench.class.superclass.should == OLE_QA::Framework::OLELS::Lookup
|
@@ -41,4 +45,4 @@ describe 'An OLELS Describe Workbench page' do
|
|
41
45
|
elements.include?(:search_which_selector_1).should be_true
|
42
46
|
elements.include?(:search_field_selector_1).should be_true
|
43
47
|
end
|
44
|
-
end
|
48
|
+
end
|
data/spec/olels/editor_spec.rb
CHANGED
@@ -43,6 +43,9 @@ describe 'The Editor base class' do
|
|
43
43
|
it 'should have editor elements' do
|
44
44
|
elements = @editor.elements
|
45
45
|
elements.include?(:title).should be_true
|
46
|
+
elements.should include(:message)
|
47
|
+
elements.should include(:messages)
|
48
|
+
elements.should include(:message_header)
|
46
49
|
elements.include?(:submit_button).should be_true
|
47
50
|
elements.include?(:cancel_button).should be_true
|
48
51
|
elements.include?(:close_button).should be_true
|
@@ -60,6 +63,7 @@ describe 'The Editor base class' do
|
|
60
63
|
functions.include?(:holdings_link).should be_true
|
61
64
|
functions.include?(:holdings_icon).should be_true
|
62
65
|
functions.include?(:item_link).should be_true
|
66
|
+
functions.should include(:message_count)
|
63
67
|
end
|
64
68
|
|
65
69
|
it 'should wait for a title to be present' do
|
data/spec/olels/edocs_spec.rb
CHANGED
@@ -37,6 +37,14 @@ describe 'An OLELS E-Document' do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'should have e-document elements' do
|
40
|
-
|
40
|
+
elements = @edoc.elements
|
41
|
+
elements.should include(:title)
|
42
|
+
elements.should include(:description_field)
|
43
|
+
elements.should include(:explanation_field)
|
44
|
+
elements.should include(:org_doc_number_field)
|
45
|
+
elements.should include(:document_id)
|
46
|
+
elements.should include(:document_status)
|
47
|
+
elements.should include(:initiator_id)
|
48
|
+
elements.should include(:creation_timestamp)
|
41
49
|
end
|
42
50
|
end
|
@@ -23,6 +23,10 @@ describe 'An OLELS Item Editor page' do
|
|
23
23
|
@item_editor = OLE_QA::Framework::OLELS::Item_Editor.new(@ole)
|
24
24
|
end
|
25
25
|
|
26
|
+
after :all do
|
27
|
+
@ole.quit
|
28
|
+
end
|
29
|
+
|
26
30
|
it 'should create a new instance' do
|
27
31
|
@item_editor.class.should == OLE_QA::Framework::OLELS::Item_Editor
|
28
32
|
@item_editor.class.superclass.should == OLE_QA::Framework::OLELS::Editor
|
@@ -30,9 +34,6 @@ describe 'An OLELS Item Editor page' do
|
|
30
34
|
|
31
35
|
it 'should have item editor elements' do
|
32
36
|
elements = @item_editor.methods
|
33
|
-
# Messages Elements
|
34
|
-
elements.include?(:message).should be_true
|
35
|
-
elements.include?(:messages).should be_true
|
36
37
|
# Holdings Location/Call Number Information
|
37
38
|
elements.include?(:holdings_location_field).should be_true
|
38
39
|
elements.include?(:holdings_prefix_field).should be_true
|
@@ -91,4 +92,4 @@ describe 'An OLELS Item Editor page' do
|
|
91
92
|
@item_editor.remove_item_note(2)
|
92
93
|
@item_editor.methods.include?(:item_note_2).should be_false
|
93
94
|
end
|
94
|
-
end
|
95
|
+
end
|
@@ -0,0 +1,55 @@
|
|
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 'A patron address line' do
|
19
|
+
|
20
|
+
before :all do
|
21
|
+
@ole = OLE_QA::Framework::Session.new
|
22
|
+
@line_1 = OLE_QA::Framework::OLELS::Patron_Address_Line.new(@ole, 1)
|
23
|
+
@line_2 = OLE_QA::Framework::OLELS::Patron_Address_Line.new(@ole, 2)
|
24
|
+
end
|
25
|
+
|
26
|
+
after :all do
|
27
|
+
@ole.quit
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should create a new instance' do
|
31
|
+
@line_1.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Address_Line)
|
32
|
+
@line_1.class.superclass.should == OLE_QA::Framework::OLELS::Line_Object
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should have address line elements' do
|
36
|
+
elements = @line_1.elements
|
37
|
+
elements.should include(:details_link)
|
38
|
+
elements.should include(:address_type_selector)
|
39
|
+
elements.should include(:address_source_selector)
|
40
|
+
elements.should include(:valid_from_date_field)
|
41
|
+
elements.should include(:valid_to_date_field)
|
42
|
+
elements.should include(:verified_checkbox)
|
43
|
+
elements.should include(:preferred_checkbox)
|
44
|
+
elements.should include(:active_checkbox)
|
45
|
+
elements.should include(:line_1_field)
|
46
|
+
elements.should include(:line_2_field)
|
47
|
+
elements.should include(:line_3_field)
|
48
|
+
elements.should include(:city_field)
|
49
|
+
elements.should include(:state_selector)
|
50
|
+
elements.should include(:postal_code_field)
|
51
|
+
elements.should include(:country_selector)
|
52
|
+
elements.should include(:add_button)
|
53
|
+
elements.should include(:delete_button)
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,44 @@
|
|
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 'A patron email line' do
|
19
|
+
before :all do
|
20
|
+
@ole = OLE_QA::Framework::Session.new
|
21
|
+
@line_1 = OLE_QA::Framework::OLELS::Patron_Email_Line.new(@ole,1)
|
22
|
+
@line_2 = OLE_QA::Framework::OLELS::Patron_Email_Line.new(@ole,2)
|
23
|
+
end
|
24
|
+
|
25
|
+
after :all do
|
26
|
+
@ole.quit
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should create a new instance' do
|
30
|
+
@line_1.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Email_Line)
|
31
|
+
@line_2.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Email_Line)
|
32
|
+
@line_1.class.superclass.should == OLE_QA::Framework::OLELS::Line_Object
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should have email line elements' do
|
36
|
+
elements = @line_1.elements
|
37
|
+
elements.should include(:email_type_selector)
|
38
|
+
elements.should include(:email_address_field)
|
39
|
+
elements.should include(:preferred_checkbox)
|
40
|
+
elements.should include(:active_checkbox)
|
41
|
+
elements.should include(:add_button)
|
42
|
+
elements.should include(:delete_button)
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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
|
+
@line_1 = OLE_QA::Framework::OLELS::Patron_Phone_Line.new(@ole,1)
|
23
|
+
@line_2 = OLE_QA::Framework::OLELS::Patron_Phone_Line.new(@ole,2)
|
24
|
+
end
|
25
|
+
|
26
|
+
after :all do
|
27
|
+
@ole.quit
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should create a new instance' do
|
31
|
+
@line_1.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Phone_Line)
|
32
|
+
@line_2.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Phone_Line)
|
33
|
+
@line_1.class.superclass.should == OLE_QA::Framework::OLELS::Line_Object
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should have patron phone line elements' do
|
37
|
+
elements = @line_1.elements
|
38
|
+
elements.should include(:phone_type_selector)
|
39
|
+
elements.should include(:phone_number_field)
|
40
|
+
elements.should include(:extension_field)
|
41
|
+
elements.should include(:country_selector)
|
42
|
+
elements.should include(:preferred_checkbox)
|
43
|
+
elements.should include(:active_checkbox)
|
44
|
+
elements.should include(:add_button)
|
45
|
+
elements.should include(:delete_button)
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,125 @@
|
|
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 'A patron record page' do
|
19
|
+
|
20
|
+
before :all do
|
21
|
+
@ole = OLE_QA::Framework::Session.new
|
22
|
+
@page = OLE_QA::Framework::OLELS::Patron.new(@ole)
|
23
|
+
end
|
24
|
+
|
25
|
+
after :all do
|
26
|
+
@ole.quit
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should create a new instance' do
|
30
|
+
@page.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron)
|
31
|
+
@page.class.superclass.should == OLE_QA::Framework::OLELS::E_Doc
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should have patron elements' do
|
35
|
+
elements = @page.elements
|
36
|
+
elements.should include(:patron_id)
|
37
|
+
elements.should include(:barcode_field)
|
38
|
+
elements.should include(:borrower_type_selector)
|
39
|
+
elements.should include(:source_selector)
|
40
|
+
elements.should include(:patron_image_field)
|
41
|
+
elements.should include(:upload_image_button)
|
42
|
+
elements.should include(:statistical_category_selector)
|
43
|
+
elements.should include(:activation_date_field)
|
44
|
+
elements.should include(:expiration_date_field)
|
45
|
+
elements.should include(:active_checkbox)
|
46
|
+
elements.should include(:name_type)
|
47
|
+
elements.should include(:title_selector)
|
48
|
+
elements.should include(:first_name_field)
|
49
|
+
elements.should include(:last_name_field)
|
50
|
+
elements.should include(:middle_name_field)
|
51
|
+
elements.should include(:suffix_selector)
|
52
|
+
elements.should include(:affiliation_toggle)
|
53
|
+
elements.should include(:library_policies_toggle)
|
54
|
+
elements.should include(:loaned_records_toggle)
|
55
|
+
elements.should include(:requested_records_toggle)
|
56
|
+
elements.should include(:temp_circ_history_toggle)
|
57
|
+
elements.should include(:note_toggle)
|
58
|
+
elements.should include(:proxy_patron_toggle)
|
59
|
+
elements.should include(:proxy_for_toggle)
|
60
|
+
elements.should include(:local_id_toggle)
|
61
|
+
elements.should include(:lost_barcode_toggle)
|
62
|
+
elements.should include(:ad_hoc_toggle)
|
63
|
+
elements.should include(:route_log_toggle)
|
64
|
+
elements.should include(:contacts_toggle)
|
65
|
+
elements.should include(:overview_toggle)
|
66
|
+
elements.should include(:name_toggle)
|
67
|
+
elements.should include(:address_toggle)
|
68
|
+
elements.should include(:phone_toggle)
|
69
|
+
elements.should include(:email_toggle)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'should have patron functions' do
|
73
|
+
functions = @page.functions
|
74
|
+
functions.should include(:redefine_patron_image_elements)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'should have contact info lines' do
|
78
|
+
all_methods = @page.methods
|
79
|
+
all_methods.should include(:address_line_1)
|
80
|
+
all_methods.should include(:phone_line_1)
|
81
|
+
all_methods.should include(:email_line_1)
|
82
|
+
all_methods.should include(:add_address_line)
|
83
|
+
all_methods.should include(:add_phone_line)
|
84
|
+
all_methods.should include(:add_email_line)
|
85
|
+
all_methods.should include(:remove_address_line)
|
86
|
+
all_methods.should include(:remove_phone_line)
|
87
|
+
all_methods.should include(:remove_email_line)
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should add contact info lines' do
|
91
|
+
@page.add_address_line(2)
|
92
|
+
@page.add_phone_line(2)
|
93
|
+
@page.add_email_line(2)
|
94
|
+
methods = @page.methods
|
95
|
+
methods.should include(:address_line_2)
|
96
|
+
methods.should include(:phone_line_2)
|
97
|
+
methods.should include(:email_line_2)
|
98
|
+
@page.address_line_2.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Address_Line)
|
99
|
+
@page.phone_line_2.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Phone_Line)
|
100
|
+
@page.email_line_2.should be_an_instance_of(OLE_QA::Framework::OLELS::Patron_Email_Line)
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'should remove contact info lines' do
|
104
|
+
@page.remove_address_line(2)
|
105
|
+
@page.remove_phone_line(2)
|
106
|
+
@page.remove_email_line(2)
|
107
|
+
methods = @page.methods
|
108
|
+
methods.should_not include(:address_line_2)
|
109
|
+
methods.should_not include(:phone_line_2)
|
110
|
+
methods.should_not include(:email_line_2)
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'should not remove contact info lines which do not exist' do
|
114
|
+
lambda {@page.remove_address_line(2)}.should raise_error
|
115
|
+
lambda {@page.remove_phone_line(2)}.should raise_error
|
116
|
+
lambda {@page.remove_email_line(2)}.should raise_error
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'should open the page via URL' do
|
120
|
+
@ole.open
|
121
|
+
@page.login('admin').should be_true
|
122
|
+
@page.open
|
123
|
+
@page.title.when_present.text.strip.should == 'Patron'
|
124
|
+
end
|
125
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ole-qa-framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -183,12 +183,16 @@ files:
|
|
183
183
|
- lib/olels/objects/holdings_note.rb
|
184
184
|
- lib/olels/objects/item_note.rb
|
185
185
|
- lib/olels/objects/ownership_extent_line.rb
|
186
|
+
- lib/olels/objects/patron_address_line.rb
|
187
|
+
- lib/olels/objects/patron_email_line.rb
|
188
|
+
- lib/olels/objects/patron_phone_line.rb
|
186
189
|
- lib/olels/pages/bib_editor.rb
|
187
190
|
- lib/olels/pages/describe_workbench.rb
|
188
191
|
- lib/olels/pages/instance_editor.rb
|
189
192
|
- lib/olels/pages/item_editor.rb
|
190
193
|
- lib/olels/pages/loan.rb
|
191
194
|
- lib/olels/pages/main_menu.rb
|
195
|
+
- lib/olels/pages/patron.rb
|
192
196
|
- lib/olels/pages/patron_lookup.rb
|
193
197
|
- lib/olels/pages/return.rb
|
194
198
|
- lib/olels/pages/staff_upload.rb
|
@@ -238,7 +242,11 @@ files:
|
|
238
242
|
- spec/olels/main_menu_spec.rb
|
239
243
|
- spec/olels/ownership_extent_line_spec.rb
|
240
244
|
- spec/olels/ownership_note_spec.rb
|
245
|
+
- spec/olels/patron_address_line_spec.rb
|
246
|
+
- spec/olels/patron_email_line_spec.rb
|
241
247
|
- spec/olels/patron_lookup_spec.rb
|
248
|
+
- spec/olels/patron_phone_line_spec.rb
|
249
|
+
- spec/olels/patron_spec.rb
|
242
250
|
- spec/olels/return_spec.rb
|
243
251
|
- spec/olels/staff_upload_spec.rb
|
244
252
|
- spec/spec_helper.rb
|
@@ -313,7 +321,11 @@ test_files:
|
|
313
321
|
- spec/olels/main_menu_spec.rb
|
314
322
|
- spec/olels/ownership_extent_line_spec.rb
|
315
323
|
- spec/olels/ownership_note_spec.rb
|
324
|
+
- spec/olels/patron_address_line_spec.rb
|
325
|
+
- spec/olels/patron_email_line_spec.rb
|
316
326
|
- spec/olels/patron_lookup_spec.rb
|
327
|
+
- spec/olels/patron_phone_line_spec.rb
|
328
|
+
- spec/olels/patron_spec.rb
|
317
329
|
- spec/olels/return_spec.rb
|
318
330
|
- spec/olels/staff_upload_spec.rb
|
319
331
|
- spec/spec_helper.rb
|