testcentricity_web 2.4.1 → 2.4.2

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: d29e1e8e3fac5281f1f3eb97e805c10d8497dce8
4
- data.tar.gz: ca28f2999a6cf31c52e704917d95d87f326bac38
3
+ metadata.gz: ec8a7e796c363620c3b5ccee97a2d640962d8aeb
4
+ data.tar.gz: 943b82edd213a076eef244387198686f6091f164
5
5
  SHA512:
6
- metadata.gz: 3eb40cdbba7deac768a7237c3f3f30161022f944b2aa9321a67f1ba37d7004bb701c1cbc4221531bda9a8a5ce8cd28bdbf797bb112dd8400463318fc0c4dbd53
7
- data.tar.gz: 68069a7ef31a76ff479109b352166993c4ecbbb1668b795730696ed97b3a8c879d4cd32c504282e1e5f508b4fd8914e7da19a7ff1bbc90c79735c4fc991195fd
6
+ metadata.gz: 35e4a72b1a22b01e43fccce613757bcd8521a71fa543334a7510d131c59bf54448341b857ce3f5fa83edb50ee623f0cd3d170fa99a7efcd898838b787cccca24
7
+ data.tar.gz: 137ca256bb70325b36640edfb0d8c4368032e899b2bb6d9a1a764da101e1d01fa2cbbfc89855ea5d2f7643eb41abedbb0f3345be52aa50f1e318fe88e4d7bbce
data/README.md CHANGED
@@ -924,6 +924,7 @@ the `WEB_BROWSER` Environment Variable must be set to one of the values from the
924
924
  `ipad_pro_10_5` |`chrome` |1112 x 834 |landscape |iOS 11
925
925
  `ipad_chrome` |`chrome` |1024 x 768 |landscape |iOS 10 - Mobile Chrome browser for iOS
926
926
  `ipad_firefox` |`chrome` |1024 x 768 |landscape |iOS 10 - Mobile Firefox browser for iOS
927
+ `ipad_edge` |`chrome` |1024 x 768 |landscape |iOS 10 - Mobile Edge browser for iOS
927
928
  `android_tablet` |`chrome` |1024 x 768 |landscape |Android 3.0
928
929
  `kindle_fire` |`chrome` |1024 x 600 |landscape |
929
930
  `kindle_firehd7` |`chrome` |800 x 480 |landscape |Fire OS 3
@@ -1225,6 +1226,7 @@ service(s) that you intend to connect with.
1225
1226
  ipad_pro_10_5: WEB_BROWSER=ipad_pro_10_5 HOST_BROWSER=chrome <%= mobile %>
1226
1227
  ipad_chrome: WEB_BROWSER=ipad_chrome HOST_BROWSER=chrome <%= mobile %>
1227
1228
  ipad_firefox: WEB_BROWSER=ipad_firefox HOST_BROWSER=chrome <%= mobile %>
1229
+ ipad_edge: WEB_BROWSER=ipad_edge HOST_BROWSER=chrome <%= mobile %>
1228
1230
  iphone: WEB_BROWSER=iphone HOST_BROWSER=chrome <%= mobile %>
1229
1231
  iphone4: WEB_BROWSER=iphone4 HOST_BROWSER=chrome <%= mobile %>
1230
1232
  iphone5: WEB_BROWSER=iphone5 HOST_BROWSER=chrome <%= mobile %>
@@ -28,12 +28,7 @@ module TestCentricity
28
28
  # element :siebel_busy, "//html[contains(@class, 'siebui-busy')]"
29
29
  #
30
30
  def self.element(element_name, locator)
31
- define_method(element_name) do
32
- ivar_name = "@#{element_name}"
33
- ivar = instance_variable_get(ivar_name)
34
- return ivar if ivar
35
- instance_variable_set(ivar_name, TestCentricity::UIElement.new(element_name, self, locator, :page))
36
- end
31
+ define_page_element(element_name, TestCentricity::UIElement, locator)
37
32
  end
38
33
 
39
34
  # Declare and instantiate a collection of generic UI Elements for this page object.
@@ -59,12 +54,7 @@ module TestCentricity
59
54
  # button :login_button, "//input[@id='submit_button']"
60
55
  #
61
56
  def self.button(element_name, locator)
62
- define_method(element_name) do
63
- ivar_name = "@#{element_name}"
64
- ivar = instance_variable_get(ivar_name)
65
- return ivar if ivar
66
- instance_variable_set(ivar_name, TestCentricity::Button.new(element_name, self, locator, :page))
67
- end
57
+ define_page_element(element_name, TestCentricity::Button, locator)
68
58
  end
69
59
 
70
60
  # Declare and instantiate a collection of buttons for this page object.
@@ -90,12 +80,7 @@ module TestCentricity
90
80
  # textfield :password_field, 'consumer_password'
91
81
  #
92
82
  def self.textfield(element_name, locator)
93
- define_method(element_name) do
94
- ivar_name = "@#{element_name}"
95
- ivar = instance_variable_get(ivar_name)
96
- return ivar if ivar
97
- instance_variable_set(ivar_name, TestCentricity::TextField.new(element_name, self, locator, :page))
98
- end
83
+ define_page_element(element_name, TestCentricity::TextField, locator)
99
84
  end
100
85
 
101
86
  # Declare and instantiate a collection of text fields for this page object.
@@ -179,12 +164,7 @@ module TestCentricity
179
164
  # label :rollup_price_label, "//div[contains(@id, 'Rollup Item Price')]"
180
165
  #
181
166
  def self.label(element_name, locator)
182
- define_method(element_name) do
183
- ivar_name = "@#{element_name}"
184
- ivar = instance_variable_get(ivar_name)
185
- return ivar if ivar
186
- instance_variable_set(ivar_name, TestCentricity::Label.new(element_name, self, locator, :page))
187
- end
167
+ define_page_element(element_name, TestCentricity::Label, locator)
188
168
  end
189
169
 
190
170
  def self.labels(element_hash)
@@ -202,12 +182,7 @@ module TestCentricity
202
182
  # link :shopping_basket_link, "//a[@href='shopping_basket']"
203
183
  #
204
184
  def self.link(element_name, locator)
205
- define_method(element_name) do
206
- ivar_name = "@#{element_name}"
207
- ivar = instance_variable_get(ivar_name)
208
- return ivar if ivar
209
- instance_variable_set(ivar_name, TestCentricity::Link.new(element_name, self, locator, :page))
210
- end
185
+ define_page_element(element_name, TestCentricity::Link, locator)
211
186
  end
212
187
 
213
188
  def self.links(element_hash)
@@ -224,12 +199,7 @@ module TestCentricity
224
199
  # table :payments_table, "//table[@class='payments_table']"
225
200
  #
226
201
  def self.table(element_name, locator)
227
- define_method(element_name) do
228
- ivar_name = "@#{element_name}"
229
- ivar = instance_variable_get(ivar_name)
230
- return ivar if ivar
231
- instance_variable_set(ivar_name, TestCentricity::Table.new(element_name, self, locator, :page))
232
- end
202
+ define_page_element(element_name, TestCentricity::Table, locator)
233
203
  end
234
204
 
235
205
  def self.tables(element_hash)
@@ -247,12 +217,7 @@ module TestCentricity
247
217
  # selectlist :gender_select, "//select[@id='customer_gender']"
248
218
  #
249
219
  def self.selectlist(element_name, locator)
250
- define_method(element_name) do
251
- ivar_name = "@#{element_name}"
252
- ivar = instance_variable_get(ivar_name)
253
- return ivar if ivar
254
- instance_variable_set(ivar_name, TestCentricity::SelectList.new(element_name, self, locator, :page))
255
- end
220
+ define_page_element(element_name, TestCentricity::SelectList, locator)
256
221
  end
257
222
 
258
223
  def self.selectlists(element_hash)
@@ -269,12 +234,7 @@ module TestCentricity
269
234
  # list :x_axis_list, 'g.x-axis'
270
235
  #
271
236
  def self.list(element_name, locator)
272
- define_method(element_name) do
273
- ivar_name = "@#{element_name}"
274
- ivar = instance_variable_get(ivar_name)
275
- return ivar if ivar
276
- instance_variable_set(ivar_name, TestCentricity::List.new(element_name, self, locator, :page))
277
- end
237
+ define_page_element(element_name, TestCentricity::List, locator)
278
238
  end
279
239
 
280
240
  def self.lists(element_hash)
@@ -292,12 +252,7 @@ module TestCentricity
292
252
  # image :corporate_logo_image, "//img[@alt='MyCompany_logo']"
293
253
  #
294
254
  def self.image(element_name, locator)
295
- define_method(element_name) do
296
- ivar_name = "@#{element_name}"
297
- ivar = instance_variable_get(ivar_name)
298
- return ivar if ivar
299
- instance_variable_set(ivar_name, TestCentricity::Image.new(element_name, self, locator, :page))
300
- end
255
+ define_page_element(element_name, TestCentricity::Image, locator)
301
256
  end
302
257
 
303
258
  def self.images(element_hash)
@@ -314,12 +269,7 @@ module TestCentricity
314
269
  # filefield :attach_file, 's_SweFileName'
315
270
  #
316
271
  def self.filefield(element_name, locator)
317
- define_method(element_name) do
318
- ivar_name = "@#{element_name}"
319
- ivar = instance_variable_get(ivar_name)
320
- return ivar if ivar
321
- instance_variable_set(ivar_name, TestCentricity::FileField.new(element_name, self, locator, :page))
322
- end
272
+ define_page_element(element_name, TestCentricity::FileField, locator)
323
273
  end
324
274
 
325
275
  def self.filefields(element_hash)
@@ -426,8 +376,13 @@ module TestCentricity
426
376
  # @example
427
377
  # section :search_form, SearchForm
428
378
  #
429
- def self.section(section_name, class_name, locator = nil)
430
- class_eval(%(def #{section_name};@#{section_name} ||= #{class_name}.new("#{section_name}", self, "#{locator}", :page);end))
379
+ def self.section(section_name, obj, locator = nil)
380
+ define_method(section_name) do
381
+ ivar_name = "@#{section_name}"
382
+ ivar = instance_variable_get(ivar_name)
383
+ return ivar if ivar
384
+ instance_variable_set(ivar_name, obj.new(section_name, self, "#{locator}", :page))
385
+ end
431
386
  end
432
387
 
433
388
  def self.sections(section_hash)
@@ -707,5 +662,16 @@ module TestCentricity
707
662
  end
708
663
  end
709
664
  end
665
+
666
+ private
667
+
668
+ def self.define_page_element(element_name, obj, locator)
669
+ define_method(element_name) do
670
+ ivar_name = "@#{element_name}"
671
+ ivar = instance_variable_get(ivar_name)
672
+ return ivar if ivar
673
+ instance_variable_set(ivar_name, obj.new(element_name, self, locator, :page))
674
+ end
675
+ end
710
676
  end
711
677
  end
@@ -140,12 +140,7 @@ module TestCentricity
140
140
  # element :basket_header, 'div.basket_header'
141
141
  #
142
142
  def self.element(element_name, locator)
143
- define_method(element_name) do
144
- ivar_name = "@#{element_name}"
145
- ivar = instance_variable_get(ivar_name)
146
- return ivar if ivar
147
- instance_variable_set(ivar_name, TestCentricity::UIElement.new(element_name, self, locator, :section))
148
- end
143
+ define_element(element_name, TestCentricity::UIElement, locator)
149
144
  end
150
145
 
151
146
  # Declare and instantiate a collection of generic UI Elements for this page section.
@@ -171,12 +166,7 @@ module TestCentricity
171
166
  # button :login_button, "//input[@id='submit_button']"
172
167
  #
173
168
  def self.button(element_name, locator)
174
- define_method(element_name) do
175
- ivar_name = "@#{element_name}"
176
- ivar = instance_variable_get(ivar_name)
177
- return ivar if ivar
178
- instance_variable_set(ivar_name, TestCentricity::Button.new(element_name, self, locator, :section))
179
- end
169
+ define_element(element_name, TestCentricity::Button, locator)
180
170
  end
181
171
 
182
172
  # Declare and instantiate a collection of buttons for this page section.
@@ -202,12 +192,7 @@ module TestCentricity
202
192
  # textfield :password_field, 'input#consumer_password'
203
193
  #
204
194
  def self.textfield(element_name, locator)
205
- define_method(element_name) do
206
- ivar_name = "@#{element_name}"
207
- ivar = instance_variable_get(ivar_name)
208
- return ivar if ivar
209
- instance_variable_set(ivar_name, TestCentricity::TextField.new(element_name, self, locator, :section))
210
- end
195
+ define_element(element_name, TestCentricity::TextField, locator)
211
196
  end
212
197
 
213
198
  # Declare and instantiate a collection of text fields for this page section.
@@ -291,12 +276,7 @@ module TestCentricity
291
276
  # label :rollup_price_label, "//div[contains(@id, 'Rollup Item Price')]"
292
277
  #
293
278
  def self.label(element_name, locator)
294
- define_method(element_name) do
295
- ivar_name = "@#{element_name}"
296
- ivar = instance_variable_get(ivar_name)
297
- return ivar if ivar
298
- instance_variable_set(ivar_name, TestCentricity::Label.new(element_name, self, locator, :section))
299
- end
279
+ define_element(element_name, TestCentricity::Label, locator)
300
280
  end
301
281
 
302
282
  def self.labels(element_hash)
@@ -314,12 +294,7 @@ module TestCentricity
314
294
  # link :shopping_basket_link, "//a[@href='shopping_basket']"
315
295
  #
316
296
  def self.link(element_name, locator)
317
- define_method(element_name) do
318
- ivar_name = "@#{element_name}"
319
- ivar = instance_variable_get(ivar_name)
320
- return ivar if ivar
321
- instance_variable_set(ivar_name, TestCentricity::Link.new(element_name, self, locator, :section))
322
- end
297
+ define_element(element_name, TestCentricity::Link, locator)
323
298
  end
324
299
 
325
300
  def self.links(element_hash)
@@ -336,12 +311,7 @@ module TestCentricity
336
311
  # table :payments_table, "//table[@class='payments_table']"
337
312
  #
338
313
  def self.table(element_name, locator)
339
- define_method(element_name) do
340
- ivar_name = "@#{element_name}"
341
- ivar = instance_variable_get(ivar_name)
342
- return ivar if ivar
343
- instance_variable_set(ivar_name, TestCentricity::Table.new(element_name, self, locator, :section))
344
- end
314
+ define_element(element_name, TestCentricity::Table, locator)
345
315
  end
346
316
 
347
317
  def self.tables(element_hash)
@@ -359,12 +329,7 @@ module TestCentricity
359
329
  # selectlist :gender_select, "//select[@id='customer_gender']"
360
330
  #
361
331
  def self.selectlist(element_name, locator)
362
- define_method(element_name) do
363
- ivar_name = "@#{element_name}"
364
- ivar = instance_variable_get(ivar_name)
365
- return ivar if ivar
366
- instance_variable_set(ivar_name, TestCentricity::SelectList.new(element_name, self, locator, :section))
367
- end
332
+ define_element(element_name, TestCentricity::SelectList, locator)
368
333
  end
369
334
 
370
335
  def self.selectlists(element_hash)
@@ -381,12 +346,7 @@ module TestCentricity
381
346
  # list :y_axis_list, 'g.y_axis'
382
347
  #
383
348
  def self.list(element_name, locator)
384
- define_method(element_name) do
385
- ivar_name = "@#{element_name}"
386
- ivar = instance_variable_get(ivar_name)
387
- return ivar if ivar
388
- instance_variable_set(ivar_name, TestCentricity::List.new(element_name, self, locator, :section))
389
- end
349
+ define_element(element_name, TestCentricity::List, locator)
390
350
  end
391
351
 
392
352
  def self.lists(element_hash)
@@ -404,12 +364,7 @@ module TestCentricity
404
364
  # image :corporate_logo_image, "//img[@alt='MyCompany_logo']"
405
365
  #
406
366
  def self.image(element_name, locator)
407
- define_method(element_name) do
408
- ivar_name = "@#{element_name}"
409
- ivar = instance_variable_get(ivar_name)
410
- return ivar if ivar
411
- instance_variable_set(ivar_name, TestCentricity::Image.new(element_name, self, locator, :section))
412
- end
367
+ define_element(element_name, TestCentricity::Image, locator)
413
368
  end
414
369
 
415
370
  def self.images(element_hash)
@@ -426,12 +381,7 @@ module TestCentricity
426
381
  # filefield :attach_file, 's_SweFileName'
427
382
  #
428
383
  def self.filefield(element_name, locator)
429
- define_method(element_name) do
430
- ivar_name = "@#{element_name}"
431
- ivar = instance_variable_get(ivar_name)
432
- return ivar if ivar
433
- instance_variable_set(ivar_name, TestCentricity::FileField.new(element_name, self, locator, :section))
434
- end
384
+ define_element(element_name, TestCentricity::FileField, locator)
435
385
  end
436
386
 
437
387
  def self.filefields(element_hash)
@@ -538,8 +488,13 @@ module TestCentricity
538
488
  # @example
539
489
  # section :search_form, SearchForm
540
490
  #
541
- def self.section(section_name, class_name, locator = nil)
542
- class_eval(%(def #{section_name};@#{section_name} ||= #{class_name}.new("#{section_name}", self, "#{locator}", :section);end))
491
+ def self.section(section_name, obj, locator = nil)
492
+ define_method(section_name) do
493
+ ivar_name = "@#{section_name}"
494
+ ivar = instance_variable_get(ivar_name)
495
+ return ivar if ivar
496
+ instance_variable_set(ivar_name, obj.new(section_name, self, "#{locator}", :section))
497
+ end
543
498
  end
544
499
 
545
500
  def self.sections(section_hash)
@@ -928,5 +883,13 @@ module TestCentricity
928
883
  raise ObjectNotFoundError.new("Section object '#{get_name}' (#{get_locator}) not found") unless section
929
884
  end
930
885
 
886
+ def self.define_element(element_name, obj, locator)
887
+ define_method(element_name) do
888
+ ivar_name = "@#{element_name}"
889
+ ivar = instance_variable_get(ivar_name)
890
+ return ivar if ivar
891
+ instance_variable_set(ivar_name, obj.new(element_name, self, locator, :section))
892
+ end
893
+ end
931
894
  end
932
895
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '2.4.1'
2
+ VERSION = '2.4.2'
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: 2.4.1
4
+ version: 2.4.2
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: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler