testcentricity_web 1.0.12 → 1.0.13
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 +11 -7
- data/lib/testcentricity_web/elements/checkbox.rb +3 -3
- data/lib/testcentricity_web/elements/image.rb +1 -1
- data/lib/testcentricity_web/elements/list.rb +2 -2
- data/lib/testcentricity_web/elements/select_list.rb +4 -4
- data/lib/testcentricity_web/elements/table.rb +24 -24
- data/lib/testcentricity_web/excel_helper.rb +12 -7
- data/lib/testcentricity_web/ui_elements_helper.rb +18 -14
- 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: cf89c5afd0ca60f69d268b00b52500ce994c38d8
|
4
|
+
data.tar.gz: d0fba7f9377fc22a98b0f073b8f2c8c70d8d0168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08af8c2f845cb7e1025fd85409bb42b89e1ff4e2c5cf5e7cbfe7040b06ca77052dc32632cebb80f0fa02398c9ad13888f830998ca7a32236fe8b5cf690c0d7a4
|
7
|
+
data.tar.gz: fe29e5bcd42a165764109474b95e154ad6255c4ba00791b12eb5cc778055c035483ef37aec22dfec12b93cdc9e8b45c4f4645d1268f5851413d9220026601c3d
|
data/README.md
CHANGED
@@ -463,7 +463,7 @@ executed:
|
|
463
463
|
|Privacy Policy |
|
464
464
|
|FAQs |
|
465
465
|
|Refunds & Cancellations |
|
466
|
-
|Contact
|
466
|
+
|Contact Us |
|
467
467
|
|
468
468
|
|
469
469
|
Include the step definitions and code below in a `page_steps.rb` or `generic_steps.rb` file in the `features/step_definitions` folder:
|
@@ -906,18 +906,22 @@ replace the placeholder text with your user account and authorization code for t
|
|
906
906
|
|
907
907
|
# CrossBrowserTesting OS X desktop browser profiles
|
908
908
|
cb_osx: --profile cb_desktop RESOLUTION="1920x1200"
|
909
|
+
cb_macos_sierra: --profile cb_osx CB_OS="Mac10.12"
|
910
|
+
cb_chrome_sierra: --profile cb_macos_sierra CB_BROWSER="Chrome53x64"
|
911
|
+
cb_safari_sierra: --profile cb_macos_sierra CB_BROWSER="Safari10"
|
912
|
+
|
909
913
|
cb_osx_el_capitan: --profile cb_osx CB_OS="Mac10.11"
|
910
|
-
cb_ff_el_cap: --profile cb_osx_el_capitan CB_BROWSER="
|
914
|
+
cb_ff_el_cap: --profile cb_osx_el_capitan CB_BROWSER="FF46"
|
911
915
|
cb_chrome_el_cap: --profile cb_osx_el_capitan CB_BROWSER="Chrome48x64"
|
912
916
|
cb_safari_el_cap: --profile cb_osx_el_capitan CB_BROWSER="Safari9"
|
913
917
|
|
914
918
|
cb_osx_yosemite: --profile cb_osx CB_OS="Mac10.10"
|
915
|
-
cb_ff_yos: --profile cb_osx_yosemite CB_BROWSER="
|
919
|
+
cb_ff_yos: --profile cb_osx_yosemite CB_BROWSER="FF46"
|
916
920
|
cb_chrome_yos: --profile cb_osx_yosemite CB_BROWSER="Chrome48x64"
|
917
921
|
cb_safari_yos: --profile cb_osx_yosemite CB_BROWSER="Safari8"
|
918
922
|
|
919
923
|
cb_osx_mavericks: --profile cb_osx CB_OS="Mac10.9"
|
920
|
-
cb_ff_mav: --profile cb_osx_mavericks CB_BROWSER="
|
924
|
+
cb_ff_mav: --profile cb_osx_mavericks CB_BROWSER="FF46"
|
921
925
|
cb_chrome_mav: --profile cb_osx_mavericks CB_BROWSER="Chrome48x64"
|
922
926
|
cb_safari_mav: --profile cb_osx_mavericks CB_BROWSER="Safari7"
|
923
927
|
|
@@ -926,9 +930,9 @@ replace the placeholder text with your user account and authorization code for t
|
|
926
930
|
cb_win7: --profile cb_win CB_OS="Win7x64-C1"
|
927
931
|
cb_win8: --profile cb_win CB_OS="Win8"
|
928
932
|
cb_win10: --profile cb_win CB_OS="Win10"
|
929
|
-
cb_ff_win7: --profile cb_win7 CB_BROWSER="
|
930
|
-
cb_ff_win8: --profile cb_win8 CB_BROWSER="
|
931
|
-
cb_ff_win10: --profile cb_win10 CB_BROWSER="
|
933
|
+
cb_ff_win7: --profile cb_win7 CB_BROWSER="FF46"
|
934
|
+
cb_ff_win8: --profile cb_win8 CB_BROWSER="FF46"
|
935
|
+
cb_ff_win10: --profile cb_win10 CB_BROWSER="FF46"
|
932
936
|
cb_chrome_win7: --profile cb_win7 CB_BROWSER="Chrome48x64"
|
933
937
|
cb_chrome_win8: --profile cb_win8 CB_BROWSER="Chrome48x64"
|
934
938
|
cb_chrome_win10: --profile cb_win10 CB_BROWSER="Chrome48x64"
|
@@ -78,8 +78,8 @@ module TestCentricity
|
|
78
78
|
def verify_check_state(state, enqueue = false)
|
79
79
|
actual = checked?
|
80
80
|
enqueue ?
|
81
|
-
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected checkbox
|
82
|
-
assert_equal(state, actual, "Expected checkbox
|
81
|
+
ExceptionQueue.enqueue_assert_equal(state, actual, "Expected checkbox #{object_ref_message}") :
|
82
|
+
assert_equal(state, actual, "Expected checkbox #{object_ref_message} to be #{state} but found #{actual} instead")
|
83
83
|
end
|
84
84
|
|
85
85
|
# Set the check state of a Siebel OUI JCheckBox object.
|
@@ -91,7 +91,7 @@ module TestCentricity
|
|
91
91
|
def set_siebel_checkbox_state(state)
|
92
92
|
obj, _ = find_element
|
93
93
|
object_not_found_exception(obj, 'Siebel checkbox')
|
94
|
-
raise "UI
|
94
|
+
raise "UI #{object_ref_message} is not a Siebel CheckBox object" unless get_siebel_object_type == 'JCheckBox'
|
95
95
|
expected = state.to_bool
|
96
96
|
obj.click unless expected == obj.checked?
|
97
97
|
end
|
@@ -28,7 +28,7 @@ module TestCentricity
|
|
28
28
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
29
29
|
wait.until { is_loaded? }
|
30
30
|
rescue
|
31
|
-
raise "Image
|
31
|
+
raise "Image #{object_ref_message} failed to load within #{timeout} seconds" unless is_loaded?
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -33,8 +33,8 @@ module TestCentricity
|
|
33
33
|
def verify_list_items(expected, enqueue = false)
|
34
34
|
actual = get_list_items
|
35
35
|
enqueue ?
|
36
|
-
ExceptionQueue.enqueue_assert_equal(expected, actual, "Expected list
|
37
|
-
assert_equal(expected, actual, "Expected list
|
36
|
+
ExceptionQueue.enqueue_assert_equal(expected, actual, "Expected list #{object_ref_message}") :
|
37
|
+
assert_equal(expected, actual, "Expected list #{object_ref_message} to be #{expected} but found #{actual}")
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -101,8 +101,8 @@ module TestCentricity
|
|
101
101
|
def verify_options(expected, enqueue = false)
|
102
102
|
actual = get_options
|
103
103
|
enqueue ?
|
104
|
-
ExceptionQueue.enqueue_assert_equal(expected, actual, "Expected list of options in list
|
105
|
-
assert_equal(expected, actual, "Expected list of options in list
|
104
|
+
ExceptionQueue.enqueue_assert_equal(expected, actual, "Expected list of options in list #{object_ref_message}") :
|
105
|
+
assert_equal(expected, actual, "Expected list of options in list #{object_ref_message} to be #{expected} but found #{actual}")
|
106
106
|
end
|
107
107
|
|
108
108
|
# Return text of first selected option in a select box object.
|
@@ -156,8 +156,8 @@ module TestCentricity
|
|
156
156
|
sleep(0.5)
|
157
157
|
actual = page.all(:xpath, "//li[@class='ui-menu-item']").collect(&:text)
|
158
158
|
enqueue ?
|
159
|
-
ExceptionQueue.enqueue_assert_equal(expected, actual, "Expected list of options in list #{
|
160
|
-
assert_equal(expected, actual, "Expected list of options in list #{
|
159
|
+
ExceptionQueue.enqueue_assert_equal(expected, actual, "Expected list of options in list #{object_ref_message}") :
|
160
|
+
assert_equal(expected, actual, "Expected list of options in list #{object_ref_message} to be #{expected} but found #{actual}")
|
161
161
|
obj, _ = find_element
|
162
162
|
obj.native.send_keys(:escape)
|
163
163
|
end
|
@@ -99,9 +99,9 @@ module TestCentricity
|
|
99
99
|
#
|
100
100
|
def hover_table_cell(row, column)
|
101
101
|
row_count = get_row_count
|
102
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
102
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
103
103
|
column_count = get_column_count
|
104
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
104
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
105
105
|
set_table_cell_locator(row, column)
|
106
106
|
hover
|
107
107
|
clear_alt_locator
|
@@ -116,9 +116,9 @@ module TestCentricity
|
|
116
116
|
#
|
117
117
|
def click_table_cell(row, column)
|
118
118
|
row_count = get_row_count
|
119
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
119
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
120
120
|
column_count = get_column_count
|
121
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
121
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
122
122
|
set_table_cell_locator(row, column)
|
123
123
|
click
|
124
124
|
clear_alt_locator
|
@@ -133,9 +133,9 @@ module TestCentricity
|
|
133
133
|
#
|
134
134
|
def double_click_table_cell(row, column)
|
135
135
|
row_count = get_row_count
|
136
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
136
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
137
137
|
column_count = get_column_count
|
138
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
138
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
139
139
|
set_table_cell_locator(row, column)
|
140
140
|
double_click
|
141
141
|
clear_alt_locator
|
@@ -150,9 +150,9 @@ module TestCentricity
|
|
150
150
|
#
|
151
151
|
def click_table_cell_link(row, column)
|
152
152
|
row_count = get_row_count
|
153
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
153
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
154
154
|
column_count = get_column_count
|
155
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
155
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
156
156
|
set_table_cell_locator(row, column)
|
157
157
|
saved_locator = @alt_locator
|
158
158
|
set_alt_locator("#{@alt_locator}/a")
|
@@ -174,7 +174,7 @@ module TestCentricity
|
|
174
174
|
def get_table_row(row)
|
175
175
|
columns = []
|
176
176
|
row_count = get_row_count
|
177
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
177
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
178
178
|
column_count = get_column_count
|
179
179
|
(1..column_count).each do |column|
|
180
180
|
value = ''
|
@@ -194,7 +194,7 @@ module TestCentricity
|
|
194
194
|
|
195
195
|
def get_row_data(row)
|
196
196
|
row_count = get_row_count
|
197
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
197
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
198
198
|
(row > 1) ?
|
199
199
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}[#{row}]") :
|
200
200
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}")
|
@@ -206,7 +206,7 @@ module TestCentricity
|
|
206
206
|
def get_table_column(column)
|
207
207
|
rows = []
|
208
208
|
column_count = get_column_count
|
209
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
209
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
210
210
|
row_count = get_row_count
|
211
211
|
(1..row_count).each do |row|
|
212
212
|
value = ''
|
@@ -234,9 +234,9 @@ module TestCentricity
|
|
234
234
|
#
|
235
235
|
def get_table_cell(row, column)
|
236
236
|
row_count = get_row_count
|
237
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
237
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
238
238
|
column_count = get_column_count
|
239
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
239
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
240
240
|
set_table_cell_locator(row, column)
|
241
241
|
saved_locator = @alt_locator
|
242
242
|
set_alt_locator("#{saved_locator}/input")
|
@@ -257,8 +257,8 @@ module TestCentricity
|
|
257
257
|
def verify_table_cell(row, column, expected, enqueue = false)
|
258
258
|
actual = get_table_cell(row, column)
|
259
259
|
enqueue ?
|
260
|
-
ExceptionQueue.enqueue_assert_equal(expected.strip, actual.strip, "Expected table
|
261
|
-
assert_equal(expected.strip, actual.strip, "Expected table
|
260
|
+
ExceptionQueue.enqueue_assert_equal(expected.strip, actual.strip, "Expected table #{object_ref_message} row #{row}/column #{column}") :
|
261
|
+
assert_equal(expected.strip, actual.strip, "Expected table #{object_ref_message} row #{row}/column #{column} to display '#{expected}' but found '#{actual}'")
|
262
262
|
end
|
263
263
|
|
264
264
|
# Set the value of the specified cell in a table object.
|
@@ -271,7 +271,7 @@ module TestCentricity
|
|
271
271
|
#
|
272
272
|
def set_table_cell(row, column, value)
|
273
273
|
row_count = get_row_count
|
274
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
274
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
275
275
|
find_table_cell(row, column)
|
276
276
|
find_table_cell(row, column) unless exists?
|
277
277
|
set(value)
|
@@ -280,9 +280,9 @@ module TestCentricity
|
|
280
280
|
|
281
281
|
def get_cell_attribute(row, column, attrib)
|
282
282
|
row_count = get_row_count
|
283
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
283
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
284
284
|
column_count = get_column_count
|
285
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
285
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
286
286
|
set_table_cell_locator(row, column)
|
287
287
|
result = get_native_attribute(attrib)
|
288
288
|
clear_alt_locator
|
@@ -291,7 +291,7 @@ module TestCentricity
|
|
291
291
|
|
292
292
|
def get_row_attribute(row, attrib)
|
293
293
|
row_count = get_row_count
|
294
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
294
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
295
295
|
(row > 1) ?
|
296
296
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}[#{row}]") :
|
297
297
|
set_alt_locator("#{@locator}/#{@table_body}/#{@table_row}")
|
@@ -375,7 +375,7 @@ module TestCentricity
|
|
375
375
|
#
|
376
376
|
def click_header_column(column)
|
377
377
|
column_count = get_column_count
|
378
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table header
|
378
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table header #{object_ref_message}" if column > column_count
|
379
379
|
set_alt_locator("#{@locator}//#{@table_header}/#{@header_row}/#{@header_column}[#{column}]")
|
380
380
|
click if exists?
|
381
381
|
clear_alt_locator
|
@@ -383,7 +383,7 @@ module TestCentricity
|
|
383
383
|
|
384
384
|
def get_header_column(column)
|
385
385
|
column_count = get_column_count
|
386
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table header
|
386
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table header #{object_ref_message}" if column > column_count
|
387
387
|
set_alt_locator("#{@locator}//#{@table_header}/#{@header_row}/#{@header_column}[#{column}]")
|
388
388
|
value = get_value(:all) if exists?(:all)
|
389
389
|
clear_alt_locator
|
@@ -403,9 +403,9 @@ module TestCentricity
|
|
403
403
|
|
404
404
|
def is_table_row_expanded?(row, column)
|
405
405
|
row_count = get_row_count
|
406
|
-
raise "Row #{row} exceeds number of rows (#{row_count}) in table
|
406
|
+
raise "Row #{row} exceeds number of rows (#{row_count}) in table #{object_ref_message}" if row > row_count
|
407
407
|
column_count = get_column_count
|
408
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
408
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
409
409
|
set_table_cell_locator(row, column)
|
410
410
|
set_alt_locator("#{@alt_locator}/#{@tree_expand}")
|
411
411
|
expanded = true
|
@@ -435,7 +435,7 @@ module TestCentricity
|
|
435
435
|
def expand_all_table_rows(column)
|
436
436
|
row_count = get_row_count
|
437
437
|
column_count = get_column_count
|
438
|
-
raise "Column #{column} exceeds number of columns (#{column_count}) in table
|
438
|
+
raise "Column #{column} exceeds number of columns (#{column_count}) in table #{object_ref_message}" if column > column_count
|
439
439
|
row_count.downto(1) do |row|
|
440
440
|
expand_table_row(row, column)
|
441
441
|
end
|
@@ -10,12 +10,14 @@ module TestCentricity
|
|
10
10
|
|
11
11
|
def self.worksheet_exists?(file, sheet)
|
12
12
|
exists = false
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
if File.exist?(file)
|
14
|
+
work_book = Spreadsheet.open file
|
15
|
+
worksheets = work_book.worksheets
|
16
|
+
worksheets.each do |worksheet|
|
17
|
+
if worksheet.name == sheet
|
18
|
+
exists = true
|
19
|
+
break
|
20
|
+
end
|
19
21
|
end
|
20
22
|
end
|
21
23
|
exists
|
@@ -56,6 +58,7 @@ module TestCentricity
|
|
56
58
|
end
|
57
59
|
|
58
60
|
def self.read_row_from_pool(file, sheet, rowspec, columns = nil)
|
61
|
+
raise "File #{file} does not exists" unless File.exist?(file)
|
59
62
|
work_book = Spreadsheet.open file
|
60
63
|
work_sheet = work_book.worksheet sheet
|
61
64
|
|
@@ -121,8 +124,9 @@ module TestCentricity
|
|
121
124
|
end
|
122
125
|
|
123
126
|
def self.read_row_data(file, sheet, rowspec, columns = nil)
|
127
|
+
raise "File #{file} does not exists" unless File.exist?(file)
|
124
128
|
work_book = Spreadsheet.open file
|
125
|
-
work_sheet
|
129
|
+
work_sheet = work_book.worksheet sheet
|
126
130
|
# get column headings from row 0 of worksheet
|
127
131
|
headings = work_sheet.row(0)
|
128
132
|
# if rowspec is a string then we have to find a matching row name
|
@@ -178,6 +182,7 @@ module TestCentricity
|
|
178
182
|
end
|
179
183
|
|
180
184
|
def self.read_range_data(file, sheet, rangespec)
|
185
|
+
raise "File #{file} does not exists" unless File.exist?(file)
|
181
186
|
work_book = Spreadsheet.open file
|
182
187
|
work_sheet = work_book.worksheet sheet
|
183
188
|
# get column headings from row 0 of worksheet
|
@@ -106,7 +106,7 @@ module TestCentricity
|
|
106
106
|
#
|
107
107
|
def click_at(x, y)
|
108
108
|
obj, _ = find_element
|
109
|
-
raise "UI
|
109
|
+
raise "UI #{object_ref_message} not found" unless obj
|
110
110
|
obj.click_at(x, y)
|
111
111
|
end
|
112
112
|
|
@@ -210,7 +210,7 @@ module TestCentricity
|
|
210
210
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
211
211
|
wait.until { exists? }
|
212
212
|
rescue
|
213
|
-
raise "Could not find UI
|
213
|
+
raise "Could not find UI #{object_ref_message} after #{timeout} seconds" unless exists?
|
214
214
|
end
|
215
215
|
|
216
216
|
# Wait until the object no longer exists, or until the specified wait time has expired.
|
@@ -224,7 +224,7 @@ module TestCentricity
|
|
224
224
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
225
225
|
wait.until { !exists? }
|
226
226
|
rescue
|
227
|
-
raise "UI
|
227
|
+
raise "UI #{object_ref_message} remained visible after #{timeout} seconds" if exists?
|
228
228
|
end
|
229
229
|
|
230
230
|
# Wait until the object is visible, or until the specified wait time has expired.
|
@@ -238,7 +238,7 @@ module TestCentricity
|
|
238
238
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
239
239
|
wait.until { visible? }
|
240
240
|
rescue
|
241
|
-
raise "Could not find UI
|
241
|
+
raise "Could not find UI #{object_ref_message} after #{timeout} seconds" unless visible?
|
242
242
|
end
|
243
243
|
|
244
244
|
# Wait until the object is hidden, or until the specified wait time has expired.
|
@@ -252,7 +252,7 @@ module TestCentricity
|
|
252
252
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
253
253
|
wait.until { hidden? }
|
254
254
|
rescue
|
255
|
-
raise "UI
|
255
|
+
raise "UI #{object_ref_message} remained visible after #{timeout} seconds" if visible?
|
256
256
|
end
|
257
257
|
|
258
258
|
# Wait until the object's value equals the specified value, or until the specified wait time has expired.
|
@@ -266,7 +266,7 @@ module TestCentricity
|
|
266
266
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
267
267
|
wait.until { get_value == value }
|
268
268
|
rescue
|
269
|
-
raise "Value of UI
|
269
|
+
raise "Value of UI #{object_ref_message} failed to equal '#{value}' after #{timeout} seconds" unless get_value == value
|
270
270
|
end
|
271
271
|
|
272
272
|
# Wait until the object's value changes to a different value, or until the specified wait time has expired.
|
@@ -281,7 +281,7 @@ module TestCentricity
|
|
281
281
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
282
282
|
wait.until { get_value != value }
|
283
283
|
rescue
|
284
|
-
raise "Value of UI
|
284
|
+
raise "Value of UI #{object_ref_message} failed to change from '#{value}' after #{timeout} seconds" if get_value == value
|
285
285
|
end
|
286
286
|
|
287
287
|
def get_value(visible = true)
|
@@ -300,8 +300,8 @@ module TestCentricity
|
|
300
300
|
def verify_value(expected, enqueue = false)
|
301
301
|
actual = get_value
|
302
302
|
enqueue ?
|
303
|
-
ExceptionQueue.enqueue_assert_equal(expected.strip, actual.strip, "Expected UI
|
304
|
-
assert_equal(expected.strip, actual.strip, "Expected UI
|
303
|
+
ExceptionQueue.enqueue_assert_equal(expected.strip, actual.strip, "Expected UI #{object_ref_message}") :
|
304
|
+
assert_equal(expected.strip, actual.strip, "Expected UI #{object_ref_message} to display '#{expected}' but found '#{actual}'")
|
305
305
|
end
|
306
306
|
|
307
307
|
alias :verify_caption :verify_value
|
@@ -354,7 +354,7 @@ module TestCentricity
|
|
354
354
|
def find_object(visible = true)
|
355
355
|
@alt_locator.nil? ? locator = @locator : locator = @alt_locator
|
356
356
|
tries ||= 6
|
357
|
-
attributes = [:id, :
|
357
|
+
attributes = [:id, :ignore_parent_xpath, :ignore_parent_css, :type_xpath_css, :type_css_xpath, :xpath, :css]
|
358
358
|
type = attributes[tries]
|
359
359
|
if @context == :section && !@parent.get_locator.nil?
|
360
360
|
parent_locator = @parent.get_locator
|
@@ -365,18 +365,18 @@ module TestCentricity
|
|
365
365
|
when :xpath
|
366
366
|
parent_locator = parent_locator.gsub('|', '')
|
367
367
|
obj = page.find(:xpath, "#{parent_locator}#{locator}", :wait => 0.01, :visible => visible)
|
368
|
-
when :
|
368
|
+
when :type_css_xpath
|
369
369
|
type = :xpath
|
370
370
|
parent_locator = parent_locator.gsub('|', ' ')
|
371
371
|
obj = page.find(:css, parent_locator, :wait => 0.01).find(:xpath, locator, :wait => 0.01, :visible => visible)
|
372
|
-
when :
|
372
|
+
when :type_xpath_css
|
373
373
|
type = :css
|
374
374
|
parent_locator = parent_locator.gsub('|', ' ')
|
375
375
|
obj = page.find(:xpath, parent_locator, :wait => 0.01).find(:css, locator, :wait => 0.01, :visible => visible)
|
376
|
-
when :
|
376
|
+
when :ignore_parent_css
|
377
377
|
type = :css
|
378
378
|
obj = page.find(:css, locator, :wait => 0.01, :visible => visible)
|
379
|
-
when :
|
379
|
+
when :ignore_parent_xpath
|
380
380
|
type = :xpath
|
381
381
|
obj = page.find(:xpath, locator, :wait => 0.01, :visible => visible)
|
382
382
|
end
|
@@ -410,5 +410,9 @@ module TestCentricity
|
|
410
410
|
trigger = "#{@parent.get_locator} #{trigger}" if @context == :section && !@parent.get_locator.nil?
|
411
411
|
first(trigger).click
|
412
412
|
end
|
413
|
+
|
414
|
+
def object_ref_message
|
415
|
+
"object '#{get_name}' (#{get_locator})"
|
416
|
+
end
|
413
417
|
end
|
414
418
|
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.13
|
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-10-
|
11
|
+
date: 2016-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|