testcentricity_web 0.9.8 → 0.9.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0420819e0943574b979c1320b61eb1eff1bf2048
4
- data.tar.gz: f4a26eb7cfed898ca65d8cede6da703b1d0f1c82
3
+ metadata.gz: b26fa40f22398d2ac393da8f5fab8f71ff721e9c
4
+ data.tar.gz: 477654f57687ef096b01a33023d40fa77e6bb8fa
5
5
  SHA512:
6
- metadata.gz: 75ed89fe11a8b182650d2eab3296faccc6d61d290717fb7a01d9fdfeefcfa8c79eec304a9abde520c66015477a8a5124871b3ec4ce3699fe5ca94d13ea974bf8
7
- data.tar.gz: de6bf1f84b62bd33e37a5ff894f452b13af17d9d761150d96410ed008a9cf87bafd249968dbf2caeb7ea4057c8011b792e661bc3fd8640c3c6849717a83a99c2
6
+ metadata.gz: 51970f4ca0b0da4378bf67a8982629a580c836931ac1f5eb378da597be30ffadfb8d56cedefef6f369e4fea90637bfd137a6744c843d2ab538379690a7ef9a7c
7
+ data.tar.gz: 05556046ca29a4cc2fbf6f23dcbd1a8e3a742b4363b28474a72b83d33a23ebc2f5eaa07c90341bf5460da5acbd949e0d4665fddc9433f941d6694217e3c318e0
@@ -186,9 +186,7 @@ module TestCentricity
186
186
  set_alt_locator("#{saved_locator}/input")
187
187
  unless exists?
188
188
  set_alt_locator("#{saved_locator}/textarea")
189
- unless exists?
190
- set_alt_locator(saved_locator)
191
- end
189
+ set_alt_locator(saved_locator) unless exists?
192
190
  end
193
191
  value = get_value if exists?
194
192
  columns.push(value)
@@ -208,6 +206,27 @@ module TestCentricity
208
206
  value
209
207
  end
210
208
 
209
+ def get_table_column(column)
210
+ rows = []
211
+ column_count = get_column_count
212
+ raise "Column #{column} exceeds number of columns (#{column_count}) in table #{@locator}" if column > column_count
213
+ row_count = get_row_count
214
+ (1..row_count).each do |row|
215
+ value = ''
216
+ set_table_cell_locator(row, column)
217
+ saved_locator = @alt_locator
218
+ set_alt_locator("#{saved_locator}/input")
219
+ unless exists?
220
+ set_alt_locator("#{saved_locator}/textarea")
221
+ set_alt_locator(saved_locator) unless exists?
222
+ end
223
+ value = get_value if exists?
224
+ rows.push(value)
225
+ end
226
+ clear_alt_locator
227
+ rows
228
+ end
229
+
211
230
  # Return text contained in specified cell of a table object.
212
231
  #
213
232
  # @param row [Integer] row number
@@ -226,9 +245,7 @@ module TestCentricity
226
245
  set_alt_locator("#{saved_locator}/input")
227
246
  unless exists?
228
247
  set_alt_locator("#{saved_locator}/textarea")
229
- unless exists?
230
- set_alt_locator(saved_locator)
231
- end
248
+ set_alt_locator(saved_locator) unless exists?
232
249
  end
233
250
  value = get_value if exists?
234
251
  clear_alt_locator
@@ -398,12 +415,13 @@ module TestCentricity
398
415
  def set_table_cell_locator(row, column)
399
416
  if @table_section.nil?
400
417
  row_spec = "#{@locator}/#{@table_body}/#{@table_row}"
401
- row_spec = "#{row_spec}[#{row}]" if row > 1
418
+ row_spec = "#{row_spec}[#{row}]"
402
419
  else
403
420
  row_spec = "#{@locator}/#{@table_body}/#{@table_section}"
404
421
  row_spec = "#{row_spec}[#{row}]/#{@table_row}"
405
422
  end
406
- column_spec = "/#{@table_column}[#{column}]"
423
+ column_spec = "/#{@table_column}"
424
+ column_spec = "#{column_spec}[#{column}]" if column > 1
407
425
  set_alt_locator("#{row_spec}#{column_spec}")
408
426
  end
409
427
 
@@ -296,6 +296,12 @@ module TestCentricity
296
296
  cell = property.to_s.gsub('cell_', '')
297
297
  cell = cell.split('_')
298
298
  actual = ui_object.get_table_cell(cell[0].to_i, cell[1].to_i)
299
+ elsif property.to_s.start_with? ('row_')
300
+ row = property.to_s.gsub('row_', '')
301
+ actual = ui_object.get_table_row(row.to_i)
302
+ elsif property.to_s.start_with? ('column_')
303
+ column = property.to_s.gsub('column_', '')
304
+ actual = ui_object.get_table_column(column.to_i)
299
305
  end
300
306
  end
301
307
 
@@ -311,6 +317,12 @@ module TestCentricity
311
317
  ExceptionQueue.enqueue_exception("#{error_msg} greater than #{value} but found #{actual}") unless actual > value
312
318
  when :gt_eq, :greater_than_or_equal
313
319
  ExceptionQueue.enqueue_exception("#{error_msg} greater than or equal to #{value} but found #{actual}") unless actual >= value
320
+ when :starts_with
321
+ ExceptionQueue.enqueue_exception("#{error_msg} start with '#{value}' but found #{actual}") unless actual.start_with?(value)
322
+ when :ends_with
323
+ ExceptionQueue.enqueue_exception("#{error_msg} end with '#{value}' but found #{actual}") unless actual.end_with?(value)
324
+ when :contains
325
+ ExceptionQueue.enqueue_exception("#{error_msg} contain '#{value}' but found #{actual}") unless actual.include?(value)
314
326
  end
315
327
  end
316
328
  else
@@ -301,21 +301,33 @@ module TestCentricity
301
301
  cell = property.to_s.gsub('cell_', '')
302
302
  cell = cell.split('_')
303
303
  actual = ui_object.get_table_cell(cell[0].to_i, cell[1].to_i)
304
+ elsif property.to_s.start_with? ('row_')
305
+ row = property.to_s.gsub('row_', '')
306
+ actual = ui_object.get_table_row(row.to_i)
307
+ elsif property.to_s.start_with? ('column_')
308
+ column = property.to_s.gsub('column_', '')
309
+ actual = ui_object.get_table_column(column.to_i)
304
310
  end
305
311
  end
306
312
 
307
313
  if state.is_a?(Hash) && state.length == 1
308
- error_msg = "Expected #{ui_object.get_locator} #{property.to_s} property to be"
314
+ error_msg = "Expected #{ui_object.get_locator} #{property.to_s} property to"
309
315
  state.each do |key, value|
310
316
  case key
311
317
  when :lt, :less_than
312
- ExceptionQueue.enqueue_exception("#{error_msg} less than #{value} but found #{actual}") unless actual < value
318
+ ExceptionQueue.enqueue_exception("#{error_msg} be less than #{value} but found #{actual}") unless actual < value
313
319
  when :lt_eq, :less_than_or_equal
314
- ExceptionQueue.enqueue_exception("#{error_msg} less than or equal to #{value} but found #{actual}") unless actual <= value
320
+ ExceptionQueue.enqueue_exception("#{error_msg} be less than or equal to #{value} but found #{actual}") unless actual <= value
315
321
  when :gt, :greater_than
316
- ExceptionQueue.enqueue_exception("#{error_msg} greater than #{value} but found #{actual}") unless actual > value
322
+ ExceptionQueue.enqueue_exception("#{error_msg} be greater than #{value} but found #{actual}") unless actual > value
317
323
  when :gt_eq, :greater_than_or_equal
318
- ExceptionQueue.enqueue_exception("#{error_msg} greater than or equal to #{value} but found #{actual}") unless actual >= value
324
+ ExceptionQueue.enqueue_exception("#{error_msg} be greater than or equal to #{value} but found #{actual}") unless actual >= value
325
+ when :starts_with
326
+ ExceptionQueue.enqueue_exception("#{error_msg} start with '#{value}' but found #{actual}") unless actual.start_with?(value)
327
+ when :ends_with
328
+ ExceptionQueue.enqueue_exception("#{error_msg} end with '#{value}' but found #{actual}") unless actual.end_with?(value)
329
+ when :contains
330
+ ExceptionQueue.enqueue_exception("#{error_msg} contain '#{value}' but found #{actual}") unless actual.include?(value)
319
331
  end
320
332
  end
321
333
  else
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.9.8'
2
+ VERSION = '0.9.9'
3
3
  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: 0.9.8
4
+ version: 0.9.9
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-06-22 00:00:00.000000000 Z
11
+ date: 2016-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler