testcentricity_web 0.9.3.4 → 0.9.4

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: 5e4138339ebdf78fa5519da276812a9a6a4fb64a
4
- data.tar.gz: 8e3d12822860d9aee74567cac350d0f9a1dc88d3
3
+ metadata.gz: 9d8a0d27bc5858321d080844be1c2cdac9be8f0f
4
+ data.tar.gz: d1b5c92de34cd8a88bef7b29901f0dfb21c06f34
5
5
  SHA512:
6
- metadata.gz: 098e35def3149126a9ce93ecd2436a2bd5cad8cc1b072d53130896d2c1ca6620c50d258529e5f647f263a949fa65af948b8527cc0bd0f127e13e4f5dab785133
7
- data.tar.gz: 43a1a954355e0d24010217fad43db346bf4bc60f37e987bc71d372937d89d2084da454a06eb5fdcdaec4fc44a04c9e3cdf95d100c974914d5e4516c296eca06c
6
+ metadata.gz: 3b3ebb7a4b46aefb505551db791cab6b6110354dfa1ddbb267d0be5817991b4a7d67db10a520650a9dc86796d99b70f7864851e38ea290634837a858d769634e
7
+ data.tar.gz: c28dff00835db307af21fef6a70c44f5d21e605272744df65cfcf2923ebf1a9214b2e9970486ee81201d0a4be50be5245ad652667a7772ab31b7b4d5c0f7d455
@@ -1,6 +1,7 @@
1
1
  module TestCentricity
2
2
  class Table < UIElement
3
3
  attr_accessor :table_body
4
+ attr_accessor :table_section
4
5
  attr_accessor :table_row
5
6
  attr_accessor :table_column
6
7
  attr_accessor :table_header
@@ -17,6 +18,7 @@ module TestCentricity
17
18
  @alt_locator = nil
18
19
 
19
20
  table_spec = { :table_body => 'tbody',
21
+ :table_section => nil,
20
22
  :table_row => 'tr',
21
23
  :table_column => 'td',
22
24
  :table_header => 'thead',
@@ -33,6 +35,8 @@ module TestCentricity
33
35
  case element
34
36
  when :table_body
35
37
  @table_body = value
38
+ when :table_section
39
+ @table_section = value
36
40
  when :table_row
37
41
  @table_row = value
38
42
  when :table_column
@@ -59,8 +63,11 @@ module TestCentricity
59
63
  #
60
64
  def get_row_count
61
65
  wait_until_exists(5)
62
- row_count = page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}", :visible => :all).count
63
- row_count
66
+ if @table_section.nil?
67
+ page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}", :visible => :all).count
68
+ else
69
+ page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_section}", :visible => :all).count
70
+ end
64
71
  end
65
72
 
66
73
  # Return number of columns in a table object.
@@ -74,9 +81,15 @@ module TestCentricity
74
81
  if row_count == 0
75
82
  page.all(:xpath, "#{@locator}/#{@table_header}/#{@header_row}/#{@header_column}", :visible => :all).count
76
83
  else
77
- (row_count == 1) ?
78
- page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}/#{@table_column}", :visible => :all).count :
79
- page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}[2]/#{@table_column}", :visible => :all).count
84
+ if @table_section.nil?
85
+ (row_count == 1) ?
86
+ page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}/#{@table_column}", :visible => :all).count :
87
+ page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_row}[2]/#{@table_column}", :visible => :all).count
88
+ else
89
+ (row_count == 1) ?
90
+ page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_section}/#{@table_row}/#{@table_column}", :visible => :all).count :
91
+ page.all(:xpath, "#{@locator}/#{@table_body}/#{@table_section}[2]/#{@table_row}/#{@table_column}", :visible => :all).count
92
+ end
80
93
  end
81
94
  end
82
95
 
@@ -366,8 +379,13 @@ module TestCentricity
366
379
  private
367
380
 
368
381
  def set_table_cell_locator(row, column)
369
- row_spec = "#{@locator}/#{@table_body}/#{@table_row}"
370
- row_spec = "#{row_spec}[#{row}]" if row > 1
382
+ if @table_section.nil?
383
+ row_spec = "#{@locator}/#{@table_body}/#{@table_row}"
384
+ row_spec = "#{row_spec}[#{row}]" if row > 1
385
+ else
386
+ row_spec = "#{@locator}/#{@table_body}/#{@table_section}"
387
+ row_spec = "#{row_spec}[#{row}]/#{@table_row}"
388
+ end
371
389
  column_spec = "/#{@table_column}[#{column}]"
372
390
  set_alt_locator("#{row_spec}#{column_spec}")
373
391
  end
@@ -197,23 +197,12 @@ module TestCentricity
197
197
  # navigation_toolbar.visible?
198
198
  #
199
199
  def visible?
200
- section, type = find_section
200
+ section, _ = find_section
201
201
  exists = section
202
- invisible = false
203
- if type == :css
204
- Capybara.using_wait_time 0.1 do
205
- # is section itself hidden with .ui-helper-hidden class?
206
- self_hidden = page.has_css?("#{@locator}.ui-helper-hidden")
207
- # is parent of section hidden, thus hiding the section?
208
- parent_hidden = page.has_css?(".ui-helper-hidden > #{@locator}")
209
- # is grandparent of section, or any other ancestor, hidden?
210
- other_ancestor_hidden = page.has_css?(".ui-helper-hidden * #{@locator}")
211
- # if any of the above conditions are true, then section is invisible
212
- invisible = self_hidden || parent_hidden || other_ancestor_hidden
213
- end
214
- end
202
+ visible = false
203
+ visible = section.visible? if exists
215
204
  # the section is visible if it exists and it is not invisible
216
- (exists && !invisible) ? true : false
205
+ (exists && visible) ? true : false
217
206
  end
218
207
 
219
208
  # Is Section object hidden (not visible)?
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.9.3.4'
2
+ VERSION = '0.9.4'
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.3.4
4
+ version: 0.9.4
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-01 00:00:00.000000000 Z
11
+ date: 2016-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler