ole-qa-framework 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWJhMDhkZTQwNGM5ZTQxMDY2MTM4MWQ0MDQzYTNjYzE3ZTM3YjgyZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGVjZmE4MjUzNjVmZDk5MmMyOTI0M2RiZTM2ZDViZWFhNjhlN2NkMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDE1ODg5M2VmZTE2ZjZkYmZhYzEyMWVmMzZmZmUwZDcwNTA4ZDM1NDAzNGY5
|
10
|
+
MDg2MWZlNzBhZTY2N2QwYzgxYzU1YTc2NmI2ODQ0ZWI1YjU5ZWQzOGU2ODM2
|
11
|
+
NzAyODRmMGU3ZDIxMjg2NWI2MzRiZWU0MjRkZTY4YzFiZDJhYzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjdjYmY0ZTRkZjlkZWYyZmI4ZjNmZjU1MTE1NGMxNWI0OWFhYjBjYTA0MmYy
|
14
|
+
ODk4YjQzNjVlNjg2Yjg0NjJmODhjMjI1MTE0ZjMwNWYxZDNkMWZkMzY4NGIw
|
15
|
+
NzQzYmYwYmEwNDllZmY0MzFhYmVmMzc2YTYzZTNmMWY1NDhjMmY=
|
data/CHANGELOG.md
CHANGED
@@ -27,7 +27,20 @@ module OLE_QA::Framework
|
|
27
27
|
str_out.upcase
|
28
28
|
end
|
29
29
|
alias_method(:new_location_code,:location_code)
|
30
|
-
|
30
|
+
|
31
|
+
# Create a new location as a hash.
|
32
|
+
# @param [String] level Set the location's level. (Optional, defaults to 1.)
|
33
|
+
# @param [String] parent The parent location code. (Optional, defaults to none.)
|
34
|
+
def new_location(level = 1, parent = '')
|
35
|
+
hash = Hash.new
|
36
|
+
hash[:code] = location_code
|
37
|
+
hash[:name] = name_builder(sampler(6..8))
|
38
|
+
hash[:description] = name_builder(sampler(8..12))
|
39
|
+
hash[:level] = level.to_s
|
40
|
+
hash[:parent] = parent unless parent.empty?
|
41
|
+
hash
|
42
|
+
end
|
43
|
+
|
31
44
|
end
|
32
45
|
end
|
33
46
|
end
|
@@ -42,6 +42,9 @@ module OLE_QA::Framework::OLELS
|
|
42
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
43
|
# Return the 'copy' link for a search results line containing the given text.
|
44
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
|
+
# Return the 'return results' link for a search results line containing the given text.
|
46
|
+
# @note Used when the lookup screen is opened from another page, like the create/edit location page.
|
47
|
+
function(:return_by_text) {|which| b.a(:xpath => "//td[div/span[contains(text(),'#{which}')]]/preceding-sibling::td/div/fieldset/div/div/a[contains(text(),'return results')]")}
|
45
48
|
end
|
46
49
|
|
47
50
|
def wait_for_elements
|
@@ -11,4 +11,20 @@ describe 'The Metadata Factory' do
|
|
11
11
|
location.should =~ /\d/
|
12
12
|
end
|
13
13
|
|
14
|
+
it 'should create a randomized location' do
|
15
|
+
location = OLE_QA::Framework::Metadata_Factory.new_location
|
16
|
+
location.should be_a(Hash)
|
17
|
+
location[:code].should be_a(String)
|
18
|
+
location[:name].should be_a(String)
|
19
|
+
location[:description].should be_a(String)
|
20
|
+
location[:level].should eq('1')
|
21
|
+
location[:parent].should be_nil
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should create a location with a level of 2 and a random parent' do
|
25
|
+
location = OLE_QA::Framework::Metadata_Factory.new_location(2, OLE_QA::Framework::String_Factory.alpha(3))
|
26
|
+
location[:level].should eq('2')
|
27
|
+
location[:parent].should =~ /[A-Z]{3}/
|
28
|
+
end
|
29
|
+
|
14
30
|
end
|