ole-qa-framework 3.6.7 → 3.7.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWM2NDk3MmEzZWI4NzUzODExYWUxZTlhNTRlNTliMjJlY2M0OTM0YQ==
4
+ YzA3Y2JhZjVjNWUwMzlhOWU0ODhmMmUzYWYyZTdiYzQ5MDE5MzZjOA==
5
5
  data.tar.gz: !binary |-
6
- NWYxMWQ0NjgxM2E3YmRhY2I2ZGU1NDhiY2NjN2YwYTMxYWM3ZmUxZA==
6
+ ZTczNDk2NTkxOWI1Yzc5ZjE5NWQxOTQ0YTk2Njk0YmY1ZTg4Y2QyZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmU0ODIxZTgzZDBmOGUwMGRkNWZkOGFhZmFmNDIxYjMxN2VjOWViZTJkYjk1
10
- ZDUwZjc0YTk0ZWU4MTNkMDlkNThlZWE2YjA5MjY0NWQ2MjFlZjYyM2YwMGRm
11
- NTY4MDczYmZlZDQwNWExN2M4Nzg4YzAxOTUzZGE3NWYxYWE1MGU=
9
+ NTBhZThhMWI5ZTRjN2RkYjYyOWFlNDljN2RlZDI3Y2VjZTMwM2ZlYzNiZGY1
10
+ NWU0ZWZiZmE1YTIzMzFjZGQyNDZiZWIzOTAwYTZhNjllMTg5NzNmZjIzYWY3
11
+ MDliZjUwZjFlNmRkNzhiZDA4NjBiM2E4ODY5M2M2MjJkMWMwNWI=
12
12
  data.tar.gz: !binary |-
13
- MmJkYjgxMDM1MjkzOGQ2N2E2MjJkYTc3YzU4MGI2NDViYTJiYWU5ZGY4MTRj
14
- ZGVlZjFhODI3ZDNlNTIzMTM3NDRmZDRhMGFhMjQ4OWNmZWEwNmFlMTk0NjYz
15
- M2JiZmQ4NTliYzYwYjNmM2FmMmQzNmQxZjI1NjYzNmY1NDc1Njg=
13
+ Y2QyMjkyMmI2ODRlY2RjNGEwZWM5NWE2ZDE0NzkyN2RlZDIxMjAzYTk2OGMw
14
+ ZmI0ZGU3MWYwYjYzMzNlY2RhYWVmNTU2ZjkwMDQwMDRmZDExZTcyYzQwYmU4
15
+ OGNjY2NlYWM0MzZlYWQ4ZTE5OGI1OGJkYzFhZTZmYjU2NTZiNmQ=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### v3.7.0 - 2013/12/18
2
+
3
+ * Location Pages
4
+ * Location Lookup
5
+ * Location Level Lookup
6
+ * Location
7
+ * Location Factory
8
+ * Location Code
9
+
1
10
  ### v3.6.7 - 2013/12/13
2
11
 
3
12
  * Patron Lookup
@@ -0,0 +1,33 @@
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
16
+ # This class contains methods to generate assorted metadata.
17
+ class Metadata_Factory
18
+ class << self
19
+ include OLE_QA::Framework::Factory_Helpers
20
+
21
+ # Generate a usable OLE location code.
22
+ def location_code
23
+ str_out = String.new
24
+ str_out << sampler('A'..'Z')
25
+ str_out << sampler('0'..'9')
26
+ str_out << str(sampler(2..4))
27
+ str_out.upcase
28
+ end
29
+ alias_method(:new_location_code,:location_code)
30
+
31
+ end
32
+ end
33
+ end
@@ -16,11 +16,16 @@ module OLE_QA::Framework
16
16
  # Return usable patron records from source files in ole-qa-framework/data/patron.yml
17
17
  class Patron_Factory
18
18
 
19
+
19
20
  @patron_matrix = YAML.load(File.read("#{OLE_QA::Framework.data_dir}/patron.yml"))
20
21
  @states = YAML.load(File.read("#{OLE_QA::Framework.data_dir}/states.yml"))
21
22
  @borrower_types = YAML.load(File.read("#{OLE_QA::Framework.data_dir}/borrower_types.yml"))
22
23
 
23
24
  class << self
25
+
26
+
27
+ include OLE_QA::Framework::Factory_Helpers
28
+
24
29
  # An array containing a collection of valid OLE patron records.
25
30
  attr_reader :patron_matrix
26
31
 
@@ -49,36 +54,7 @@ module OLE_QA::Framework
49
54
  patron[:email] = patron[:first] + patron[:last] + '@' + str(sampler(4..8)) + '.' + str(3)
50
55
  patron
51
56
  end
52
-
53
- def name_builder(max_len = 8)
54
- out = Array.new
55
- out << sampler
56
- max_len -= 1
57
- max_len.times do
58
- out << sampler('a'..'z')
59
- end
60
- out.join
61
- end
62
- private :name_builder
63
57
 
64
- def sampler(r = 'A'..'Z')
65
- r.to_a.sample
66
- end
67
- private :sampler
68
-
69
- def str(len=8)
70
- ary = Array.new
71
- len.times { ary << sampler('a'..'z') }
72
- ary.join
73
- end
74
- private :str
75
-
76
- def num_str(len = 8)
77
- ary = Array.new
78
- len.times { ary << sampler('0'..'9') }
79
- ary.join
80
- end
81
- private :num_str
82
58
  end
83
59
  end
84
60
  end
@@ -17,36 +17,30 @@ module OLE_QA::Framework
17
17
  class String_Factory
18
18
  class << self
19
19
 
20
+ include OLE_QA::Framework::Factory_Helpers
21
+
20
22
  def alpha(len = 9)
21
- str = String.new
22
- len.times do
23
- str << (('A'..'Z').to_a).sample
24
- end
25
- str
23
+ str(len).upcase
26
24
  end
27
25
 
28
26
  def numeric(len = 9)
29
- str = String.new
30
- len.times do
31
- str << (('0'..'9').to_a).sample
32
- end
33
- str
27
+ num_str(len)
34
28
  end
35
29
 
36
30
  def alphanumeric(len = 9)
37
- str = String.new
31
+ str_out = String.new
38
32
  len.times do
39
- str << (('A'..'Z').to_a + ('0'..'9').to_a).sample
33
+ str_out << (('A'..'Z').to_a + ('0'..'9').to_a).sample
40
34
  end
41
- str
35
+ str_out
42
36
  end
43
37
 
44
38
  def phone
45
- str = '555-'
46
- 3.times {str << (('0'..'9').to_a).sample}
47
- str << '-'
48
- 4.times {str << (('0'..'9').to_a).sample}
49
- str
39
+ str_out = '555-'
40
+ str_out << num_str(3)
41
+ str_out << '-'
42
+ str_out << num_str(4)
43
+ str_out
50
44
  end
51
45
  end
52
46
  end
@@ -0,0 +1,49 @@
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
16
+ # This mix-in module contains helper methods for other data factory modules.
17
+ module Factory_Helpers
18
+ def name_builder(max_len = 8)
19
+ out = Array.new
20
+ out << sampler
21
+ max_len -= 1
22
+ max_len.times do
23
+ out << sampler('a'..'z')
24
+ end
25
+ out.join
26
+ end
27
+ private :name_builder
28
+
29
+ def sampler(r = 'A'..'Z')
30
+ r.to_a.sample
31
+ end
32
+ private :sampler
33
+
34
+ def str(len=8)
35
+ ary = Array.new
36
+ len.times { ary << sampler('a'..'z') }
37
+ ary.join
38
+ end
39
+ private :str
40
+
41
+ def num_str(len = 8)
42
+ ary = Array.new
43
+ len.times { ary << sampler('0'..'9') }
44
+ ary.join
45
+ end
46
+ private :num_str
47
+
48
+ end
49
+ end
@@ -124,8 +124,8 @@ module OLE_QA
124
124
  # (Set the wait period used by custom wait functions)
125
125
  # :doc_wait => NN
126
126
  # (Set the wait period for eDoc routing to complete)
127
- # :browser => selenium_webdriver
128
- # (Where browser is a Selenium WebDriver session)
127
+ # :browser => watir_webdriver
128
+ # (Where browser is a Watir WebDriver session)
129
129
  #
130
130
  # To configure the default options, edit
131
131
  # lib/config/default_options.yml
@@ -15,6 +15,6 @@
15
15
  module OLE_QA
16
16
  module Framework
17
17
  # The version number for this project.
18
- VERSION = '3.6.7'
18
+ VERSION = '3.7.0'
19
19
  end
20
20
  end
@@ -0,0 +1,61 @@
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
+ # The view/edit page for Location in the OLE Library System
17
+ class Location < OLE_QA::Framework::OLELS::E_Doc
18
+ def initialize(ole_session)
19
+ url = ole_session.url + 'portal.do?channelTitle=Location &channelUrl='
20
+ url += ole_session.url + 'ole-kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.ole.describe.bo.OleLocation&returnLocation='
21
+ url += ole_session.url + 'portal.do&hideReturnLink=true&showMaintenanceLinks=true'
22
+ super(ole_session, url)
23
+ end
24
+
25
+ def set_elements
26
+ super
27
+ element(:document_id, true) {b.span(:id => 'Uif-OleDocumentNumber_control')}
28
+ element(:initiator_id, true) {b.span(:id => 'Uif-OleDocumentInitiatorNetworkId_control')}
29
+ element(:document_status, true) {b.span(:id => 'Uif-OleDocumentStatus_control')}
30
+ element(:creation_timestamp, true) {b.span(:id => 'Uif-OleDocumentCreateDate_control')}
31
+ element(:error_message) {b.ul(:id => 'pageValidationList').li(:class => 'uif-errorMessageItem')}
32
+ element(:message) {b.ul(:id => 'pageValidationList').li(:class => 'uif-infoMessageItem')}
33
+ element(:location_code_field) {b.text_field(:id => 'create_locationCode_control')}
34
+ element(:location_name_field) {b.text_field(:id => 'create_locationName_control')}
35
+ element(:location_level_field) {b.text_field(:id => 'create_levelId_control')}
36
+ element(:location_level_icon) {b.input(:title => 'Search Field', :index => 0)}
37
+ element(:parent_location_selector) {b.select_list(:id => 'create_parentLocationId_control')}
38
+ element(:parent_location_icon) {b.input(:title => 'Search Field', :index => 1)}
39
+ element(:submit_button) {b.button(:id => 'oleSubmit')}
40
+ element(:save_button) {b.button(:id => 'usave')}
41
+ element(:blanket_approve_button) {b.button(:id => 'oleBlanketApprove')}
42
+ element(:back_button) {b.button(:id => 'oleClose')}
43
+ element(:close_button) {back_button}
44
+ element(:cancel_link) {b.a(:id => 'ucancel')}
45
+ end
46
+
47
+ def set_functions
48
+ super
49
+ # Submit the document, and when the outcome message is present, check for success.
50
+ function(:submit) { submit_button.when_present.click
51
+ Watir::Wait.until { message.present? || error_message.present? }
52
+ message.present? && message.text.include?('successfully submitted') ? true : false }
53
+ end
54
+
55
+ def wait_for_elements
56
+ super
57
+ @wait_on << :location_code_field
58
+ @wait_on << :parent_location_selector
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,53 @@
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
+ # The location level lookup screen in the OLE Library System
17
+ class Location_Level_Lookup < OLE_QA::Framework::OLELS::Lookup
18
+ def initialize(ole_session)
19
+ url = ole_session.url + 'portal.do?channelTitle=Location Level&channelUrl='
20
+ url += ole_session.url + 'ole-kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.ole.describe.bo.OleLocationLevel&returnLocation='
21
+ url += ole_session.url + 'portal.do&hideReturnLink=true&showMaintenanceLinks=true'
22
+ super(ole_session, url)
23
+ end
24
+
25
+ def set_elements
26
+ super
27
+ element(:level_id_icon) {b.input(:title => 'Direct Inquiry')}
28
+ element(:level_code_field) {b.text_field(:name => 'lookupCriteria[levelCode]')}
29
+ element(:level_name_field) {b.text_field(:name => 'lookupCriteria[levelName]')}
30
+ element(:search_button) {b.button(:text => /[Ss]earch/)}
31
+ element(:clear_button) {b.button(:text => /[Cc]lear/)}
32
+ element(:cancel_button) {b.button(:text => /[Cc]ancel/)}
33
+ end
34
+
35
+ def set_functions
36
+ super
37
+ # Query whether the given text value exists in the search results.
38
+ function(:text_in_results?) {|which| b.span(:xpath => "//td/div/span[contains(text(),'#{which}')]")}
39
+ # Return the 'edit' link for a search results line containing a given value.
40
+ function(:edit_by_text) {|which| b.a(:xpath => "//tr[td/div/span[contains(text(),'#{which}')]]/td[1]/div/fieldset/div/div/a[contains(text(),'edit')]")}
41
+ # Return the 'Level ID' link for a search results line containing a given value.
42
+ function(:id_by_text) {|which| b.a(:xpath => "//tr[td/div/span[contains(text(),'#{which}')]]/td[2]/div/span/a")}
43
+ # Return the 'Parent Level ID' link for a search results line containing a given value.
44
+ function(:parent_id_by_text) {|which| b.a(:xpath => "//tr[td/div/span[contains(text(),'#{which}')]]/td[5]/div/span/a")}
45
+ end
46
+
47
+ def wait_for_elements
48
+ super
49
+ @wait_on << :level_code_field
50
+ @wait_on << :search_button
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
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
+ # The location lookup screen in the OLE Library System
17
+ class Location_Lookup < OLE_QA::Framework::OLELS::Lookup
18
+ def initialize(ole_session)
19
+ url = ole_session.url + 'portal.do?channelTitle=Location &channelUrl='
20
+ url += ole_session.url + 'ole-kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.ole.describe.bo.OleLocation&returnLocation='
21
+ url += ole_session.url + 'portal.do&hideReturnLink=true&showMaintenanceLinks=true'
22
+ super(ole_session, url)
23
+ end
24
+
25
+ def set_elements
26
+ super
27
+ element(:location_id_field) {b.text_field(:id => 'locationId_control')}
28
+ element(:location_code_field) {b.text_field(:id => 'locationCode_control')}
29
+ element(:location_name_field) {b.text_field(:id => 'locationName_control')}
30
+ element(:location_level_field) {b.text_field(:id => 'levelId_control')}
31
+ element(:location_level_icon) {b.input(:title => 'Search Field')}
32
+ element(:search_button) {b.button(:text => /[Ss]earch/)}
33
+ element(:clear_button) {b.button(:text => /[Cc]lear/)}
34
+ element(:cancel_button) {b.button(:text => /[Cc]ancel/)}
35
+ end
36
+
37
+ def set_functions
38
+ super
39
+ # A function to query whether a given text value exists in the search results.
40
+ function(:text_in_results?) {|which| b.span(:xpath => "//td/div/span[contains(text(),'#{which}')]").present?}
41
+ # Return the 'edit' link for a search results line containing the given text.
42
+ function(:edit_by_text) {|which| b.a(:xpath => "//td[div/span[contains(text(),'#{which}')]]/preceding-sibling::td/div/fieldset/div/div/a[contains(text(),'edit')]")}
43
+ # Return the 'copy' link for a search results line containing the given text.
44
+ function(:copy_by_text) {|which| b.a(:xpath => "//td[div/span[contains(text(),'#{which}')]]/preceding-sibling::td/div/fieldset/div/div/a[contains(text(),'copy')]")}
45
+ end
46
+
47
+ def wait_for_elements
48
+ super
49
+ @wait_on << :location_id_field
50
+ @wait_on << :search_button
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,14 @@
1
+ require 'rspec'
2
+ require 'spec_helper.rb'
3
+
4
+ describe 'The Metadata Factory' do
5
+
6
+ it 'should create a location code' do
7
+ location = OLE_QA::Framework::Metadata_Factory.location_code
8
+ location.should be_a(String)
9
+ location.should =~ /^[A-Z]/
10
+ location.should =~ /[A-Z,0-9]+/
11
+ location.should =~ /\d/
12
+ end
13
+
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ole-qa-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.7
4
+ version: 3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jain Waldrip
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-13 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,11 +123,13 @@ files:
123
123
  - lib/config/default_options.yml
124
124
  - lib/data_factory/account_factory.rb
125
125
  - lib/data_factory/bib_factory.rb
126
+ - lib/data_factory/metadata_factory.rb
126
127
  - lib/data_factory/patron_factory.rb
127
128
  - lib/data_factory/string_factory.rb
128
129
  - lib/docstore/common/results.rb
129
130
  - lib/docstore/pages/marc_results.rb
130
131
  - lib/docstore/pages/search.rb
132
+ - lib/module/factory_helpers.rb
131
133
  - lib/module/qa_data_helpers.rb
132
134
  - lib/module/qa_helpers.rb
133
135
  - lib/module/qa_page_helpers.rb
@@ -191,6 +193,9 @@ files:
191
193
  - lib/olels/pages/instance_editor.rb
192
194
  - lib/olels/pages/item_editor.rb
193
195
  - lib/olels/pages/loan.rb
196
+ - lib/olels/pages/location.rb
197
+ - lib/olels/pages/location_level_lookup.rb
198
+ - lib/olels/pages/location_lookup.rb
194
199
  - lib/olels/pages/main_menu.rb
195
200
  - lib/olels/pages/patron.rb
196
201
  - lib/olels/pages/patron_lookup.rb
@@ -205,6 +210,7 @@ files:
205
210
  - spec/common/subline_object_spec.rb
206
211
  - spec/data_factory/account_factory_spec.rb
207
212
  - spec/data_factory/bib_factory_spec.rb
213
+ - spec/data_factory/metadata_factory_spec.rb
208
214
  - spec/data_factory/patron_factory_spec.rb
209
215
  - spec/data_factory/string_factory_spec.rb
210
216
  - spec/modules/qa_helpers_spec.rb
@@ -242,6 +248,7 @@ test_files:
242
248
  - spec/common/subline_object_spec.rb
243
249
  - spec/data_factory/account_factory_spec.rb
244
250
  - spec/data_factory/bib_factory_spec.rb
251
+ - spec/data_factory/metadata_factory_spec.rb
245
252
  - spec/data_factory/patron_factory_spec.rb
246
253
  - spec/data_factory/string_factory_spec.rb
247
254
  - spec/modules/qa_helpers_spec.rb