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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23d11285c80d720bb05b56fa3d940ab136bbecc4
4
- data.tar.gz: 758fc1a80365b7bc423e96d3823dd79e65a41349
3
+ metadata.gz: 752b63982f388f20ac2105abacbb2c9e271784af
4
+ data.tar.gz: 30d62cccc24584b2c24d545f5044b5d9b0e5dd4d
5
5
  SHA512:
6
- metadata.gz: 311c52a54f8b089a36bf6c8ff6246f1f02500a51441ae5330a3cc2111558409248319f8426191bcb9178293af8e5cc7e2bd766be6e35c149eda78de220cd83af
7
- data.tar.gz: 9e37e4d386f1576227f067ce21fcc04a9cb7ec459027dcd1e4d90d8b3a3bd3331b01e2fb070bd9236bc33b18ab3dba9a4c93b09a9ac0e72d84f82181bc857175
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
- # 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
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
- # 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
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
@@ -42,6 +42,11 @@ module OLE_QA::Framework
42
42
  str_out << num_str(4)
43
43
  str_out
44
44
  end
45
+
46
+ def price
47
+ str = String.new
48
+ str << num_str(sampler(1..3)) << '.' << '00'
49
+ end
45
50
  end
46
51
  end
47
52
  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(max_len = 8)
18
+ def name_builder(len = 8)
19
19
  out = Array.new
20
20
  out << sampler
21
- max_len -= 1
22
- max_len.times do
21
+ len -= 1
22
+ len.times do
23
23
  out << sampler('a'..'z')
24
24
  end
25
25
  out.join
@@ -15,6 +15,6 @@
15
15
  module OLE_QA
16
16
  module Framework
17
17
  # The version number for this project.
18
- VERSION = '3.7.4'
18
+ VERSION = '3.8.0'
19
19
  end
20
20
  end
@@ -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&__login_user=admin&user=ole-khuntley'
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
@@ -40,4 +40,9 @@ describe 'The string factory' do
40
40
  str.length.should eq(12)
41
41
  str.should =~ /555\-[0-9]{3}\-[0-9]{4}/
42
42
  end
43
+
44
+ it 'should give a price' do
45
+ price = OLE_QA::Framework::String_Factory.price
46
+ price.should =~ /\d{1,3}\.0{2}/
47
+ end
43
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.7.4
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-03 00:00:00.000000000 Z
11
+ date: 2014-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler