testcentricity_web 3.1.9.1 → 3.1.10

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
- SHA1:
3
- metadata.gz: 0aa462700319d15dd5ec30a29c0564f0c5ccd26b
4
- data.tar.gz: 1179408ace53fcc2ae979f0b721939fd1b206688
2
+ SHA256:
3
+ metadata.gz: 4b9a9ddffbe8fb506daa3b228151e8b73d79f880ed4f836d33570ce90a20b6b1
4
+ data.tar.gz: 9ecaec237bb61bf11bc7b9a84ae34bfee3a3449c4452f058d7f3750ca48f5884
5
5
  SHA512:
6
- metadata.gz: 172fececba5da529d91bae0eef3e86b6adbd1c1319bda3f7dd292308f12a1a504f2865325e20ad41f8eba0179d1e19db7e6068a40f5075924dabdf39a1d30e18
7
- data.tar.gz: b34e10f749d0704245a8cfc9fdaaa534877606ef2016110284219a99a65408bad072770972d00200501af649b09eb4c22db372b802cec5bf77929a1078eb764f
6
+ metadata.gz: 8623d9b8f498bd78ade6b4ccbf749a5f094643e120be9f34094d496dfca684d9a251446a3dcc3922e4bc924fa0c0c2ea8086e1196850c8543ba32f924f6f3358
7
+ data.tar.gz: 84b61d66ec403bf9f7a41c66951824c976f845b990cf36495a219f338ba6ea28ebaf864a59fd69cfaf476338f72330f60eb4b5974143c5aa6fe740ae0dbc324e
@@ -2,6 +2,12 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [3.1.10] - 2019-05-21
6
+
7
+ ### Fixed
8
+ * Improved compatibility with React and Chosen select lists.
9
+
10
+
5
11
  ## [3.1.9] - 2019-05-16
6
12
 
7
13
  ### Added
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (3.1.8.1)
4
+ testcentricity_web (3.1.10)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
@@ -25,7 +25,7 @@ GEM
25
25
  appium_lib_core (~> 3.1)
26
26
  nokogiri (~> 1.8, >= 1.8.1)
27
27
  tomlrb (~> 1.1)
28
- appium_lib_core (3.1.1)
28
+ appium_lib_core (3.1.2)
29
29
  faye-websocket (~> 0.10.0)
30
30
  selenium-webdriver (~> 3.14, >= 3.14.1)
31
31
  axiom-types (0.1.1)
@@ -33,7 +33,7 @@ GEM
33
33
  ice_nine (~> 0.11.0)
34
34
  thread_safe (~> 0.3, >= 0.3.1)
35
35
  browserstack-local (1.3.0)
36
- capybara (3.18.0)
36
+ capybara (3.20.2)
37
37
  addressable
38
38
  mini_mime (>= 0.1.3)
39
39
  nokogiri (~> 1.8)
@@ -56,7 +56,7 @@ GEM
56
56
  faye-websocket (0.10.7)
57
57
  eventmachine (>= 0.12.0)
58
58
  websocket-driver (>= 0.5.1)
59
- ffi (1.10.0)
59
+ ffi (1.11.1)
60
60
  i18n (1.6.0)
61
61
  concurrent-ruby (~> 1.0)
62
62
  ice_nine (0.11.2)
@@ -72,15 +72,15 @@ GEM
72
72
  rack (>= 1.0, < 3)
73
73
  rake (12.3.2)
74
74
  redcarpet (3.4.0)
75
- regexp_parser (1.4.0)
75
+ regexp_parser (1.5.0)
76
76
  ruby-ole (1.2.12.2)
77
77
  rubyzip (1.2.2)
78
- selenium-webdriver (3.142.1)
78
+ selenium-webdriver (3.142.3)
79
79
  childprocess (>= 0.5, < 2.0)
80
80
  rubyzip (~> 1.2, >= 1.2.2)
81
81
  spreadsheet (1.1.7)
82
82
  ruby-ole (>= 1.0)
83
- test-unit (3.3.2)
83
+ test-unit (3.3.3)
84
84
  power_assert
85
85
  thread_safe (0.3.6)
86
86
  tomlrb (1.2.8)
@@ -89,7 +89,7 @@ GEM
89
89
  coercible (~> 1.0)
90
90
  descendants_tracker (~> 0.0, >= 0.0.3)
91
91
  equalizer (~> 0.0, >= 0.0.9)
92
- webdrivers (3.9.0)
92
+ webdrivers (3.9.4)
93
93
  nokogiri (~> 1.6)
94
94
  rubyzip (~> 1.0)
95
95
  selenium-webdriver (~> 3.0)
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.1.9.1'
2
+ VERSION = '3.1.10'
3
3
  end
@@ -5,6 +5,7 @@ module TestCentricity
5
5
  attr_accessor :list_trigger
6
6
  attr_accessor :text_field
7
7
  attr_accessor :options_list
8
+ attr_accessor :base_object
8
9
 
9
10
  def initialize(name, parent, locator, context)
10
11
  super
@@ -52,13 +53,13 @@ module TestCentricity
52
53
  # state_select.choose_option(text: 'Maryland')
53
54
  #
54
55
  def choose_option(option)
55
- obj, = find_element
56
- object_not_found_exception(obj, nil)
56
+ @base_object, = find_element
57
+ object_not_found_exception(@base_object, nil)
57
58
 
58
- unless @list_trigger.nil? && @options_list.nil?
59
- obj.find(:css, @list_trigger).click
60
- menu = obj.find(:css, @options_list, minimum: 0, wait: 2)
61
- object_not_found_exception(menu, nil)
59
+ trigger_list
60
+
61
+ unless @options_list.nil?
62
+ find_component(@options_list, 'drop menu')
62
63
  raise "Could not find option #{option} to choose" unless first(:css, @list_item, minimum: 0, wait: 2)
63
64
 
64
65
  if option.is_a?(Array)
@@ -71,7 +72,7 @@ module TestCentricity
71
72
  page.find(:css, "#{@list_item}:nth-of-type(#{option[:value]})").click if option.key?(:value)
72
73
  page.find(:css, "#{@list_item}:nth-of-type(#{option[:text]})").click if option.key?(:text)
73
74
  else
74
- options = obj.all(@list_item).collect(&:text)
75
+ options = @base_object.all(@list_item).collect(&:text)
75
76
  sleep(2) unless options.include?(option)
76
77
  first(:css, @list_item, text: option).click
77
78
  end
@@ -79,13 +80,6 @@ module TestCentricity
79
80
  return
80
81
  end
81
82
 
82
- if @list_trigger.nil?
83
- obj.click
84
- else
85
- page.find(:css, @list_trigger).click
86
- sleep(1)
87
- end
88
-
89
83
  if first(:css, @list_item, minimum: 0, wait: 2)
90
84
  if option.is_a?(Array)
91
85
  option.each do |item|
@@ -97,7 +91,7 @@ module TestCentricity
97
91
  page.find(:css, "#{@list_item}:nth-of-type(#{option[:value]})").click if option.key?(:value)
98
92
  page.find(:css, "#{@list_item}:nth-of-type(#{option[:text]})").click if option.key?(:text)
99
93
  else
100
- options = obj.all(@list_item).collect(&:text)
94
+ options = @base_object.all(@list_item).collect(&:text)
101
95
  sleep(2) unless options.include?(option)
102
96
  first(:css, @list_item, text: option).click
103
97
  end
@@ -105,25 +99,20 @@ module TestCentricity
105
99
  else
106
100
  if option.is_a?(Array)
107
101
  option.each do |item|
108
- select_item(obj, item)
102
+ select_item(@base_object, item)
109
103
  end
110
104
  else
111
- select_item(obj, option)
105
+ select_item(@base_object, option)
112
106
  end
113
107
  end
114
108
  end
115
109
 
116
110
  def set(text)
117
- if @text_field.nil?
118
- raise "A 'text_field' list element must be defined before calling the 'set' method on a selectlist object"
119
- end
120
- obj, = find_element
121
- object_not_found_exception(obj, nil)
122
- if @list_trigger.nil?
123
- obj.click
124
- else
125
- page.find(:css, @list_trigger).click
126
- end
111
+ raise "A 'text_field' list element must be defined before calling the 'set' method on a selectlist object" if @text_field.nil?
112
+ @base_object, = find_element
113
+ object_not_found_exception(@base_object, nil)
114
+ trigger_list
115
+
127
116
  page.find(:css, @text_field, wait: 2).set(text)
128
117
  end
129
118
 
@@ -135,20 +124,19 @@ module TestCentricity
135
124
  # all_colors = color_select.get_options
136
125
  #
137
126
  def get_options
138
- obj, = find_element
139
- object_not_found_exception(obj, nil)
140
- if @list_trigger.nil? && @options_list.nil?
141
- if obj.first(:css, @list_item, minimum: 0, wait: 2)
142
- obj.all(@list_item).collect(&:text)
127
+ @base_object, = find_element
128
+ object_not_found_exception(@base_object, nil)
129
+ if @options_list.nil?
130
+ if @base_object.first(:css, @list_item, minimum: 0, wait: 2)
131
+ @base_object.all(@list_item).collect(&:text)
143
132
  else
144
- obj.all('option', visible: :all).collect(&:text)
133
+ @base_object.all('option', visible: :all).collect(&:text)
145
134
  end
146
135
  else
147
- obj.find(:css, @list_trigger).click
148
- menu = obj.find(:css, @options_list, minimum: 0, wait: 2)
149
- object_not_found_exception(menu, nil)
136
+ trigger_list
137
+ menu = find_component(@options_list, 'drop menu')
150
138
  options = menu.all(@list_item, visible: true, minimum: 0, wait: 2).collect(&:text)
151
- obj.find(:css, @list_trigger).click
139
+ trigger_list
152
140
  options
153
141
  end
154
142
  end
@@ -163,20 +151,19 @@ module TestCentricity
163
151
  # num_colors = color_select.get_option_count
164
152
  #
165
153
  def get_option_count
166
- obj, = find_element
167
- object_not_found_exception(obj, nil)
168
- if @list_trigger.nil? && @options_list.nil?
169
- if obj.first(:css, @list_item, minimum: 0, wait: 2)
170
- obj.all(@list_item).count
154
+ @base_object, = find_element
155
+ object_not_found_exception(@base_object, nil)
156
+ if @options_list.nil?
157
+ if @base_object.first(:css, @list_item, minimum: 0, wait: 2)
158
+ @base_object.all(@list_item).count
171
159
  else
172
- obj.all('option', visible: :all).count
160
+ @base_object.all('option', visible: :all).count
173
161
  end
174
162
  else
175
- obj.find(:css, @list_trigger).click
176
- menu = obj.find(:css, @options_list, minimum: 0, wait: 2)
177
- object_not_found_exception(menu, nil)
163
+ trigger_list
164
+ menu = find_component(@options_list, 'drop menu')
178
165
  num_items = menu.all(@list_item, visible: true, minimum: 0, wait: 2).count
179
- obj.find(:css, @list_trigger).click
166
+ trigger_list
180
167
  num_items
181
168
  end
182
169
  end
@@ -200,14 +187,14 @@ module TestCentricity
200
187
  # current_color = color_select.get_selected_option
201
188
  #
202
189
  def get_selected_option
203
- obj, = find_element
204
- object_not_found_exception(obj, nil)
205
- if obj.first(:css, @list_item, minimum: 0)
206
- obj.first(:css, @selected_item).text
207
- elsif obj.first(:css, @selected_item, minimum: 0)
208
- obj.first(:css, @selected_item).text
190
+ @base_object, = find_element
191
+ object_not_found_exception(@base_object, nil)
192
+ if @base_object.first(:css, @list_item, minimum: 0)
193
+ @base_object.first(:css, @selected_item).text
194
+ elsif @base_object.first(:css, @selected_item, minimum: 0)
195
+ @base_object.first(:css, @selected_item).text
209
196
  else
210
- obj.first('option[selected]', visible: :all).text
197
+ @base_object.first('option[selected]', visible: :all).text
211
198
  end
212
199
  end
213
200
 
@@ -235,8 +222,8 @@ module TestCentricity
235
222
  invoke_siebel_popup
236
223
  sleep(0.5)
237
224
  options = page.all(:xpath, "//li[@class='ui-menu-item']").collect(&:text)
238
- obj, = find_element
239
- obj.native.send_keys(:escape)
225
+ @base_object, = find_element
226
+ @base_object.native.send_keys(:escape)
240
227
  options
241
228
  end
242
229
 
@@ -249,8 +236,8 @@ module TestCentricity
249
236
  else
250
237
  assert_equal(expected, actual, "Expected list of options in list #{object_ref_message} to be #{expected} but found #{actual}")
251
238
  end
252
- obj, = find_element
253
- obj.native.send_keys(:escape)
239
+ @base_object, = find_element
240
+ @base_object.native.send_keys(:escape)
254
241
  end
255
242
 
256
243
  # Is Siebel JComboBox set to read-only?
@@ -260,9 +247,9 @@ module TestCentricity
260
247
  # country_select.read_only?
261
248
  #
262
249
  def read_only?
263
- obj, = find_element
264
- object_not_found_exception(obj, nil)
265
- !obj.native.attribute('readonly')
250
+ @base_object, = find_element
251
+ object_not_found_exception(@base_object, nil)
252
+ !@base_object.native.attribute('readonly')
266
253
  end
267
254
 
268
255
  private
@@ -284,5 +271,27 @@ module TestCentricity
284
271
  obj.select(option, visible: :all)
285
272
  end
286
273
  end
274
+
275
+ def trigger_list
276
+ if @list_trigger.nil?
277
+ @base_object.click
278
+ else
279
+ trigger = find_component(@list_trigger, 'trigger')
280
+ trigger.click
281
+ end
282
+ end
283
+
284
+ def find_component(component, component_name)
285
+ begin
286
+ element = @base_object.find(:css, component, minimum: 0, wait: 1)
287
+ rescue
288
+ begin
289
+ element = page.find(:css, component, minimum: 0, wait: 1)
290
+ rescue
291
+ raise "List #{component_name} (#{component}) for selectlist named '#{@name}' (#{locator}) not found"
292
+ end
293
+ end
294
+ element
295
+ end
287
296
  end
288
297
  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: 3.1.9.1
4
+ version: 3.1.10
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: 2019-05-15 00:00:00.000000000 Z
11
+ date: 2019-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -325,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
325
  requirements:
326
326
  - Capybara, Selenium-WebDriver
327
327
  rubyforge_project:
328
- rubygems_version: 2.6.14
328
+ rubygems_version: 2.7.9
329
329
  signing_key:
330
330
  specification_version: 4
331
331
  summary: A Page Object and Data Object Model Framework for desktop and mobile web