testcentricity_web 0.9.5.1 → 0.9.6
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/elements/list.rb +30 -0
- data/lib/testcentricity_web/elements/select_list.rb +3 -2
- data/lib/testcentricity_web/page_objects_helper.rb +11 -0
- data/lib/testcentricity_web/page_sections_helper.rb +11 -0
- data/lib/testcentricity_web/ui_elements_helper.rb +0 -6
- data/lib/testcentricity_web/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de72c9bf4cb0eddae2d54bb3460fe4234e6deeac
|
4
|
+
data.tar.gz: a9e5c733bb3d273f476916be6812ac16409831d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaf809f700a5df12932729500effe4f0deec80499fd86406070a6c5e9c31740c7554a6a3188a9e37c9ccd2d297641dfb9fc3463e7e54bfe055f81597a56e4988
|
7
|
+
data.tar.gz: b230674790a1cc946126068b10f2970f84ccd8f30ef0a438bd4a51b5bb254475671c14132f4d6ce72381918c45f788370eb14dfe476ead385fc062ec35312bb1
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module TestCentricity
|
2
|
+
class List < UIElement
|
3
|
+
attr_accessor :list_item
|
4
|
+
|
5
|
+
def initialize(parent, locator, context)
|
6
|
+
@parent = parent
|
7
|
+
@locator = locator
|
8
|
+
@context = context
|
9
|
+
@type = :list
|
10
|
+
@alt_locator = nil
|
11
|
+
list_spec = { :list_item => 'li' }
|
12
|
+
define_list_elements(list_spec)
|
13
|
+
end
|
14
|
+
|
15
|
+
def define_list_elements(element_spec)
|
16
|
+
element_spec.each do | element, value |
|
17
|
+
case element
|
18
|
+
when :list_item
|
19
|
+
@list_item = value
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_list_items
|
25
|
+
obj, _ = find_element
|
26
|
+
object_not_found_exception(obj, nil)
|
27
|
+
obj.all(@list_item).collect(&:text)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -9,8 +9,9 @@ module TestCentricity
|
|
9
9
|
@context = context
|
10
10
|
@type = :selectlist
|
11
11
|
@alt_locator = nil
|
12
|
-
list_spec = {
|
13
|
-
|
12
|
+
list_spec = {
|
13
|
+
:list_item => 'option',
|
14
|
+
:selected_item => 'option[selected]'
|
14
15
|
}
|
15
16
|
define_list_elements(list_spec)
|
16
17
|
end
|
@@ -128,6 +128,17 @@ module TestCentricity
|
|
128
128
|
class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::SelectList.new(self, "#{locator}", :page);end))
|
129
129
|
end
|
130
130
|
|
131
|
+
# Declare and instantiate a list UI Element for this page object.
|
132
|
+
#
|
133
|
+
# @param element_name [Symbol] name of list object (as a symbol)
|
134
|
+
# @param locator [String] CSS selector or XPath expression that uniquely identifies object
|
135
|
+
# @example
|
136
|
+
# list :x_axis_list, "g.x-axis"
|
137
|
+
#
|
138
|
+
def self.list(element_name, locator)
|
139
|
+
class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::List.new(self, "#{locator}", :page);end))
|
140
|
+
end
|
141
|
+
|
131
142
|
# Declare and instantiate an image UI Element for this page object.
|
132
143
|
#
|
133
144
|
# @param element_name [Symbol] name of image object (as a symbol)
|
@@ -136,6 +136,17 @@ module TestCentricity
|
|
136
136
|
class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::SelectList.new(self, "#{locator}", :section);end))
|
137
137
|
end
|
138
138
|
|
139
|
+
# Declare and instantiate a list UI Element for this page section.
|
140
|
+
#
|
141
|
+
# @param element_name [Symbol] name of list object (as a symbol)
|
142
|
+
# @param locator [String] CSS selector or XPath expression that uniquely identifies object
|
143
|
+
# @example
|
144
|
+
# list :y_axis_list, 'g.y_axis'
|
145
|
+
#
|
146
|
+
def self.list(element_name, locator)
|
147
|
+
class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::List.new(self, "#{locator}", :section);end))
|
148
|
+
end
|
149
|
+
|
139
150
|
# Declare and instantiate an image UI Element for this page section.
|
140
151
|
#
|
141
152
|
# @param element_name [Symbol] name of image object (as a symbol)
|
@@ -289,12 +289,6 @@ module TestCentricity
|
|
289
289
|
obj.drag_by(right_offset, down_offset)
|
290
290
|
end
|
291
291
|
|
292
|
-
def get_list_items(item_locator)
|
293
|
-
obj, _ = find_element
|
294
|
-
object_not_found_exception(obj, nil)
|
295
|
-
obj.all(item_locator).collect(&:text)
|
296
|
-
end
|
297
|
-
|
298
292
|
def get_attribute(attrib)
|
299
293
|
obj, _ = find_element
|
300
294
|
object_not_found_exception(obj, nil)
|
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.6
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- lib/testcentricity_web/elements/image.rb
|
179
179
|
- lib/testcentricity_web/elements/label.rb
|
180
180
|
- lib/testcentricity_web/elements/link.rb
|
181
|
+
- lib/testcentricity_web/elements/list.rb
|
181
182
|
- lib/testcentricity_web/elements/radio.rb
|
182
183
|
- lib/testcentricity_web/elements/select_list.rb
|
183
184
|
- lib/testcentricity_web/elements/table.rb
|