ole-qa-framework 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG.md +14 -0
- data/README.md +2 -8
- data/data/accounts.yml +51 -0
- data/data/objects.yml +26 -0
- data/lib/data_factory/account_factory.rb +52 -0
- data/lib/data_factory/bib_factory.rb +35 -0
- data/lib/data_factory/string_factory.rb +53 -0
- data/lib/ole-qa-framework.rb +12 -0
- data/lib/ole_qa_framework/VERSION.rb +1 -1
- data/spec/data_factory/account_factory_spec.rb +39 -0
- data/spec/data_factory/bib_factory_spec.rb +31 -0
- data/spec/data_factory/string_factory_spec.rb +43 -0
- metadata +16 -23
- data/examples/README.md +0 -57
- data/examples/create_bib_record.rb +0 -64
- data/examples/create_requisition.rb +0 -96
- data/examples/purap_workflow_test.rb +0 -185
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Zjk3MjlmMDEzMWM0NTc3MjlmN2VhYmQ2YTcyYjZhZDk4YmMyMzFiZg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
M2NiODVmMWU1ODAyOGZhNTk3NjA1ZWIwYmI3MzQ1YWNmZDhlZTYxMg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGQ3NGUwMjkyZWJlMThhNjMzNjlmODAwNDkxMDMyNjQ3NGEyNDZjY2FiM2U1
|
10
|
+
ZWVkMGZmZTFiMWUzNTY1NWQ5ZTRjMDRjZDBlYzA4N2I0ZTdiMzE1MGU4Y2Q1
|
11
|
+
YzRjMmNjMWZlMTUzZDk3YzQ0MGViODkyNmJiMDI2YjQ5MzE1ZjE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTM2ZjEzZTE4YTQ0MWU1ZGMyYzExYTBlNjk1YmYxM2RjN2ZlM2JjZTMxNDg3
|
14
|
+
ZDc3NDhkN2E4NzA2ZTUyMGQ2YmVhYzc5NWVkMTE2Y2Y5MjY0ODcxZjg2MTYx
|
15
|
+
ZWRkZWZiYWYyYjI3ZjMzMzczYTg0YzFmYzRiMDM3MmJlODRjMmQ=
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
### v3.3.0 - 2013/11/26
|
2
|
+
|
3
|
+
* Data & Data Factories
|
4
|
+
* Data Factories implemented for:
|
5
|
+
* Accounting Strings (IU Sample Data used)
|
6
|
+
* Bib Data
|
7
|
+
* Barcode
|
8
|
+
* Call Number (LCC Format)
|
9
|
+
* Random Alphanumeric Strings of Preset Length
|
10
|
+
* Alphabetic only
|
11
|
+
* Numeric only
|
12
|
+
* Alphanumeric
|
13
|
+
* Telephone Numbers
|
14
|
+
|
1
15
|
### v3.2.0 - 2013/11/12
|
2
16
|
|
3
17
|
* Batch Import Screens
|
data/README.md
CHANGED
@@ -7,11 +7,5 @@ http://www.kuali.org/ole
|
|
7
7
|
### Open Library Environment Quality Assurance Testing Framework
|
8
8
|
- - -
|
9
9
|
This is a testing framework for the Kuali Open Library environment. It
|
10
|
-
|
11
|
-
and the OLE
|
12
|
-
|
13
|
-
### Usage Examples
|
14
|
-
- - -
|
15
|
-
The examples directory contains some minimal example scripts to show
|
16
|
-
how the testing framework can be used to fulfill common OLE
|
17
|
-
use case scenarios.
|
10
|
+
is be used to define OLE pages and screen elements for OLE regression
|
11
|
+
testing scripts and the OLE Smoketest application.
|
data/data/accounts.yml
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# From OLE 0.6 Driver's Manual
|
2
|
+
# https://wiki.kuali.org/download/attachments/313884198/OLE_Drivers_+Manual_+0.6_Final20120807.pdf#page=141
|
3
|
+
# :Chart_Code:
|
4
|
+
# - - Account_Number
|
5
|
+
# - Account_Name
|
6
|
+
---
|
7
|
+
:BL:
|
8
|
+
- - '1047410'
|
9
|
+
- Library Monographs
|
10
|
+
- - '1047415'
|
11
|
+
- Library Serials
|
12
|
+
- - '2947486'
|
13
|
+
- CHEMISTRY
|
14
|
+
- - '2947482'
|
15
|
+
- EDUCATION
|
16
|
+
- - '2947430'
|
17
|
+
- GEOLOGY
|
18
|
+
- - '2947485'
|
19
|
+
- BIOLOGY
|
20
|
+
- - '2947483'
|
21
|
+
- MEDICAL SCIENCES
|
22
|
+
- - '2947498'
|
23
|
+
- COMM & CULTURE
|
24
|
+
- - '2947499'
|
25
|
+
- CENTRAL EURASIAN
|
26
|
+
- - '2947487'
|
27
|
+
- COMPARATIVE LIT
|
28
|
+
- - '2947489'
|
29
|
+
- FRENCH & ITALIAN
|
30
|
+
- - '2947488'
|
31
|
+
- FOLKLORE
|
32
|
+
- - '2947491'
|
33
|
+
- HISTORY
|
34
|
+
- - '2947492'
|
35
|
+
- HIST & PHIL OF SCI
|
36
|
+
- - '2947493'
|
37
|
+
- LATIN AMERICAN
|
38
|
+
- - '2947494'
|
39
|
+
- LINGUISTICS
|
40
|
+
- - '2947495'
|
41
|
+
- RELIGIOUS STUDIES
|
42
|
+
- - '2947496'
|
43
|
+
- SOCIOLOGY
|
44
|
+
- - '2947490'
|
45
|
+
- SPEECH AND HEARING
|
46
|
+
- - '2947497'
|
47
|
+
- SPANISH/PORTUGESE
|
48
|
+
- - '2947484'
|
49
|
+
- COLLEGE OF ARTS AND SCIENCES
|
50
|
+
- - '29474500'
|
51
|
+
- SCHOOL OF MEDICINE
|
data/data/objects.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# From OLE 0.6 Driver's Manual
|
2
|
+
# https://wiki.kuali.org/download/attachments/313884198/OLE_Drivers_+Manual_+0.6_Final20120807.pdf#page=141
|
3
|
+
# :Chart_Code:
|
4
|
+
# - - Object_Number
|
5
|
+
# - Object_Name
|
6
|
+
---
|
7
|
+
:IU:
|
8
|
+
- - '7110'
|
9
|
+
- Monographs
|
10
|
+
- - '7120'
|
11
|
+
- Serial Acquisitions
|
12
|
+
:BL:
|
13
|
+
- - '7100'
|
14
|
+
- Library Books
|
15
|
+
- - '7110'
|
16
|
+
- Monographs
|
17
|
+
- - '7112'
|
18
|
+
- Monograph Firm
|
19
|
+
- - '7115'
|
20
|
+
- Monograph Approval
|
21
|
+
- - '7120'
|
22
|
+
- Serials
|
23
|
+
- - '7122'
|
24
|
+
- Serials Firm
|
25
|
+
- - '7125'
|
26
|
+
- Serials Approval
|
@@ -0,0 +1,52 @@
|
|
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
|
+
|
17
|
+
# Generate usable accounting strings from source files in ole-qa-framework/data/
|
18
|
+
class Account_Factory
|
19
|
+
|
20
|
+
account_file = File.open("#{OLE_QA::Framework.data_dir}/accounts.yml",'r')
|
21
|
+
@account_matrix = YAML.load(account_file)
|
22
|
+
account_file.close
|
23
|
+
|
24
|
+
object_file = File.open("#{OLE_QA::Framework.data_dir}/objects.yml",'r')
|
25
|
+
@object_matrix = YAML.load(object_file)
|
26
|
+
object_file.close
|
27
|
+
|
28
|
+
class << self
|
29
|
+
|
30
|
+
# A Hash containing a list of valid OLE Test Environment Account Numbers.
|
31
|
+
# :Chart_Code => [['123456','Account Name'],['789012','Account Name']]
|
32
|
+
attr_reader :account_matrix
|
33
|
+
|
34
|
+
# A Hash containing a list of valid OLE Test Environment Object Codes.
|
35
|
+
# :Chart_Code => [[],[]]
|
36
|
+
attr_reader :object_matrix
|
37
|
+
|
38
|
+
# Return a random accounting array.
|
39
|
+
# @param chart_code [Symbol] The chart code from which the account should be selected.
|
40
|
+
def select_account(chart_code = :BL)
|
41
|
+
@account_matrix[chart_code].sample
|
42
|
+
end
|
43
|
+
|
44
|
+
# Return a random object array.
|
45
|
+
# @param chart_code [Symbol] The chart code from which the object should be selected.
|
46
|
+
def select_object(chart_code = :BL)
|
47
|
+
@object_matrix[chart_code].sample
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
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
|
+
module OLE_QA::Framework
|
16
|
+
# Manufacture strings for bibliographic record testing
|
17
|
+
class Bib_Factory
|
18
|
+
# Return a random string of between 12 and 18 numbers to be used as a barcode.
|
19
|
+
def self.barcode
|
20
|
+
(0..(11..17).to_a.sample).map{(0..9).to_a.sample}.join
|
21
|
+
end
|
22
|
+
|
23
|
+
# Return a random (non-validated) call number in the specified format.
|
24
|
+
def self.call_number(format = "LOC")
|
25
|
+
call_num = Array.new
|
26
|
+
# TODO - Use case...when once other formats are added.
|
27
|
+
# LOC Format Call Number
|
28
|
+
call_num << (0..(0..1).to_a.sample).map{('A'..'Z').to_a.sample}.join
|
29
|
+
call_num << (0..(1..3).to_a.sample).map{(1..9).to_a.sample}.join << " "
|
30
|
+
call_num << "." << ('A'..'Z').to_a.sample
|
31
|
+
call_num << (0..(1..2).to_a.sample).map{(1..9).to_a.sample}.join
|
32
|
+
call_num.join
|
33
|
+
end
|
34
|
+
end
|
35
|
+
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
|
16
|
+
# Generate random alphabetic, numeric, or alphanumeric strings of a given length
|
17
|
+
class String_Factory
|
18
|
+
class << self
|
19
|
+
|
20
|
+
def alpha(len = 9)
|
21
|
+
str = String.new
|
22
|
+
len.times do
|
23
|
+
str << (('A'..'Z').to_a).sample
|
24
|
+
end
|
25
|
+
str
|
26
|
+
end
|
27
|
+
|
28
|
+
def numeric(len = 9)
|
29
|
+
str = String.new
|
30
|
+
len.times do
|
31
|
+
str << (('0'..'9').to_a).sample
|
32
|
+
end
|
33
|
+
str
|
34
|
+
end
|
35
|
+
|
36
|
+
def alphanumeric(len = 9)
|
37
|
+
str = String.new
|
38
|
+
len.times do
|
39
|
+
str << (('A'..'Z').to_a + ('0'..'9').to_a).sample
|
40
|
+
end
|
41
|
+
str
|
42
|
+
end
|
43
|
+
|
44
|
+
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
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/ole-qa-framework.rb
CHANGED
@@ -26,11 +26,20 @@ module OLE_QA
|
|
26
26
|
@libdir = File.expand_path(File.dirname(__FILE__))
|
27
27
|
$LOAD_PATH.unshift(@libdir) unless $LOAD_PATH.include?(@libdir)
|
28
28
|
|
29
|
+
# Add data directory to $LOAD_PATH
|
30
|
+
@datadir = File.expand_path(File.dirname(__FILE__) + "/../data/")
|
31
|
+
$LOAD_PATH.unshift(@datadir) unless $LOAD_PATH.include?(@datadir)
|
32
|
+
|
29
33
|
# Return absolute path from which the file was run
|
30
34
|
def self.load_dir
|
31
35
|
@libdir
|
32
36
|
end
|
33
37
|
|
38
|
+
# Return absolute path for data directory
|
39
|
+
def self.data_dir
|
40
|
+
@datadir
|
41
|
+
end
|
42
|
+
|
34
43
|
# Load libraries from absolute path
|
35
44
|
def self.load_libs(filedir, filename = "*.rb")
|
36
45
|
Dir[@libdir + filedir + filename].sort.each do |file|
|
@@ -44,6 +53,9 @@ module OLE_QA
|
|
44
53
|
# Load all independent modules
|
45
54
|
load_libs("/module/")
|
46
55
|
|
56
|
+
# Load data factories
|
57
|
+
load_libs("/data_factory/")
|
58
|
+
|
47
59
|
# Load Page & Element Definitions.
|
48
60
|
# Main directory is loaded first, then subdirectories in alphabetical order.
|
49
61
|
# If pages or elements need to be inherited by subclasses, put them in a (foo)/common/ directory.
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Copyright 2005-2013 The Kuali Foundation
|
2
|
+
#
|
3
|
+
# Licensed under the Educational Community License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at:
|
6
|
+
#
|
7
|
+
# http://www.opensource.org/licenses/ecl2.php
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'rspec'
|
16
|
+
require 'spec_helper'
|
17
|
+
|
18
|
+
describe 'The Account Factory' do
|
19
|
+
|
20
|
+
it 'should have an account matrix' do
|
21
|
+
OLE_QA::Framework::Account_Factory.account_matrix.should be_a(Hash)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should have an object matrix' do
|
25
|
+
OLE_QA::Framework::Account_Factory.object_matrix.should be_a(Hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should select an account' do
|
29
|
+
acct = OLE_QA::Framework::Account_Factory.select_account
|
30
|
+
acct.should be_an(Array)
|
31
|
+
acct.count.should eq(2)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should select an object code' do
|
35
|
+
obj = OLE_QA::Framework::Account_Factory.select_object
|
36
|
+
obj.should be_an(Array)
|
37
|
+
obj.count.should eq(2)
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,31 @@
|
|
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 Bib Record Factory' do
|
19
|
+
|
20
|
+
it 'should create a barcode' do
|
21
|
+
barcode = OLE_QA::Framework::Bib_Factory.barcode
|
22
|
+
barcode.should be_a(String)
|
23
|
+
barcode.length.should_not > 18
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should create an LCC call number' do
|
27
|
+
cn = OLE_QA::Framework::Bib_Factory.call_number('LOC')
|
28
|
+
cn.should be_a(String)
|
29
|
+
cn.should =~ /[A-Z]{1,2}[0-9]{1,4}\ \.[A-Z][0-9]{1,3}/
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,43 @@
|
|
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 string factory' do
|
19
|
+
|
20
|
+
it 'should give an alphabetic string' do
|
21
|
+
str = OLE_QA::Framework::String_Factory.alpha(5)
|
22
|
+
str.length.should eq(5)
|
23
|
+
str.should =~ /[A-Z]{5}/
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should give a numeric string' do
|
27
|
+
str = OLE_QA::Framework::String_Factory.numeric(5)
|
28
|
+
str.length.should eq(5)
|
29
|
+
str.should =~ /[0-9]{5}/
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should should give an alphanumeric string' do
|
33
|
+
str = OLE_QA::Framework::String_Factory.alphanumeric(5)
|
34
|
+
str.length.should eq(5)
|
35
|
+
str.should =~ /[A-Z,0-9]{5}/
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should give a telephone number' do
|
39
|
+
str = OLE_QA::Framework::String_Factory.phone
|
40
|
+
str.length.should eq(12)
|
41
|
+
str.should =~ /555\-[0-9]{3}\-[0-9]{4}/
|
42
|
+
end
|
43
|
+
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ole-qa-framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
5
|
-
prerelease:
|
4
|
+
version: 3.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jain Waldrip
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: yard
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: watir-webdriver
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: headless
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ! '>='
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: rspec
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -121,10 +108,8 @@ files:
|
|
121
108
|
- LICENSE.md
|
122
109
|
- README.md
|
123
110
|
- Rakefile.rb
|
124
|
-
-
|
125
|
-
-
|
126
|
-
- examples/create_requisition.rb
|
127
|
-
- examples/purap_workflow_test.rb
|
111
|
+
- data/accounts.yml
|
112
|
+
- data/objects.yml
|
128
113
|
- lib/common/common_object.rb
|
129
114
|
- lib/common/data_object.rb
|
130
115
|
- lib/common/line_object.rb
|
@@ -133,6 +118,9 @@ files:
|
|
133
118
|
- lib/config/alt/dev_env.yml
|
134
119
|
- lib/config/alt/test_env.yml
|
135
120
|
- lib/config/default_options.yml
|
121
|
+
- lib/data_factory/account_factory.rb
|
122
|
+
- lib/data_factory/bib_factory.rb
|
123
|
+
- lib/data_factory/string_factory.rb
|
136
124
|
- lib/docstore/docstore.rb
|
137
125
|
- lib/module/qa_data_helpers.rb
|
138
126
|
- lib/module/qa_helpers.rb
|
@@ -209,33 +197,35 @@ files:
|
|
209
197
|
- spec/common/line_object_spec.rb
|
210
198
|
- spec/common/page_spec.rb
|
211
199
|
- spec/common/subline_object_spec.rb
|
200
|
+
- spec/data_factory/account_factory_spec.rb
|
201
|
+
- spec/data_factory/bib_factory_spec.rb
|
202
|
+
- spec/data_factory/string_factory_spec.rb
|
212
203
|
- spec/modules/qa_helpers_spec.rb
|
213
204
|
- spec/modules/qa_page_helpers_spec.rb
|
214
205
|
- spec/spec_helper.rb
|
215
206
|
homepage: http://www.github.com/jkwaldrip/ole-qa-framework/
|
216
207
|
licenses:
|
217
208
|
- ECLv2
|
209
|
+
metadata: {}
|
218
210
|
post_install_message:
|
219
211
|
rdoc_options: []
|
220
212
|
require_paths:
|
221
213
|
- lib
|
222
214
|
required_ruby_version: !ruby/object:Gem::Requirement
|
223
|
-
none: false
|
224
215
|
requirements:
|
225
216
|
- - ~>
|
226
217
|
- !ruby/object:Gem::Version
|
227
218
|
version: 1.9.3
|
228
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
229
|
-
none: false
|
230
220
|
requirements:
|
231
221
|
- - ! '>='
|
232
222
|
- !ruby/object:Gem::Version
|
233
223
|
version: '0'
|
234
224
|
requirements: []
|
235
225
|
rubyforge_project:
|
236
|
-
rubygems_version: 1.
|
226
|
+
rubygems_version: 2.1.11
|
237
227
|
signing_key:
|
238
|
-
specification_version:
|
228
|
+
specification_version: 4
|
239
229
|
summary: Kuali Open Library Environment
|
240
230
|
test_files:
|
241
231
|
- spec/common/browser_spec.rb
|
@@ -243,6 +233,9 @@ test_files:
|
|
243
233
|
- spec/common/line_object_spec.rb
|
244
234
|
- spec/common/page_spec.rb
|
245
235
|
- spec/common/subline_object_spec.rb
|
236
|
+
- spec/data_factory/account_factory_spec.rb
|
237
|
+
- spec/data_factory/bib_factory_spec.rb
|
238
|
+
- spec/data_factory/string_factory_spec.rb
|
246
239
|
- spec/modules/qa_helpers_spec.rb
|
247
240
|
- spec/modules/qa_page_helpers_spec.rb
|
248
241
|
- spec/spec_helper.rb
|
data/examples/README.md
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# OLE QA Testing Framework
|
2
|
-
## Examples
|
3
|
-
- - -
|
4
|
-
|
5
|
-
### Create Bib Record
|
6
|
-
create_bib_record.rb
|
7
|
-
|
8
|
-
This example file shows the simplest way to create a minimal
|
9
|
-
MARC bibliographic record in the OLE Library System using this
|
10
|
-
Test Framework. It creates the record directly in the editor,
|
11
|
-
saves the record, then closes out the session. It does not
|
12
|
-
contain any asserts or rescues, so Selenium Errors and OLE
|
13
|
-
Errors are not handled.
|
14
|
-
|
15
|
-
For the sake of simplicity, random text is used to fulfill the
|
16
|
-
minimum criteria of a leader string and a control field string.
|
17
|
-
|
18
|
-
* Bib Record
|
19
|
-
* Leader - 'HelloWorld'
|
20
|
-
* Control Line - '008','HelloWorld'
|
21
|
-
* Title - '245','','','$aStardust'
|
22
|
-
* Author - '100','1','','$aNeil Gaiman'
|
23
|
-
|
24
|
-
### Create Requisition
|
25
|
-
create_requisition.rb
|
26
|
-
|
27
|
-
This example file shows the simplest straight-through path
|
28
|
-
to create a requisition with the minimum requirements for approval:
|
29
|
-
a vendor, a delivery address, a requestor phone number, and a line
|
30
|
-
item consisting of a bibliographic record with a title, a list price,
|
31
|
-
and an accounting string for the purchase to be applied to.
|
32
|
-
|
33
|
-
This script contains only one error-checking line: at the end of the
|
34
|
-
script, there will be an if-elsif-else clause wherein the script first
|
35
|
-
checks for a success message upon submission of the requisition, and
|
36
|
-
prints it if found, and if not, checks for an error message, and prints
|
37
|
-
it if found. If the script finds no success message and no error message,
|
38
|
-
it prints whatever message it finds in the appropriate div, with the
|
39
|
-
element name requisition.generic_message.
|
40
|
-
|
41
|
-
* Bib Record
|
42
|
-
* Leader - 'HelloWorld'
|
43
|
-
* Control Line - '008','HelloWorld'
|
44
|
-
* Title - '245','Where is Joe Merchant?'
|
45
|
-
* Line Item
|
46
|
-
* List Price - '23.00'
|
47
|
-
* Accounting Chart Code - 'BL' (Bloomington)
|
48
|
-
* Account Number - '2947494' (Linguistics)
|
49
|
-
* Object Code - '7112' (Monographs)
|
50
|
-
* Percentage - '100.00'
|
51
|
-
* Vendor
|
52
|
-
* YBP Library Services
|
53
|
-
* Delivery
|
54
|
-
* Building - 'Wells Library'
|
55
|
-
* Room Number - '100'
|
56
|
-
* Requestor Info
|
57
|
-
* Phone Number - '812-555-5555' (Bloomington, Non-Usable Number)
|
@@ -1,64 +0,0 @@
|
|
1
|
-
# Copyright 2005-2013 The Kuali Foundation
|
2
|
-
#
|
3
|
-
# Licensed under the Educational Community License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at:
|
6
|
-
#
|
7
|
-
# http://www.opensource.org/licenses/ecl2.php
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
require 'ole-qa-framework'
|
16
|
-
|
17
|
-
# Start a new instance of the OLE Testing Framework.
|
18
|
-
# Do not run the browser in headless mode.
|
19
|
-
ole = OLE_QA::Framework::Session.new(:headless? => false)
|
20
|
-
|
21
|
-
# Create an instance of the OLELS Bib Editor Page.
|
22
|
-
bib_editor = OLE_QA::Framework::OLELS::Bib_Editor.new(ole)
|
23
|
-
|
24
|
-
# Open the page directly via URL.
|
25
|
-
# Automatically select the iframe with ID "iframeporlet"
|
26
|
-
# (the screen context in which most OLE functions are found).
|
27
|
-
bib_editor.open
|
28
|
-
|
29
|
-
# Enter a control line with tag "008" and a value of "HelloWorld"
|
30
|
-
bib_editor.control_008_link.click
|
31
|
-
bib_editor.control_008_field.wait_until_present
|
32
|
-
bib_editor.control_008_field.set("HelloWorld")
|
33
|
-
|
34
|
-
# Enter a Marc field & subfield line of
|
35
|
-
# "245 # # $aStardust"
|
36
|
-
bib_editor.data_line_1.tag_field.set("245")
|
37
|
-
bib_editor.data_line_1.data_field.set("|aStardust")
|
38
|
-
|
39
|
-
# Add another data line.
|
40
|
-
bib_editor.data_line_1.add_button.click
|
41
|
-
bib_editor.add_data_line(2)
|
42
|
-
|
43
|
-
# Enter a Marc field & subfield line
|
44
|
-
# "100 1 # $aNeil Gaiman"
|
45
|
-
bib_editor.data_line_2.tag_field.wait_until_present
|
46
|
-
bib_editor.data_line_2.tag_field.set("100")
|
47
|
-
bib_editor.data_line_2.ind1_field.set("1")
|
48
|
-
bib_editor.data_line_2.data_field.set("|aNeil Gaiman")
|
49
|
-
|
50
|
-
# Set the header fields before saving
|
51
|
-
bib_editor.set_button.click
|
52
|
-
|
53
|
-
# Save the record.
|
54
|
-
bib_editor.submit_button.click
|
55
|
-
|
56
|
-
# Print whatever message appears to the command line.
|
57
|
-
bib_editor.message.wait_until_present
|
58
|
-
puts bib_editor.message.text
|
59
|
-
|
60
|
-
# Return to the OLE Library System Main Menu via URL.
|
61
|
-
ole.browser.goto(ole.ls_url)
|
62
|
-
|
63
|
-
# Shut down the OLE Testing Framework.
|
64
|
-
ole.quit
|
@@ -1,96 +0,0 @@
|
|
1
|
-
# Copyright 2005-2013 The Kuali Foundation
|
2
|
-
#
|
3
|
-
# Licensed under the Educational Community License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at:
|
6
|
-
#
|
7
|
-
# http://www.opensource.org/licenses/ecl2.php
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
require 'ole-qa-framework'
|
16
|
-
|
17
|
-
# Start a new instance of the OLE Testing Framework.
|
18
|
-
# Do not run the browser in headless mode.
|
19
|
-
ole = OLE_QA::Framework::Session.new(:headless? => false)
|
20
|
-
|
21
|
-
# Create an instance of the OLEFS Requisition Page.
|
22
|
-
requisition = OLE_QA::Framework::OLEFS::Requisition.new(ole)
|
23
|
-
|
24
|
-
# Open the page directly via URL.
|
25
|
-
requisition.open
|
26
|
-
|
27
|
-
# Select a Delivery Location of Wells Library, Room 100
|
28
|
-
requisition.delivery_tab_toggle.click
|
29
|
-
requisition.building_search_icon.click
|
30
|
-
building_lookup = OLE_QA::Framework::OLEFS::Building_Lookup.new(ole)
|
31
|
-
building_lookup.building_name_field.set("Wells Library")
|
32
|
-
building_lookup.search_button.click
|
33
|
-
building_lookup.element(:return_building_link) {building_lookup.browser.a(:xpath => "//td[contains(text(),'Wells Library')]/preceding-sibling::td[3]/a")}
|
34
|
-
building_lookup.return_building_link.click
|
35
|
-
requisition.room_field.set("100")
|
36
|
-
|
37
|
-
# Select a Vendor
|
38
|
-
requisition.vendor_tab_toggle.click
|
39
|
-
requisition.vendor_search_icon.wait_until_present
|
40
|
-
requisition.vendor_search_icon.click
|
41
|
-
vendor_lookup = OLE_QA::Framework::OLEFS::Vendor_Lookup.new(ole)
|
42
|
-
vendor_lookup.vendor_name_field.set("YBP")
|
43
|
-
vendor_lookup.search_button.click
|
44
|
-
vendor_lookup.element(:return_vendor_link) {vendor_lookup.browser.a(:xpath => "//td[a[contains(text(),'YBP Library Services')]]/preceding-sibling::td[1]/a")}
|
45
|
-
vendor_lookup.return_vendor_link.click
|
46
|
-
|
47
|
-
# Enter a Bibliographic Record on the first Line Item
|
48
|
-
# - Use the minimum requisition requirement of a Title.
|
49
|
-
# - Use the Bib Editor minimum requirement of an 008 field and a leader field.
|
50
|
-
# - Print the success or failure message from the Bib Editor to the command line.
|
51
|
-
requisition.new_line_item.new_bib_button.click
|
52
|
-
ole.browser.windows[-1].use
|
53
|
-
bib_editor = OLE_QA::Framework::OLELS::Bib_Editor.new(ole)
|
54
|
-
bib_editor.wait_for_page_to_load
|
55
|
-
bib_editor.control_008_link.click
|
56
|
-
bib_editor.control_008_field.wait_until_present
|
57
|
-
bib_editor.control_008_field.set("HelloWorld")
|
58
|
-
bib_editor.data_line_1.tag_field.set("245")
|
59
|
-
bib_editor.data_line_1.data_field.set("|aWhere is Joe Merchant?")
|
60
|
-
bib_editor.set_button.click
|
61
|
-
bib_editor.submit_button.click
|
62
|
-
bib_editor.message.wait_until_present
|
63
|
-
puts bib_editor.message.text
|
64
|
-
bib_editor.close_button.click
|
65
|
-
ole.browser.windows[0].use
|
66
|
-
|
67
|
-
# Enter a list price for the Line Item
|
68
|
-
requisition.new_line_item.list_price_field.set("23.00")
|
69
|
-
|
70
|
-
# Add the Line Item
|
71
|
-
requisition.new_line_item.add_button.click
|
72
|
-
requisition.create_line_item(1)
|
73
|
-
|
74
|
-
# Apply the 100% of the Line Item's cost to Acct 2947494, Obj Code 7112
|
75
|
-
requisition.line_item_1.accounting_lines_toggle.click
|
76
|
-
requisition.line_item_1.new_accounting_line.chart_selector.select("BL")
|
77
|
-
requisition.line_item_1.new_accounting_line.account_number_field.set("2947494")
|
78
|
-
requisition.line_item_1.new_accounting_line.object_field.set("7112")
|
79
|
-
requisition.line_item_1.new_accounting_line.percent_field.set("100.00")
|
80
|
-
requisition.line_item_1.new_accounting_line.add_button.click
|
81
|
-
|
82
|
-
# Enter a Requestor Phone Number in Additional Institutional Info
|
83
|
-
requisition.additional_info_tab_toggle.click
|
84
|
-
requisition.additional_info_phone_number_field.wait_until_present
|
85
|
-
requisition.additional_info_phone_number_field.set("812-555-5555")
|
86
|
-
|
87
|
-
# Save the Requisition
|
88
|
-
requisition.save_button.click
|
89
|
-
|
90
|
-
# Submit the Requisition and print any resulting message to the command line.
|
91
|
-
requisition.submit_button.click
|
92
|
-
requisition.generic_message.wait_until_present
|
93
|
-
puts requisition.generic_message.text
|
94
|
-
|
95
|
-
# Exit
|
96
|
-
ole.quit
|
@@ -1,185 +0,0 @@
|
|
1
|
-
# Copyright 2005-2013 The Kuali Foundation
|
2
|
-
#
|
3
|
-
# Licensed under the Educational Community License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at:
|
6
|
-
#
|
7
|
-
# http://www.opensource.org/licenses/ecl2.php
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
require "ole-qa-framework"
|
16
|
-
|
17
|
-
# Start a new instance of the OLE Testing Framework.
|
18
|
-
# Do not run the browser in headless mode.
|
19
|
-
ole = OLE_QA::Framework::Session.new(:headless? => false)
|
20
|
-
|
21
|
-
# Capture the start time in MM/DD/YYYY format.
|
22
|
-
time = Time.now.strftime("%m/%d/%y")
|
23
|
-
|
24
|
-
# Open a new requisition.
|
25
|
-
requisition = OLE_QA::Framework::OLEFS::Requisition.new(ole)
|
26
|
-
requisition.open
|
27
|
-
|
28
|
-
# Set the description field to "PURAP Workflow Test - MM/DD/YYYY".
|
29
|
-
requisition.description_field.set("PURAP Workflow Test - #{time}")
|
30
|
-
|
31
|
-
# Set the delivery address to Wells Library, Room 100.
|
32
|
-
requisition.delivery_tab_toggle.click
|
33
|
-
requisition.building_search_icon.click
|
34
|
-
building_lookup = OLE_QA::Framework::OLEFS::Building_Lookup.new(ole)
|
35
|
-
building_lookup.wait_for_page_to_load
|
36
|
-
building_lookup.building_name_field.set("Wells Library")
|
37
|
-
building_lookup.search_button.click
|
38
|
-
building_lookup.browser.a(:xpath => "//td[contains(text(),'Wells Library')]/preceding-sibling::td[3]/a").click
|
39
|
-
requisition.wait_for_page_to_load
|
40
|
-
requisition.room_field.set("100")
|
41
|
-
requisition.delivery_tab_toggle.click
|
42
|
-
|
43
|
-
# Select "YBP Library Services" as the vendor.
|
44
|
-
requisition.vendor_tab_toggle.click
|
45
|
-
requisition.vendor_search_icon.click
|
46
|
-
vendor_lookup = OLE_QA::Framework::OLEFS::Vendor_Lookup.new(ole)
|
47
|
-
vendor_lookup.wait_for_page_to_load
|
48
|
-
vendor_lookup.vendor_name_field.set("YBP")
|
49
|
-
vendor_lookup.search_button.click
|
50
|
-
vendor_lookup.browser.a(:xpath => "//td[a[contains(text(),'YBP Library Services')]]/preceding-sibling::td[1]/a").click
|
51
|
-
requisition.wait_for_page_to_load
|
52
|
-
requisition.vendor_tab_toggle.click
|
53
|
-
|
54
|
-
# Add a Bib Record to the new line item with a title only.
|
55
|
-
requisition.new_line_item.new_bib_button.click
|
56
|
-
ole.browser.windows[-1].use
|
57
|
-
bib_editor = OLE_QA::Framework::OLELS::Bib_Editor.new(ole)
|
58
|
-
bib_editor.wait_for_page_to_load
|
59
|
-
bib_editor.control_008_link.click
|
60
|
-
bib_editor.control_008_field.wait_until_present
|
61
|
-
bib_editor.control_008_field.set("HELLOWORLD")
|
62
|
-
bib_editor.data_line_1.tag_field.set("245")
|
63
|
-
bib_editor.data_line_1.data_field.set("|aTitle of Book")
|
64
|
-
bib_editor.set_button.click
|
65
|
-
bib_editor.submit_button.click
|
66
|
-
bib_editor.close_button.click
|
67
|
-
ole.browser.windows[0].use
|
68
|
-
|
69
|
-
# Set the list price to $235.00 and add the line item.
|
70
|
-
requisition.new_line_item.list_price_field.set("235.00")
|
71
|
-
requisition.new_line_item.add_button.click
|
72
|
-
requisition.add_line_item(1)
|
73
|
-
requisition.wait_for_page_to_load
|
74
|
-
|
75
|
-
# Open the line item's accounting lines subtab and add an accounting string.
|
76
|
-
# Chart - Bloomington
|
77
|
-
# Account - 2947494
|
78
|
-
# Object - 7112
|
79
|
-
# Percentage - 100
|
80
|
-
requisition.line_item_1.accounting_lines_toggle.click
|
81
|
-
requisition.line_item_1.new_accounting_line.chart_selector.wait_until_present
|
82
|
-
requisition.line_item_1.new_accounting_line.chart_selector.select("BL")
|
83
|
-
requisition.line_item_1.new_accounting_line.account_number_field.set("2947494")
|
84
|
-
requisition.line_item_1.new_accounting_line.object_field.set("7112")
|
85
|
-
requisition.line_item_1.new_accounting_line.percent_field.set("100.00")
|
86
|
-
requisition.line_item_1.new_accounting_line.add_button.click
|
87
|
-
requisition.line_item_1.add_accounting_line(1)
|
88
|
-
requisition.line_item_1.accounting_line_1.chart_selector.wait_until_present
|
89
|
-
|
90
|
-
# Open the Additional Information tab and add a phone number.
|
91
|
-
requisition.additional_info_tab_toggle.click
|
92
|
-
requisition.additional_info_phone_number_field.set("812-555-5555")
|
93
|
-
|
94
|
-
# Submit the requisition and wait for a message to appear.
|
95
|
-
# Display that message on the command line.
|
96
|
-
requisition.submit_button.click
|
97
|
-
requisition.wait_for_page_to_load
|
98
|
-
requisition.generic_message.wait_until_present
|
99
|
-
puts "Requisition:".ljust(20) + "#{requisition.generic_message.text.strip}"
|
100
|
-
|
101
|
-
# Reload the requisition.
|
102
|
-
requisition.reload_button.click
|
103
|
-
requisition.wait_for_page_to_load
|
104
|
-
|
105
|
-
# Open the View Related tab and check for a purchase order link.
|
106
|
-
requisition.view_related_tab_toggle.click
|
107
|
-
requisition.view_related_po_link.wait_until_present
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
# Get the requisition's Document ID. This will be needed to re-open the requisition later.
|
112
|
-
requisition_id = requisition.document_id.text.strip
|
113
|
-
|
114
|
-
# Get the text of the purchase order link in the View Related tab.
|
115
|
-
po_link_text = requisition.view_related_po_link.text.strip
|
116
|
-
|
117
|
-
# Use a basic spin assert to check whether the requisition has created an approved purchase order yet.
|
118
|
-
# Set the timeout to 30 seconds from now.
|
119
|
-
end_time = Time.now + 30
|
120
|
-
# Wait for a signal since until isn't wrapped in a method.
|
121
|
-
catch :done do
|
122
|
-
# Repeat this loop until either the timeout expires or the loop is broken.
|
123
|
-
until Time.now > end_time
|
124
|
-
# Repeat this loop this on a one second interval.
|
125
|
-
sleep 1
|
126
|
-
# Reopen the requisition.
|
127
|
-
ole.browser.goto("http://tst.ole.kuali.org/kew/DocHandler.do?command=displayDocSearchView&docId=#{requisition_id}")
|
128
|
-
requisition.wait_for_page_to_load
|
129
|
-
# Check the Purchase Order link text in the View Related tab.
|
130
|
-
requisition.view_related_tab_toggle.click
|
131
|
-
requisition.view_related_po_link.wait_until_present
|
132
|
-
po_link_text = requisition.view_related_po_link.text.strip
|
133
|
-
# Break out of this loop if the Purchase Order link has a non-asterisk text value.
|
134
|
-
throw :done unless po_link_text == '********'
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
# Open the purchase order.
|
139
|
-
ole.browser.goto(requisition.view_related_po_link.href)
|
140
|
-
purchase_order = OLE_QA::Framework::OLEFS::Purchase_Order.new(ole)
|
141
|
-
purchase_order.wait_for_page_to_load
|
142
|
-
|
143
|
-
# Get the purchase order number and the purchase order's total.
|
144
|
-
# These will be used to create the payment request.
|
145
|
-
po_number = purchase_order.document_type_id.text.strip
|
146
|
-
po_total = purchase_order.grand_total_field.text.strip
|
147
|
-
|
148
|
-
# Receive the purchase order.
|
149
|
-
purchase_order.receiving_button.click
|
150
|
-
receiving_doc = OLE_QA::Framework::OLEFS::Receiving_Document.new(ole)
|
151
|
-
receiving_doc.wait_for_page_to_load
|
152
|
-
receiving_doc.create_receiving_line(1)
|
153
|
-
receiving_doc.submit_button.click
|
154
|
-
receiving_doc.wait_for_page_to_load
|
155
|
-
# Wait for a message to appear after submitting the receiving document.
|
156
|
-
# Print that message to the command line.
|
157
|
-
receiving_doc.generic_message.wait_until_present
|
158
|
-
puts "Receiving:".ljust(20) + "#{receiving_doc.generic_message.text.strip}"
|
159
|
-
|
160
|
-
# Get a random string of 12 alphanumeric characters to use as the invoice number.
|
161
|
-
invoice_number = Array.new(12){rand(36).to_s(36)}.join
|
162
|
-
|
163
|
-
# Open the payment request creation screen, fill in invoice information,
|
164
|
-
# and create the payment request.
|
165
|
-
payment_request_create_screen = OLE_QA::Framework::OLEFS::PREQ_Creation.new(ole)
|
166
|
-
payment_request_create_screen.open
|
167
|
-
payment_request_create_screen.purchase_order_number_field.set(po_number)
|
168
|
-
payment_request_create_screen.invoice_date_field.set(time)
|
169
|
-
payment_request_create_screen.invoice_number_field.set(invoice_number)
|
170
|
-
payment_request_create_screen.invoice_amount_field.set(po_total)
|
171
|
-
payment_request_create_screen.continue_button.click
|
172
|
-
|
173
|
-
# Calculate and approve the payment request once it opens.
|
174
|
-
payment_request = OLE_QA::Framework::OLEFS::Payment_Request.new(ole)
|
175
|
-
payment_request.wait_for_page_to_load
|
176
|
-
payment_request.payment_method_selector.select("Check")
|
177
|
-
payment_request.calculate_button.click
|
178
|
-
payment_request.wait_for_page_to_load
|
179
|
-
payment_request.approve_button.click
|
180
|
-
|
181
|
-
# Print a final status message to the command line.
|
182
|
-
puts "Payment Request:".ljust(20) + 'Approved.' unless payment_request.generic_message.present?
|
183
|
-
|
184
|
-
# Exit the OLE QA Testing Framework session.
|
185
|
-
ole.quit
|