ole-qa-framework 3.7.4 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/data_factory/bib_factory.rb +44 -14
- data/lib/data_factory/string_factory.rb +5 -0
- data/lib/module/factory_helpers.rb +3 -3
- data/lib/ole_qa_framework/VERSION.rb +1 -1
- data/lib/olels/pages/staff_upload.rb +2 -2
- data/spec/data_factory/bib_factory_spec.rb +17 -0
- data/spec/data_factory/string_factory_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 752b63982f388f20ac2105abacbb2c9e271784af
|
4
|
+
data.tar.gz: 30d62cccc24584b2c24d545f5044b5d9b0e5dd4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad9df596724f85e0887f759f0f79c72c6ab618d3f0c81254a2f0694bf38e1935bdb08f21f309b051be4e54d490de0423fbaacba11980d94196f7f93f9474c650
|
7
|
+
data.tar.gz: 211e9ab423acae88d274391a1b856f071e23806cb9209b57c14d1270850ce7f1a1b2809e6d9c139f6070bebc7f4405c3a73719a78e3edcdbdc864a581b8013b6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
### v3.8.0 - 2014/01/09
|
2
|
+
|
3
|
+
* Data Factories
|
4
|
+
* Bib Factory
|
5
|
+
* added title
|
6
|
+
* added author
|
7
|
+
* String Factory
|
8
|
+
* added price
|
9
|
+
|
10
|
+
### v3.7.5 - 2014/01/03
|
11
|
+
|
12
|
+
* OLELS - Fix error in Staff Upload URL
|
13
|
+
|
1
14
|
### v3.7.4 - 2014/01/03
|
2
15
|
|
3
16
|
* Remove pessimistic version constraint
|
@@ -15,21 +15,51 @@
|
|
15
15
|
module OLE_QA::Framework
|
16
16
|
# Manufacture strings for bibliographic record testing
|
17
17
|
class Bib_Factory
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
class << self
|
19
|
+
|
20
|
+
include OLE_QA::Framework::Factory_Helpers
|
21
|
+
|
22
|
+
# Return a random string of between 12 and 18 numbers to be used as a barcode.
|
23
|
+
def barcode
|
24
|
+
(0..(11..17).to_a.sample).map{(0..9).to_a.sample}.join
|
25
|
+
end
|
26
|
+
|
27
|
+
# Return a random (non-validated) call number in the specified format.
|
28
|
+
def call_number(format = "LOC")
|
29
|
+
call_num = Array.new
|
30
|
+
# TODO - Use case...when once other formats are added.
|
31
|
+
# LOC Format Call Number
|
32
|
+
call_num << (0..(0..1).to_a.sample).map{('A'..'Z').to_a.sample}.join
|
33
|
+
call_num << (0..(1..3).to_a.sample).map{(1..9).to_a.sample}.join << " "
|
34
|
+
call_num << "." << ('A'..'Z').to_a.sample
|
35
|
+
call_num << (0..(1..2).to_a.sample).map{(1..9).to_a.sample}.join
|
36
|
+
call_num.join
|
37
|
+
end
|
38
|
+
|
39
|
+
# Return a random title with the specified length.
|
40
|
+
def title(len = 8..12)
|
41
|
+
if len.class == Range
|
42
|
+
name_builder(sampler(len))
|
43
|
+
else
|
44
|
+
name_builder(len.to_i)
|
45
|
+
end
|
46
|
+
end
|
22
47
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
48
|
+
# Return a random author with specified first and last name lengths.
|
49
|
+
def author(first_len = 4..6, last_len = 8..12)
|
50
|
+
str = String.new
|
51
|
+
if first_len.class == Range
|
52
|
+
str << name_builder(sampler(first_len))
|
53
|
+
else
|
54
|
+
str << name_builder(first_len.to_i)
|
55
|
+
end
|
56
|
+
str << ' '
|
57
|
+
if last_len.class == Range
|
58
|
+
str << name_builder(sampler(last_len))
|
59
|
+
else
|
60
|
+
str << name_builder(last_len.to_i)
|
61
|
+
end
|
62
|
+
end
|
33
63
|
end
|
34
64
|
end
|
35
65
|
end
|
@@ -15,11 +15,11 @@
|
|
15
15
|
module OLE_QA::Framework
|
16
16
|
# This mix-in module contains helper methods for other data factory modules.
|
17
17
|
module Factory_Helpers
|
18
|
-
def name_builder(
|
18
|
+
def name_builder(len = 8)
|
19
19
|
out = Array.new
|
20
20
|
out << sampler
|
21
|
-
|
22
|
-
|
21
|
+
len -= 1
|
22
|
+
len.times do
|
23
23
|
out << sampler('a'..'z')
|
24
24
|
end
|
25
25
|
out.join
|
@@ -18,7 +18,7 @@ module OLE_QA::Framework::OLELS
|
|
18
18
|
|
19
19
|
def initialize(ole_session)
|
20
20
|
url = ole_session.url + 'portal.do?channelTitle=Staff%20Upload&channelUrl='
|
21
|
-
url += ole_session.url + 'ole-kr-krad/staffuploadcontroller?viewId=StaffUploadView&methodToCall=start
|
21
|
+
url += ole_session.url + 'ole-kr-krad/staffuploadcontroller?viewId=StaffUploadView&methodToCall=start'
|
22
22
|
super(ole_session, url)
|
23
23
|
end
|
24
24
|
|
@@ -50,4 +50,4 @@ module OLE_QA::Framework::OLELS
|
|
50
50
|
function(:upload) {upload_button.click ; wait_for_page_to_load ; message.when_present.text.strip }
|
51
51
|
end
|
52
52
|
end
|
53
|
-
end
|
53
|
+
end
|
@@ -28,4 +28,21 @@ describe 'The Bib Record Factory' do
|
|
28
28
|
cn.should be_a(String)
|
29
29
|
cn.should =~ /[A-Z]{1,2}[0-9]{1,4}\ \.[A-Z][0-9]{1,3}/
|
30
30
|
end
|
31
|
+
|
32
|
+
it 'should create a title' do
|
33
|
+
title = OLE_QA::Framework::Bib_Factory.title(8..12)
|
34
|
+
title.should be_a(String)
|
35
|
+
title.should =~ /[A-Z][a-z]{7,11}+/
|
36
|
+
specific_title = OLE_QA::Framework::Bib_Factory.title(6)
|
37
|
+
specific_title.should be_a(String)
|
38
|
+
specific_title.length.should eq(6)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should create an author' do
|
42
|
+
author = OLE_QA::Framework::Bib_Factory.author(4..6,8..12)
|
43
|
+
author.should be_a(String)
|
44
|
+
author.should =~ /[A-Z][a-z]{3,5} [A-Z][a-z]{7,11}/
|
45
|
+
specific_author = OLE_QA::Framework::Bib_Factory.author(4,8)
|
46
|
+
specific_author.should =~ /[A-Z][a-z]{3} [A-Z][a-z]{7}/
|
47
|
+
end
|
31
48
|
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.
|
4
|
+
version: 3.8.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: 2014-01-
|
11
|
+
date: 2014-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|