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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88aac8ff177862c420a604d05088035cfe759e54
4
- data.tar.gz: 83d0ad7b44a60bb8b3230d463309252a46d207c5
3
+ metadata.gz: de72c9bf4cb0eddae2d54bb3460fe4234e6deeac
4
+ data.tar.gz: a9e5c733bb3d273f476916be6812ac16409831d4
5
5
  SHA512:
6
- metadata.gz: b6561b0d268afc55d7dfd5bd5f81b5a6fddee63f7ffd0e5a4e634e49ecec44d4a88bc257f588ea33fc4e5dbc7ffb8e036dd5958f93a7cae749cfe67eedf72539
7
- data.tar.gz: 8e9225df1d4654498baabbd02c191d0ebca13051029a0eeb8aa1798d8d3c5e4dc8bcba81f51f50d455a368152eee3f9363a53a5a38de22935ccb56c6c5a0bc49
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 = { :list_item => 'option',
13
- :selected_item => 'option[selected]'
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)
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.9.5.1'
2
+ VERSION = '0.9.6'
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.5.1
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-10 00:00:00.000000000 Z
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