testcentricity_web 1.0.19 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web.rb +8 -4
- 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: 4138bec33af343b62212404678aa8a09dc2c149c
|
4
|
+
data.tar.gz: 39ee25edd0087cb3a8c94dfc90855d750ce01350
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6efa4aac3d78650aa5f41baf2c9e4cac538bf9b502264dac45710e55e641cf7f7b0d87282a6d5b6f96756547f1a94b433727df3416eeff9f60e78fa43aed374c
|
7
|
+
data.tar.gz: 28554a7d8148ecf2a84897c82589830f0028f805df7c3aa8cb81b4f0ca3a18c80d1a31d2f2950418d74cf6fc7bcdd1ee6f23408116bdd349c419cd1096ee55bd
|
data/README.md
CHANGED
@@ -120,6 +120,10 @@ The `page_name` trait is registered with the **PageManager** object, which inclu
|
|
120
120
|
parameter and returns an instance of the associated **Page Object**. If you intend to use the **PageManager**, you must define a `page_name`
|
121
121
|
trait for each of the **Page Objects** to be registered.
|
122
122
|
|
123
|
+
The `page_name` trait is usually a `String` value that represents the name of the page that will be matched by the `PageManager.findpage` method.
|
124
|
+
`page_name` traits are case and white-space sensitive. For pages that may be referenced with multiple names, the `page_name` trait may also be
|
125
|
+
an `Array` of `String` values representing those page names.
|
126
|
+
|
123
127
|
A `page_url` trait should be defined if a page can be directly loaded using a URL. If you set Capybara's `app_host`, or specify a base URL
|
124
128
|
when calling the `WebDriverConnect.initialize_web_driver` method, then your `page_url` trait can be the relative URL slug that will
|
125
129
|
be appended to the base URL specified in `app_host`. Specifying a `page_url` trait is optional, as not all web pages can be directly loaded
|
@@ -139,7 +143,7 @@ You define your page's **Traits** as shown below:
|
|
139
143
|
|
140
144
|
|
141
145
|
class HomePage < TestCentricity::PageObject
|
142
|
-
trait(:page_name) { 'Home' }
|
146
|
+
trait(:page_name) { ['Home', 'Dashboard'] }
|
143
147
|
trait(:page_url) { '/dashboard' }
|
144
148
|
trait(:page_locator) { 'body.dashboard' }
|
145
149
|
end
|
data/lib/testcentricity_web.rb
CHANGED
@@ -41,11 +41,15 @@ module TestCentricity
|
|
41
41
|
pages.each do |page_object, page_class|
|
42
42
|
obj = page_class.new
|
43
43
|
@page_objects[page_object] = obj unless @page_objects.has_key?(page_object)
|
44
|
-
|
45
|
-
if
|
46
|
-
|
44
|
+
page_names = obj.page_name
|
45
|
+
page_names = Array(page_names) if page_names.is_a? String
|
46
|
+
page_names.each do |name|
|
47
|
+
page_key = name.gsub(/\s+/, '').downcase.to_sym
|
48
|
+
if page_key != page_object
|
49
|
+
@page_objects[page_key] = obj unless @page_objects.has_key?(page_key)
|
50
|
+
end
|
51
|
+
result = "#{result}def #{page_object};@#{page_object} ||= TestCentricity::PageManager.find_page(:#{page_object});end;"
|
47
52
|
end
|
48
|
-
result = "#{result}def #{page_object};@#{page_object} ||= TestCentricity::PageManager.find_page(:#{page_object});end;"
|
49
53
|
end
|
50
54
|
result
|
51
55
|
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.20
|
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-12-
|
11
|
+
date: 2016-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|