testcentricity_web 0.9.3.4 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d8a0d27bc5858321d080844be1c2cdac9be8f0f
|
4
|
+
data.tar.gz: d1b5c92de34cd8a88bef7b29901f0dfb21c06f34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
63
|
-
|
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
|
-
|
78
|
-
|
79
|
-
|
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
|
-
|
370
|
-
|
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,
|
200
|
+
section, _ = find_section
|
201
201
|
exists = section
|
202
|
-
|
203
|
-
|
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 &&
|
205
|
+
(exists && visible) ? true : false
|
217
206
|
end
|
218
207
|
|
219
208
|
# Is Section 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: 0.9.
|
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-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|