testcentricity_web 2.0.14 → 2.0.15
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/lib/testcentricity_web/page_sections_helper.rb +54 -26
- 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: 79ac6acd9e66f7fabdd0f638a313701152dde97d
|
4
|
+
data.tar.gz: 6f4358684c4e9a919162d3d83ef7180a7032a59a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a776a8fa933be0c746a5858dd89d0788f35c68aff2d3cf9935a8342c71bd396b736a81a253be35caf0a588cf1f1af8d77cca55c533419122b491386d1ab0bcf
|
7
|
+
data.tar.gz: d4928cb6be15d9c65a66e2d86898ec3436c95a2fd0dfdca38c1855af79377d0c26e263e5457ee8fff727d4484c0a5adf87b698ec5f31e69eb578b061d4eb48f9
|
@@ -6,20 +6,69 @@ module TestCentricity
|
|
6
6
|
include Capybara::Node::Matchers
|
7
7
|
include Test::Unit::Assertions
|
8
8
|
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :context, :name
|
10
|
+
attr_accessor :locator
|
10
11
|
attr_accessor :parent
|
12
|
+
attr_accessor :parent_list
|
13
|
+
attr_accessor :list_index
|
14
|
+
|
11
15
|
|
12
16
|
def initialize(name, parent, locator, context)
|
13
|
-
@name
|
14
|
-
@parent
|
15
|
-
@locator
|
16
|
-
@context
|
17
|
+
@name = name
|
18
|
+
@parent = parent
|
19
|
+
@locator = locator
|
20
|
+
@context = context
|
21
|
+
@parent_list = nil
|
22
|
+
@list_index = nil
|
23
|
+
end
|
24
|
+
|
25
|
+
def get_locator
|
26
|
+
if @locator.empty? && defined?(section_locator)
|
27
|
+
locator = section_locator
|
28
|
+
else
|
29
|
+
locator = @locator
|
30
|
+
end
|
31
|
+
|
32
|
+
unless @parent_list.nil?
|
33
|
+
locator = "#{@parent_list.get_locator}|#{locator}"
|
34
|
+
unless @list_index.nil?
|
35
|
+
if locator.include?('/')
|
36
|
+
locator = "(#{locator})[#{@list_index}]"
|
37
|
+
else
|
38
|
+
locator = "#{locator}:nth-of-type(#{@list_index})"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
if @context == :section && !@parent.nil? && !@parent.get_locator.nil?
|
44
|
+
"#{@parent.get_locator}|#{locator}"
|
45
|
+
else
|
46
|
+
locator
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def set_list_index(list, index = 1)
|
51
|
+
@parent_list = list unless list.nil?
|
52
|
+
@list_index = index
|
53
|
+
end
|
54
|
+
|
55
|
+
def get_item_count
|
56
|
+
raise 'No parent list defined' if @parent_list.nil?
|
57
|
+
@parent_list.get_item_count
|
17
58
|
end
|
18
59
|
|
19
60
|
def get_object_type
|
20
61
|
:section
|
21
62
|
end
|
22
63
|
|
64
|
+
def get_name
|
65
|
+
@name
|
66
|
+
end
|
67
|
+
|
68
|
+
def set_parent(parent)
|
69
|
+
@parent = parent
|
70
|
+
end
|
71
|
+
|
23
72
|
# Define a trait for this page section.
|
24
73
|
#
|
25
74
|
# @param trait_name [Symbol] name of trait (as a symbol)
|
@@ -385,27 +434,6 @@ module TestCentricity
|
|
385
434
|
end
|
386
435
|
end
|
387
436
|
|
388
|
-
def get_locator
|
389
|
-
if @locator.empty? && defined?(section_locator)
|
390
|
-
locator = section_locator
|
391
|
-
else
|
392
|
-
locator = @locator
|
393
|
-
end
|
394
|
-
if @context == :section && !@parent.nil? && !@parent.get_locator.nil?
|
395
|
-
"#{@parent.get_locator}|#{locator}"
|
396
|
-
else
|
397
|
-
locator
|
398
|
-
end
|
399
|
-
end
|
400
|
-
|
401
|
-
def get_name
|
402
|
-
@name
|
403
|
-
end
|
404
|
-
|
405
|
-
def set_parent(parent)
|
406
|
-
@parent = parent
|
407
|
-
end
|
408
|
-
|
409
437
|
# Does Section object exists?
|
410
438
|
#
|
411
439
|
# @return [Boolean]
|
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: 2.0.
|
4
|
+
version: 2.0.15
|
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: 2017-
|
11
|
+
date: 2017-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|