testcentricity_web 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/testcentricity_web.rb +18 -8
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/world_extensions.rb +4 -12
- 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: 828ba7ccba0258caff9d05dbc66af20c6c87a915
|
4
|
+
data.tar.gz: 2a021784f3c899fdd34cebfcd490c6e44b911cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed47cdbaa73967009d8caf713d698ed17c541f569a4385416ba78d1a3a39992a1b1701b1ff814c0d2fe57a303390f207dd4b9acb8b46fdb6aa51a52070df33b
|
7
|
+
data.tar.gz: 3e30928f42b8a80a325f52b46e095cb34678183662f776cd8e27511227f80bb091f3e0da496c1e05e33fc8ee199c4b410a77740f98d39b0c4b936b92f2c705c7
|
data/lib/testcentricity_web.rb
CHANGED
@@ -36,15 +36,20 @@ module TestCentricity
|
|
36
36
|
|
37
37
|
@page_objects = {}
|
38
38
|
|
39
|
-
def self.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
@page_objects[
|
39
|
+
def self.register_page_objects(pages)
|
40
|
+
result = ''
|
41
|
+
pages.each do | page_object, page_class |
|
42
|
+
obj = page_class.new
|
43
|
+
@page_objects[page_object] = obj unless @page_objects.has_key?(page_object)
|
44
|
+
page_key = obj.page_name.gsub(/\s+/, "").downcase.to_sym
|
45
|
+
if page_key != page_object
|
46
|
+
@page_objects[page_key] = obj unless @page_objects.has_key?(page_key)
|
47
|
+
end
|
48
|
+
result = "#{result}def #{page_object.to_s};@#{page_object.to_s} ||= TestCentricity::PageManager.find_page(:#{page_object.to_s});end;"
|
44
49
|
end
|
50
|
+
result
|
45
51
|
end
|
46
52
|
|
47
|
-
|
48
53
|
# Have all PageObjects been registered?
|
49
54
|
#
|
50
55
|
# @return [Boolean] true if all PageObjects have been registered
|
@@ -85,8 +90,13 @@ module TestCentricity
|
|
85
90
|
class DataManager
|
86
91
|
@data_objects = {}
|
87
92
|
|
88
|
-
def self.
|
89
|
-
|
93
|
+
def self.register_data_objects(data)
|
94
|
+
result = ''
|
95
|
+
data.each do | data_type, data_class |
|
96
|
+
@data_objects[data_type] = data_class.new unless @data_objects.has_key?(data_type)
|
97
|
+
result = "#{result}def #{data_type.to_s};@#{data_type.to_s} ||= TestCentricity::DataManager.find_data_object(:#{data_type.to_s});end;"
|
98
|
+
end
|
99
|
+
result
|
90
100
|
end
|
91
101
|
|
92
102
|
def self.find_data_object(data_object)
|
@@ -8,12 +8,8 @@ module WorldData
|
|
8
8
|
# return if data objects have already been instantiated and registered
|
9
9
|
return if TestCentricity::DataManager.loaded?
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
TestCentricity::DataManager.register_data_object(data_type, data_class.new)
|
14
|
-
# instantiate the data object
|
15
|
-
eval("def #{data_type.to_s};@#{data_type.to_s} ||= TestCentricity::DataManager.find_data_object(:#{data_type.to_s});end")
|
16
|
-
end
|
11
|
+
# register and instantiate all data objects
|
12
|
+
eval(TestCentricity::DataManager.register_data_objects(data_objects))
|
17
13
|
end
|
18
14
|
end
|
19
15
|
|
@@ -24,11 +20,7 @@ module WorldPages
|
|
24
20
|
# return if page objects have already been instantiated and registered
|
25
21
|
return if TestCentricity::PageManager.loaded?
|
26
22
|
|
27
|
-
|
28
|
-
|
29
|
-
TestCentricity::PageManager.register_page_object(page_object, page_class.new)
|
30
|
-
# instantiate the page object
|
31
|
-
eval("def #{page_object.to_s};@#{page_object.to_s} ||= TestCentricity::PageManager.find_page(:#{page_object.to_s});end")
|
32
|
-
end
|
23
|
+
# register and instantiate all page objects
|
24
|
+
eval(TestCentricity::PageManager.register_page_objects(page_objects))
|
33
25
|
end
|
34
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testcentricity_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.J. Mrozinski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|