testcentricity_web 1.0.17 → 1.0.18
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/Gemfile +1 -1
- data/README.md +11 -3
- data/lib/devices/devices.yml +12 -0
- data/lib/testcentricity_web.rb +4 -2
- data/lib/testcentricity_web/browser_helper.rb +1 -1
- data/lib/testcentricity_web/data_objects_helper.rb +10 -4
- data/lib/testcentricity_web/elements/table.rb +4 -4
- data/lib/testcentricity_web/environment.rb +15 -1
- data/lib/testcentricity_web/page_objects_helper.rb +18 -18
- data/lib/testcentricity_web/page_sections_helper.rb +18 -18
- data/lib/testcentricity_web/ui_elements_helper.rb +1 -1
- data/lib/testcentricity_web/version.rb +1 -1
- 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: 806f211293d85f601510b0cdb3781b2ad45167b1
|
4
|
+
data.tar.gz: 90809103ca8c65940aa028eefd1f6f67a5034dc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea592c42f81f9afb9a3be6bf34b3ff0692d050f38e9d8208a377b5ca0055f9e88b9736c25e2ba917515231df39a1cef369049dcbe3049a69fca5c1dd6efd306c
|
7
|
+
data.tar.gz: 9ab809c4fe958a3355645056af4a9c5ecc291f874b2b2a211650c799cba9ed19462d6aa34d1f2f894e798ade872a09a0fb0be30dd0e256434a53d2e9bbeb843b
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -400,6 +400,10 @@ One common implementation is shown below:
|
|
400
400
|
def registration_page
|
401
401
|
@registration_page ||= RegistrationPage.new
|
402
402
|
end
|
403
|
+
|
404
|
+
def search_results_page
|
405
|
+
@search_results_page ||= SearchResultsPage.new
|
406
|
+
end
|
403
407
|
end
|
404
408
|
|
405
409
|
World(WorldPages)
|
@@ -474,7 +478,7 @@ Include the step definitions and code below in a `page_steps.rb` or `generic_ste
|
|
474
478
|
Given(/^I am on the ([^\"]*) page$/) do |page_name|
|
475
479
|
target_page = page_dispatcher(page_name)
|
476
480
|
target_page.load_page if target_page
|
477
|
-
PageManager.
|
481
|
+
PageManager.current_page = target_page
|
478
482
|
end
|
479
483
|
|
480
484
|
When(/^I click the ([^\"]*) navigation link$/) do |link_name|
|
@@ -485,14 +489,14 @@ Include the step definitions and code below in a `page_steps.rb` or `generic_ste
|
|
485
489
|
Then(/^I expect to see the ([^\"]*) page$/) do |page_name|
|
486
490
|
target_page = page_dispatcher(page_name)
|
487
491
|
target_page.verify_page_exists if target_page
|
488
|
-
PageManager.
|
492
|
+
PageManager.current_page = target_page
|
489
493
|
end
|
490
494
|
|
491
495
|
Then(/^I expect the ([^\"]*) page to be correctly displayed$/) do |page_name|
|
492
496
|
target_page = page_dispatcher(page_name)
|
493
497
|
target_page.verify_page_exists
|
494
498
|
target_page.verify_page_ui
|
495
|
-
PageManager.
|
499
|
+
PageManager.current_page = target_page
|
496
500
|
end
|
497
501
|
|
498
502
|
|
@@ -567,6 +571,8 @@ mobile web browsers, the `WEB_BROWSER` Environment Variable must be set to one o
|
|
567
571
|
`iphone7_plus` |`firefox` or `chrome` |414 x 736 |portrait |iOS 10
|
568
572
|
`android_phone` |`firefox` or `chrome` |320 x 480 |portrait |Android 4.0.1
|
569
573
|
`nexus6` |`firefox` or `chrome` |411 x 731 |portrait |Android 6.0.1
|
574
|
+
`pixel` |`firefox` or `chrome` |411 x 731 |portrait |Android 7.1
|
575
|
+
`pixel_xl` |`firefox` or `chrome` |411 x 731 |portrait |Android 7.1
|
570
576
|
`windows_phone7` |`firefox` or `chrome` |320 x 480 |portrait |Windows Phone OS 7.5
|
571
577
|
`windows_phone8` |`firefox` or `chrome` |320 x 480 |portrait |Windows Phone OS 8.0
|
572
578
|
`blackberry_z10` |`firefox` or `chrome` |384 x 640 |portrait |BlackBerry 10 OS
|
@@ -797,6 +803,8 @@ service(s) that you intend to connect with.
|
|
797
803
|
google_nexus7: WEB_BROWSER=google_nexus7 HOST_BROWSER=firefox <%= mobile %>
|
798
804
|
google_nexus9: WEB_BROWSER=google_nexus9 HOST_BROWSER=firefox <%= mobile %>
|
799
805
|
google_nexus10: WEB_BROWSER=google_nexus10 HOST_BROWSER=firefox <%= mobile %>
|
806
|
+
pixel: WEB_BROWSER=pixel HOST_BROWSER=firefox <%= mobile %>
|
807
|
+
pixel_xl: WEB_BROWSER=pixel_xl HOST_BROWSER=firefox <%= mobile %>
|
800
808
|
windows_phone7: WEB_BROWSER=windows_phone7 HOST_BROWSER=firefox <%= mobile %>
|
801
809
|
windows_phone8: WEB_BROWSER=windows_phone8 HOST_BROWSER=firefox <%= mobile %>
|
802
810
|
blackberry_z10: WEB_BROWSER=blackberry_z10 HOST_BROWSER=firefox <%= mobile %>
|
data/lib/devices/devices.yml
CHANGED
@@ -52,6 +52,18 @@ nexus6:
|
|
52
52
|
:css_height: 731
|
53
53
|
:default_orientation: portrait
|
54
54
|
:user_agent: "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36"
|
55
|
+
:pixel:
|
56
|
+
:name: "Google Pixel phone"
|
57
|
+
:css_width: 411
|
58
|
+
:css_height: 731
|
59
|
+
:default_orientation: portrait
|
60
|
+
:user_agent: "Mozilla/5.0 (Linux; Android 7.1; Pixel Build/NAE63H; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.134 Mobile Safari/537.36"
|
61
|
+
:pixel_xl:
|
62
|
+
:name: "Google Pixel XL phone"
|
63
|
+
:css_width: 411
|
64
|
+
:css_height: 731
|
65
|
+
:default_orientation: portrait
|
66
|
+
:user_agent: "Mozilla/5.0 (Linux; Android 7.1; Pixel XL Build/NDE63N; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/54.0.2840.34 Mobile Safari/537.36"
|
55
67
|
:windows_phone8:
|
56
68
|
:name: "Generic Windows 8 phone"
|
57
69
|
:css_width: 320
|
data/lib/testcentricity_web.rb
CHANGED
@@ -45,7 +45,7 @@ module TestCentricity
|
|
45
45
|
if page_key != page_object
|
46
46
|
@page_objects[page_key] = obj unless @page_objects.has_key?(page_key)
|
47
47
|
end
|
48
|
-
result = "#{result}def #{page_object
|
48
|
+
result = "#{result}def #{page_object};@#{page_object} ||= TestCentricity::PageManager.find_page(:#{page_object});end;"
|
49
49
|
end
|
50
50
|
result
|
51
51
|
end
|
@@ -91,7 +91,9 @@ module TestCentricity
|
|
91
91
|
# @example
|
92
92
|
# TestCentricity::PageManager.set_current_page(product_search_page)
|
93
93
|
#
|
94
|
+
# @deprecated Please use {#current_page=} instead
|
94
95
|
def self.set_current_page(page)
|
96
|
+
warn "[DEPRECATION] 'TestCentricity::PageManager.set_current_page' is deprecated. Please use 'current_page=' instead."
|
95
97
|
@current_page = page
|
96
98
|
end
|
97
99
|
end
|
@@ -104,7 +106,7 @@ module TestCentricity
|
|
104
106
|
result = ''
|
105
107
|
data.each do |data_type, data_class|
|
106
108
|
@data_objects[data_type] = data_class.new unless @data_objects.has_key?(data_type)
|
107
|
-
result = "#{result}def #{data_type
|
109
|
+
result = "#{result}def #{data_type};@#{data_type} ||= TestCentricity::DataManager.find_data_object(:#{data_type});end;"
|
108
110
|
end
|
109
111
|
result
|
110
112
|
end
|
@@ -115,7 +115,7 @@ module TestCentricity
|
|
115
115
|
height = device[:css_height]
|
116
116
|
default_orientation = device[:default_orientation].to_sym
|
117
117
|
if orientation
|
118
|
-
|
118
|
+
orientation.downcase.to_sym == default_orientation ?
|
119
119
|
size = [width, height] :
|
120
120
|
size = [height, width]
|
121
121
|
else
|
@@ -4,8 +4,8 @@ require 'json'
|
|
4
4
|
|
5
5
|
module TestCentricity
|
6
6
|
|
7
|
-
XL_PRIMARY_DATA_PATH
|
8
|
-
XL_PRIMARY_DATA_FILE
|
7
|
+
XL_PRIMARY_DATA_PATH ||= 'features/test_data/'
|
8
|
+
XL_PRIMARY_DATA_FILE ||= "#{XL_PRIMARY_DATA_PATH}data.xls"
|
9
9
|
|
10
10
|
|
11
11
|
class DataObject
|
@@ -17,13 +17,19 @@ module TestCentricity
|
|
17
17
|
@hash_table = data
|
18
18
|
end
|
19
19
|
|
20
|
+
# @deprecated Please use {#current=} instead
|
20
21
|
def self.set_current(current)
|
22
|
+
warn "[DEPRECATION] 'TestCentricity::DataObject.set_current' is deprecated. Please use 'current=' instead."
|
21
23
|
@current = current
|
22
24
|
end
|
23
25
|
|
24
26
|
def self.current
|
25
27
|
@current
|
26
28
|
end
|
29
|
+
|
30
|
+
def self.current=(current)
|
31
|
+
@current = current
|
32
|
+
end
|
27
33
|
end
|
28
34
|
|
29
35
|
|
@@ -56,12 +62,12 @@ module TestCentricity
|
|
56
62
|
end
|
57
63
|
|
58
64
|
def read_excel_row_data(sheet, row_name, parallel = false)
|
59
|
-
|
65
|
+
parallel == :parallel && ENV['PARALLEL'] ? row_spec = "#{row_name}#{ENV['TEST_ENV_NUMBER']}" : row_spec = row_name
|
60
66
|
ExcelData.read_row_data(pick_excel_data_source(sheet, row_spec), sheet, row_spec)
|
61
67
|
end
|
62
68
|
|
63
69
|
def read_excel_pool_data(sheet, row_name, parallel = false)
|
64
|
-
|
70
|
+
parallel == :parallel && ENV['PARALLEL'] ? row_spec = "#{row_name}#{ENV['TEST_ENV_NUMBER']}" : row_spec = row_name
|
65
71
|
ExcelData.read_row_from_pool(pick_excel_data_source(sheet, row_name), sheet, row_spec)
|
66
72
|
end
|
67
73
|
|
@@ -78,11 +78,11 @@ module TestCentricity
|
|
78
78
|
page.all(:xpath, "#{@locator}/#{@table_header}/#{@header_row}/#{@header_column}", :visible => :all).count
|
79
79
|
else
|
80
80
|
if @table_section.nil?
|
81
|
-
|
81
|
+
row_count == 1 ?
|
82
82
|
page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}/#{@table_column}", :visible => :all).count :
|
83
83
|
page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}[2]/#{@table_column}", :visible => :all).count
|
84
84
|
else
|
85
|
-
|
85
|
+
row_count == 1 ?
|
86
86
|
page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_section}/#{@table_row}/#{@table_column}", :visible => :all).count :
|
87
87
|
page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_section}[2]/#{@table_row}/#{@table_column}", :visible => :all).count
|
88
88
|
end
|
@@ -194,7 +194,7 @@ module TestCentricity
|
|
194
194
|
def get_row_data(row)
|
195
195
|
row_count = get_row_count
|
196
196
|
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
197
|
-
|
197
|
+
row > 1 ?
|
198
198
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}[#{row}]") :
|
199
199
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}")
|
200
200
|
value = get_value if exists?
|
@@ -291,7 +291,7 @@ module TestCentricity
|
|
291
291
|
def get_row_attribute(row, attrib)
|
292
292
|
row_count = get_row_count
|
293
293
|
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
294
|
-
|
294
|
+
row > 1 ?
|
295
295
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}[#{row}]") :
|
296
296
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}")
|
297
297
|
result = get_native_attribute(attrib)
|
@@ -14,7 +14,7 @@ module TestCentricity
|
|
14
14
|
data = read_json_node_data('environments.json', environ_name)
|
15
15
|
end
|
16
16
|
@current = Environ.new(data)
|
17
|
-
Environ.
|
17
|
+
Environ.current = @current
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -79,7 +79,9 @@ module TestCentricity
|
|
79
79
|
@session_time_stamp
|
80
80
|
end
|
81
81
|
|
82
|
+
# @deprecated Please use {#browser=} instead
|
82
83
|
def self.set_browser(browser)
|
84
|
+
warn "[DEPRECATION] 'TestCentricity::Environ.set_browser' is deprecated. Please use 'browser=' instead."
|
83
85
|
@browser = browser.downcase.to_sym
|
84
86
|
end
|
85
87
|
|
@@ -91,7 +93,9 @@ module TestCentricity
|
|
91
93
|
@browser
|
92
94
|
end
|
93
95
|
|
96
|
+
# @deprecated Please use {#os=} instead
|
94
97
|
def self.set_os(os)
|
98
|
+
warn "[DEPRECATION] 'TestCentricity::Environ.set_os' is deprecated. Please use 'os=' instead."
|
95
99
|
@os = os
|
96
100
|
end
|
97
101
|
|
@@ -103,7 +107,9 @@ module TestCentricity
|
|
103
107
|
@os
|
104
108
|
end
|
105
109
|
|
110
|
+
# @deprecated Please use {#device=} instead
|
106
111
|
def self.set_device(device)
|
112
|
+
warn "[DEPRECATION] 'TestCentricity::Environ.set_device' is deprecated. Please use 'device=' instead."
|
107
113
|
@device = device
|
108
114
|
end
|
109
115
|
|
@@ -115,7 +121,9 @@ module TestCentricity
|
|
115
121
|
@device
|
116
122
|
end
|
117
123
|
|
124
|
+
# @deprecated Please use {#device_type=} instead
|
118
125
|
def self.set_device_type(type)
|
126
|
+
warn "[DEPRECATION] 'TestCentricity::Environ.set_device_type' is deprecated. Please use 'device_type=' instead."
|
119
127
|
@device_type = type.downcase
|
120
128
|
end
|
121
129
|
|
@@ -127,7 +135,9 @@ module TestCentricity
|
|
127
135
|
@device_type
|
128
136
|
end
|
129
137
|
|
138
|
+
# @deprecated Please use {#platform=} instead
|
130
139
|
def self.set_platform(platform)
|
140
|
+
warn "[DEPRECATION] 'TestCentricity::Environ.set_platform' is deprecated. Please use 'platform=' instead."
|
131
141
|
@platform = platform
|
132
142
|
end
|
133
143
|
|
@@ -151,7 +161,9 @@ module TestCentricity
|
|
151
161
|
@signed_in
|
152
162
|
end
|
153
163
|
|
164
|
+
# @deprecated Please use {#portal_state=} instead
|
154
165
|
def self.set_portal_state(portal_state)
|
166
|
+
warn "[DEPRECATION] 'TestCentricity::Environ.set_portal_state' is deprecated. Please use 'portal_state=' instead."
|
155
167
|
@portal_status = portal_state
|
156
168
|
end
|
157
169
|
|
@@ -163,7 +175,9 @@ module TestCentricity
|
|
163
175
|
@portal_status
|
164
176
|
end
|
165
177
|
|
178
|
+
# @deprecated Please use {#portal_context=} instead
|
166
179
|
def self.set_portal_context(portal_context)
|
180
|
+
warn "[DEPRECATION] 'TestCentricity::Environ.set_portal_context' is deprecated. Please use 'portal_context=' instead."
|
167
181
|
@portal_context = portal_context
|
168
182
|
end
|
169
183
|
|
@@ -28,7 +28,7 @@ module TestCentricity
|
|
28
28
|
# element :siebel_busy, "//html[contains(@class, 'siebui-busy')]"
|
29
29
|
#
|
30
30
|
def self.element(element_name, locator)
|
31
|
-
class_eval(%(def #{element_name
|
31
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::UIElement.new("#{element_name}", self, "#{locator}", :page);end))
|
32
32
|
end
|
33
33
|
|
34
34
|
# Declare and instantiate a collection of generic UI Elements for this page object.
|
@@ -54,7 +54,7 @@ module TestCentricity
|
|
54
54
|
# button :login_button, "//input[@id='submit_button']"
|
55
55
|
#
|
56
56
|
def self.button(element_name, locator)
|
57
|
-
class_eval(%(def #{element_name
|
57
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Button.new("#{element_name}", self, "#{locator}", :page);end))
|
58
58
|
end
|
59
59
|
|
60
60
|
# Declare and instantiate a collection of buttons for this page object.
|
@@ -80,7 +80,7 @@ module TestCentricity
|
|
80
80
|
# textfield :password_field, 'consumer_password'
|
81
81
|
#
|
82
82
|
def self.textfield(element_name, locator)
|
83
|
-
class_eval(%(def #{element_name
|
83
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::TextField.new("#{element_name}", self, "#{locator}", :page);end))
|
84
84
|
end
|
85
85
|
|
86
86
|
# Declare and instantiate a collection of text fields for this page object.
|
@@ -109,7 +109,7 @@ module TestCentricity
|
|
109
109
|
# checkbox :accept_terms_checkbox, 'input#accept_terms_conditions', :accept_terms_label
|
110
110
|
#
|
111
111
|
def self.checkbox(element_name, locator, proxy = nil)
|
112
|
-
class_eval(%(def #{element_name
|
112
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::CheckBox.new("#{element_name}", self, "#{locator}", :page, #{proxy});end))
|
113
113
|
end
|
114
114
|
|
115
115
|
# Declare and instantiate a collection of checkboxes for this page object.
|
@@ -137,7 +137,7 @@ module TestCentricity
|
|
137
137
|
# radio :decline_terms_radio, '#decline_terms_conditions', :decline_terms_label
|
138
138
|
#
|
139
139
|
def self.radio(element_name, locator, proxy = nil)
|
140
|
-
class_eval(%(def #{element_name
|
140
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Radio.new("#{element_name}", self, "#{locator}", :page, #{proxy});end))
|
141
141
|
end
|
142
142
|
|
143
143
|
# Declare and instantiate a collection of radio buttons for this page object.
|
@@ -164,7 +164,7 @@ module TestCentricity
|
|
164
164
|
# label :rollup_price_label, "//div[contains(@id, 'Rollup Item Price')]"
|
165
165
|
#
|
166
166
|
def self.label(element_name, locator)
|
167
|
-
class_eval(%(def #{element_name
|
167
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Label.new("#{element_name}", self, "#{locator}", :page);end))
|
168
168
|
end
|
169
169
|
|
170
170
|
def self.labels(element_hash)
|
@@ -182,7 +182,7 @@ module TestCentricity
|
|
182
182
|
# link :shopping_basket_link, "//a[@href='shopping_basket']"
|
183
183
|
#
|
184
184
|
def self.link(element_name, locator)
|
185
|
-
class_eval(%(def #{element_name
|
185
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Link.new("#{element_name}", self, "#{locator}", :page);end))
|
186
186
|
end
|
187
187
|
|
188
188
|
def self.links(element_hash)
|
@@ -199,7 +199,7 @@ module TestCentricity
|
|
199
199
|
# table :payments_table, "//table[@class='payments_table']"
|
200
200
|
#
|
201
201
|
def self.table(element_name, locator)
|
202
|
-
class_eval(%(def #{element_name
|
202
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Table.new("#{element_name}", self, "#{locator}", :page);end))
|
203
203
|
end
|
204
204
|
|
205
205
|
def self.tables(element_hash)
|
@@ -217,7 +217,7 @@ module TestCentricity
|
|
217
217
|
# selectlist :gender_select, "//select[@id='customer_gender']"
|
218
218
|
#
|
219
219
|
def self.selectlist(element_name, locator)
|
220
|
-
class_eval(%(def #{element_name
|
220
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::SelectList.new("#{element_name}", self, "#{locator}", :page);end))
|
221
221
|
end
|
222
222
|
|
223
223
|
def self.selectlists(element_hash)
|
@@ -234,7 +234,7 @@ module TestCentricity
|
|
234
234
|
# list :x_axis_list, 'g.x-axis'
|
235
235
|
#
|
236
236
|
def self.list(element_name, locator)
|
237
|
-
class_eval(%(def #{element_name
|
237
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::List.new("#{element_name}", self, "#{locator}", :page);end))
|
238
238
|
end
|
239
239
|
|
240
240
|
def self.lists(element_hash)
|
@@ -252,7 +252,7 @@ module TestCentricity
|
|
252
252
|
# image :corporate_logo_image, "//img[@alt='MyCompany_logo']"
|
253
253
|
#
|
254
254
|
def self.image(element_name, locator)
|
255
|
-
class_eval(%(def #{element_name
|
255
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Image.new("#{element_name}", self, "#{locator}", :page);end))
|
256
256
|
end
|
257
257
|
|
258
258
|
def self.images(element_hash)
|
@@ -269,7 +269,7 @@ module TestCentricity
|
|
269
269
|
# filefield :attach_file, 's_SweFileName'
|
270
270
|
#
|
271
271
|
def self.filefield(element_name, locator)
|
272
|
-
class_eval(%(def #{element_name
|
272
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::FileField.new("#{element_name}", self, "#{locator}", :page);end))
|
273
273
|
end
|
274
274
|
|
275
275
|
# Instantiate a single PageSection object for this page object.
|
@@ -280,7 +280,7 @@ module TestCentricity
|
|
280
280
|
# section :search_form, SearchForm
|
281
281
|
#
|
282
282
|
def self.section(section_name, class_name, locator = nil)
|
283
|
-
class_eval(%(def #{section_name
|
283
|
+
class_eval(%(def #{section_name};@#{section_name} ||= #{class_name}.new("#{section_name}", self, "#{locator}", :page);end))
|
284
284
|
end
|
285
285
|
|
286
286
|
def self.sections(section_hash)
|
@@ -299,7 +299,7 @@ module TestCentricity
|
|
299
299
|
else
|
300
300
|
visit "#{environment.protocol}://#{environment.user_id}:#{environment.password}@#{url}"
|
301
301
|
end
|
302
|
-
Environ.
|
302
|
+
Environ.portal_state = :open
|
303
303
|
end
|
304
304
|
|
305
305
|
def verify_page_exists
|
@@ -327,7 +327,7 @@ module TestCentricity
|
|
327
327
|
navigate_to
|
328
328
|
end
|
329
329
|
verify_page_exists
|
330
|
-
PageManager.
|
330
|
+
PageManager.current_page = self
|
331
331
|
end
|
332
332
|
|
333
333
|
def verify_page_contains(content)
|
@@ -424,7 +424,7 @@ module TestCentricity
|
|
424
424
|
end
|
425
425
|
|
426
426
|
if state.is_a?(Hash) && state.length == 1
|
427
|
-
error_msg = "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property
|
427
|
+
error_msg = "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property} property to"
|
428
428
|
state.each do |key, value|
|
429
429
|
case key
|
430
430
|
when :lt, :less_than
|
@@ -456,7 +456,7 @@ module TestCentricity
|
|
456
456
|
end
|
457
457
|
end
|
458
458
|
else
|
459
|
-
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property
|
459
|
+
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property} property")
|
460
460
|
end
|
461
461
|
end
|
462
462
|
end
|
@@ -491,7 +491,7 @@ module TestCentricity
|
|
491
491
|
when :checkbox
|
492
492
|
data_field.set_checkbox_state(data_param.to_bool)
|
493
493
|
when :selectlist
|
494
|
-
|
494
|
+
data_field.get_siebel_object_type == 'JComboBox' ?
|
495
495
|
data_field.set("#{data_param}\t") :
|
496
496
|
data_field.choose_option(data_param)
|
497
497
|
when :radio
|
@@ -37,7 +37,7 @@ module TestCentricity
|
|
37
37
|
# element :basket_header, 'div.basket_header'
|
38
38
|
#
|
39
39
|
def self.element(element_name, locator)
|
40
|
-
class_eval(%(def #{element_name
|
40
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::UIElement.new("#{element_name}", self, "#{locator}", :section);end))
|
41
41
|
end
|
42
42
|
|
43
43
|
# Declare and instantiate a collection of generic UI Elements for this page section.
|
@@ -63,7 +63,7 @@ module TestCentricity
|
|
63
63
|
# button :login_button, "//input[@id='submit_button']"
|
64
64
|
#
|
65
65
|
def self.button(element_name, locator)
|
66
|
-
class_eval(%(def #{element_name
|
66
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Button.new("#{element_name}", self, "#{locator}", :section);end))
|
67
67
|
end
|
68
68
|
|
69
69
|
# Declare and instantiate a collection of buttons for this page section.
|
@@ -89,7 +89,7 @@ module TestCentricity
|
|
89
89
|
# textfield :password_field, 'input#consumer_password'
|
90
90
|
#
|
91
91
|
def self.textfield(element_name, locator)
|
92
|
-
class_eval(%(def #{element_name
|
92
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::TextField.new("#{element_name}", self, "#{locator}", :section);end))
|
93
93
|
end
|
94
94
|
|
95
95
|
# Declare and instantiate a collection of text fields for this page section.
|
@@ -118,7 +118,7 @@ module TestCentricity
|
|
118
118
|
# checkbox :accept_terms_checkbox, 'input#accept_terms_conditions', :accept_terms_label
|
119
119
|
#
|
120
120
|
def self.checkbox(element_name, locator, proxy = nil)
|
121
|
-
class_eval(%(def #{element_name
|
121
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::CheckBox.new("#{element_name}", self, "#{locator}", :section, #{proxy});end))
|
122
122
|
end
|
123
123
|
|
124
124
|
# Declare and instantiate a collection of checkboxes for this page section.
|
@@ -146,7 +146,7 @@ module TestCentricity
|
|
146
146
|
# radio :decline_terms_radio, 'input#decline_terms_conditions', :decline_terms_label
|
147
147
|
#
|
148
148
|
def self.radio(element_name, locator, proxy = nil)
|
149
|
-
class_eval(%(def #{element_name
|
149
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Radio.new("#{element_name}", self, "#{locator}", :section, #{proxy});end))
|
150
150
|
end
|
151
151
|
|
152
152
|
# Declare and instantiate a collection of radio buttons for this page section.
|
@@ -173,7 +173,7 @@ module TestCentricity
|
|
173
173
|
# label :rollup_price_label, "//div[contains(@id, 'Rollup Item Price')]"
|
174
174
|
#
|
175
175
|
def self.label(element_name, locator)
|
176
|
-
class_eval(%(def #{element_name
|
176
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Label.new("#{element_name}", self, "#{locator}", :section);end))
|
177
177
|
end
|
178
178
|
|
179
179
|
def self.labels(element_hash)
|
@@ -191,7 +191,7 @@ module TestCentricity
|
|
191
191
|
# link :shopping_basket_link, "//a[@href='shopping_basket']"
|
192
192
|
#
|
193
193
|
def self.link(element_name, locator)
|
194
|
-
class_eval(%(def #{element_name
|
194
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Link.new("#{element_name}", self, "#{locator}", :section);end))
|
195
195
|
end
|
196
196
|
|
197
197
|
def self.links(element_hash)
|
@@ -208,7 +208,7 @@ module TestCentricity
|
|
208
208
|
# table :payments_table, "//table[@class='payments_table']"
|
209
209
|
#
|
210
210
|
def self.table(element_name, locator)
|
211
|
-
class_eval(%(def #{element_name
|
211
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Table.new("#{element_name}", self, "#{locator}", :section);end))
|
212
212
|
end
|
213
213
|
|
214
214
|
def self.tables(element_hash)
|
@@ -226,7 +226,7 @@ module TestCentricity
|
|
226
226
|
# selectlist :gender_select, "//select[@id='customer_gender']"
|
227
227
|
#
|
228
228
|
def self.selectlist(element_name, locator)
|
229
|
-
class_eval(%(def #{element_name
|
229
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::SelectList.new("#{element_name}", self, "#{locator}", :section);end))
|
230
230
|
end
|
231
231
|
|
232
232
|
def self.selectlists(element_hash)
|
@@ -243,7 +243,7 @@ module TestCentricity
|
|
243
243
|
# list :y_axis_list, 'g.y_axis'
|
244
244
|
#
|
245
245
|
def self.list(element_name, locator)
|
246
|
-
class_eval(%(def #{element_name
|
246
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::List.new("#{element_name}", self, "#{locator}", :section);end))
|
247
247
|
end
|
248
248
|
|
249
249
|
def self.lists(element_hash)
|
@@ -261,7 +261,7 @@ module TestCentricity
|
|
261
261
|
# image :corporate_logo_image, "//img[@alt='MyCompany_logo']"
|
262
262
|
#
|
263
263
|
def self.image(element_name, locator)
|
264
|
-
class_eval(%(def #{element_name
|
264
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::Image.new("#{element_name}", self, "#{locator}", :section);end))
|
265
265
|
end
|
266
266
|
|
267
267
|
def self.images(element_hash)
|
@@ -278,7 +278,7 @@ module TestCentricity
|
|
278
278
|
# filefield :attach_file, 's_SweFileName'
|
279
279
|
#
|
280
280
|
def self.filefield(element_name, locator)
|
281
|
-
class_eval(%(def #{element_name
|
281
|
+
class_eval(%(def #{element_name};@#{element_name} ||= TestCentricity::FileField.new("#{element_name}", self, "#{locator}", :section);end))
|
282
282
|
end
|
283
283
|
|
284
284
|
# Instantiate a single PageSection object within this PageSection object.
|
@@ -289,7 +289,7 @@ module TestCentricity
|
|
289
289
|
# section :search_form, SearchForm
|
290
290
|
#
|
291
291
|
def self.section(section_name, class_name, locator = nil)
|
292
|
-
class_eval(%(def #{section_name
|
292
|
+
class_eval(%(def #{section_name};@#{section_name} ||= #{class_name}.new("#{section_name}", self, "#{locator}", :section);end))
|
293
293
|
end
|
294
294
|
|
295
295
|
def self.sections(section_hash)
|
@@ -299,7 +299,7 @@ module TestCentricity
|
|
299
299
|
end
|
300
300
|
|
301
301
|
def get_locator
|
302
|
-
|
302
|
+
@locator.empty? && defined?(section_locator) ? locator = section_locator : locator = @locator
|
303
303
|
(@context == :section && !@parent.nil? && !@parent.get_locator.nil?) ? "#{@parent.get_locator}|#{locator}" : locator
|
304
304
|
end
|
305
305
|
|
@@ -356,7 +356,7 @@ module TestCentricity
|
|
356
356
|
visible = false
|
357
357
|
visible = section.visible? if exists
|
358
358
|
# the section is visible if it exists and it is not invisible
|
359
|
-
|
359
|
+
exists && visible ? true : false
|
360
360
|
end
|
361
361
|
|
362
362
|
# Is Section object hidden (not visible)?
|
@@ -495,7 +495,7 @@ module TestCentricity
|
|
495
495
|
end
|
496
496
|
|
497
497
|
if state.is_a?(Hash) && state.length == 1
|
498
|
-
error_msg = "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property
|
498
|
+
error_msg = "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property} property to"
|
499
499
|
state.each do |key, value|
|
500
500
|
case key
|
501
501
|
when :lt, :less_than
|
@@ -527,7 +527,7 @@ module TestCentricity
|
|
527
527
|
end
|
528
528
|
end
|
529
529
|
else
|
530
|
-
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property
|
530
|
+
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property} property")
|
531
531
|
end
|
532
532
|
end
|
533
533
|
end
|
@@ -563,7 +563,7 @@ module TestCentricity
|
|
563
563
|
when :checkbox
|
564
564
|
data_field.set_checkbox_state(data_param.to_bool)
|
565
565
|
when :selectlist
|
566
|
-
|
566
|
+
data_field.get_siebel_object_type == 'JComboBox' ?
|
567
567
|
data_field.set("#{data_param}\t") :
|
568
568
|
data_field.choose_option(data_param)
|
569
569
|
when :radio
|
@@ -164,7 +164,7 @@ module TestCentricity
|
|
164
164
|
invisible = !obj.visible? if exists
|
165
165
|
end
|
166
166
|
# the object is visible if it exists and it is not invisible
|
167
|
-
|
167
|
+
exists && !invisible ? true : false
|
168
168
|
end
|
169
169
|
|
170
170
|
# Is UI object hidden (not visible)?
|
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.18
|
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-
|
11
|
+
date: 2016-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|