testcentricity_web 4.3.1 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -12
  3. data/LICENSE.md +1 -1
  4. data/README.md +1794 -697
  5. data/lib/devices/devices.yml +144 -216
  6. data/lib/testcentricity_web/browser_helper.rb +33 -4
  7. data/lib/testcentricity_web/data_objects/environment.rb +96 -13
  8. data/lib/testcentricity_web/exception_queue_helper.rb +5 -6
  9. data/lib/testcentricity_web/version.rb +1 -1
  10. data/lib/testcentricity_web/web_core/page_object.rb +53 -49
  11. data/lib/testcentricity_web/web_core/page_objects_helper.rb +20 -11
  12. data/lib/testcentricity_web/web_core/page_section.rb +31 -34
  13. data/lib/testcentricity_web/web_core/webdriver_helper.rb +379 -252
  14. data/lib/testcentricity_web/web_elements/audio.rb +6 -4
  15. data/lib/testcentricity_web/web_elements/button.rb +7 -4
  16. data/lib/testcentricity_web/web_elements/checkbox.rb +149 -147
  17. data/lib/testcentricity_web/web_elements/file_field.rb +38 -36
  18. data/lib/testcentricity_web/web_elements/image.rb +75 -70
  19. data/lib/testcentricity_web/web_elements/label.rb +6 -4
  20. data/lib/testcentricity_web/web_elements/link.rb +15 -13
  21. data/lib/testcentricity_web/web_elements/list.rb +171 -169
  22. data/lib/testcentricity_web/web_elements/media.rb +384 -379
  23. data/lib/testcentricity_web/web_elements/radio.rb +135 -133
  24. data/lib/testcentricity_web/web_elements/range.rb +16 -29
  25. data/lib/testcentricity_web/web_elements/select_list.rb +247 -245
  26. data/lib/testcentricity_web/web_elements/table.rb +575 -573
  27. data/lib/testcentricity_web/web_elements/textfield.rb +143 -139
  28. data/lib/testcentricity_web/web_elements/ui_element.rb +1171 -0
  29. data/lib/testcentricity_web/web_elements/video.rb +39 -37
  30. data/lib/testcentricity_web/world_extensions.rb +37 -4
  31. data/lib/testcentricity_web.rb +4 -23
  32. metadata +27 -79
  33. data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +0 -1148
@@ -113,7 +113,7 @@ module TestCentricity
113
113
  # element :basket_header, 'div.basket_header'
114
114
  #
115
115
  def self.element(element_name, locator)
116
- define_element(element_name, TestCentricity::UIElement, locator)
116
+ define_element(element_name, TestCentricity::Elements::UIElement, locator)
117
117
  end
118
118
 
119
119
  # Declare and instantiate a collection of generic UI Elements for this page section.
@@ -125,7 +125,7 @@ module TestCentricity
125
125
  # log_out_item: 'a#logout'
126
126
  #
127
127
  def self.elements(element_hash)
128
- element_hash.each(&method(:element))
128
+ element_hash.each_pair { |element_name, locator| element(element_name, locator) }
129
129
  end
130
130
 
131
131
  # Declare and instantiate a single button UI Element for this page section.
@@ -137,7 +137,7 @@ module TestCentricity
137
137
  # button :login_button, "//input[@id='submit_button']"
138
138
  #
139
139
  def self.button(element_name, locator)
140
- define_element(element_name, TestCentricity::Button, locator)
140
+ define_element(element_name, TestCentricity::Elements::Button, locator)
141
141
  end
142
142
 
143
143
  # Declare and instantiate a collection of buttons for this page section.
@@ -149,7 +149,7 @@ module TestCentricity
149
149
  # cancel_button: 'button#cancel'
150
150
  #
151
151
  def self.buttons(element_hash)
152
- element_hash.each(&method(:button))
152
+ element_hash.each_pair { |element_name, locator| button(element_name, locator) }
153
153
  end
154
154
 
155
155
  # Declare and instantiate a single text field UI Element for this page section.
@@ -161,7 +161,7 @@ module TestCentricity
161
161
  # textfield :password_field, 'input#consumer_password'
162
162
  #
163
163
  def self.textfield(element_name, locator)
164
- define_element(element_name, TestCentricity::TextField, locator)
164
+ define_element(element_name, TestCentricity::Elements::TextField, locator)
165
165
  end
166
166
 
167
167
  # Declare and instantiate a collection of text fields for this page section.
@@ -171,11 +171,10 @@ module TestCentricity
171
171
  # textfields name_field: 'input#Name',
172
172
  # title_field: 'input#Title',
173
173
  # phone_field: 'input#PhoneNumber',
174
- # fax_field: 'input#FaxNumber',
175
174
  # email_field: 'input#Email'
176
175
  #
177
176
  def self.textfields(element_hash)
178
- element_hash.each(&method(:textfield))
177
+ element_hash.each_pair { |element_name, locator| textfield(element_name, locator) }
179
178
  end
180
179
 
181
180
  # Declare and instantiate a single range input UI Element for this page section.
@@ -187,7 +186,7 @@ module TestCentricity
187
186
  # range :points_slider, 'input#points'
188
187
  #
189
188
  def self.range(element_name, locator)
190
- define_element(element_name, TestCentricity::Range, locator)
189
+ define_element(element_name, TestCentricity::Elements::Range, locator)
191
190
  end
192
191
 
193
192
  # Declare and instantiate a collection of range inputs for this page section.
@@ -198,7 +197,7 @@ module TestCentricity
198
197
  # risk_slider: 'input#risk_percentage'
199
198
  #
200
199
  def self.ranges(element_hash)
201
- element_hash.each(&method(:range))
200
+ element_hash.each_pair { |element_name, locator| range(element_name, locator) }
202
201
  end
203
202
 
204
203
  # Declare and instantiate a single checkbox UI Element for this page section.
@@ -210,7 +209,7 @@ module TestCentricity
210
209
  # checkbox :accept_terms_checkbox, 'input#accept_terms_conditions'
211
210
  #
212
211
  def self.checkbox(element_name, locator)
213
- define_element(element_name, TestCentricity::CheckBox, locator)
212
+ define_element(element_name, TestCentricity::Elements::CheckBox, locator)
214
213
  end
215
214
 
216
215
  # Declare and instantiate a collection of checkboxes for this page section.
@@ -223,7 +222,7 @@ module TestCentricity
223
222
  # carb_compliant_check: 'input#carbCompliant'
224
223
  #
225
224
  def self.checkboxes(element_hash)
226
- element_hash.each(&method(:checkbox))
225
+ element_hash.each_pair { |element_name, locator| checkbox(element_name, locator) }
227
226
  end
228
227
 
229
228
  # Declare and instantiate a single radio button UI Element for this page section.
@@ -235,7 +234,7 @@ module TestCentricity
235
234
  # radio :decline_terms_radio, 'input#decline_terms_conditions'
236
235
  #
237
236
  def self.radio(element_name, locator)
238
- define_element(element_name, TestCentricity::Radio, locator)
237
+ define_element(element_name, TestCentricity::Elements::Radio, locator)
239
238
  end
240
239
 
241
240
  # Declare and instantiate a collection of radio buttons for this page section.
@@ -248,7 +247,7 @@ module TestCentricity
248
247
  # amex_radio: 'input#payWithAmEx'
249
248
  #
250
249
  def self.radios(element_hash)
251
- element_hash.each(&method(:radio))
250
+ element_hash.each_pair { |element_name, locator| radio(element_name, locator) }
252
251
  end
253
252
 
254
253
  # Declare and instantiate a single label UI Element for this page section.
@@ -260,11 +259,11 @@ module TestCentricity
260
259
  # label :rollup_price_label, "//div[contains(@id, 'Rollup Item Price')]"
261
260
  #
262
261
  def self.label(element_name, locator)
263
- define_element(element_name, TestCentricity::Label, locator)
262
+ define_element(element_name, TestCentricity::Elements::Label, locator)
264
263
  end
265
264
 
266
265
  def self.labels(element_hash)
267
- element_hash.each(&method(:label))
266
+ element_hash.each_pair { |element_name, locator| label(element_name, locator) }
268
267
  end
269
268
 
270
269
  # Declare and instantiate a single link UI Element for this page section.
@@ -276,11 +275,11 @@ module TestCentricity
276
275
  # link :shopping_basket_link, "//a[@href='shopping_basket']"
277
276
  #
278
277
  def self.link(element_name, locator)
279
- define_element(element_name, TestCentricity::Link, locator)
278
+ define_element(element_name, TestCentricity::Elements::Link, locator)
280
279
  end
281
280
 
282
281
  def self.links(element_hash)
283
- element_hash.each(&method(:link))
282
+ element_hash.each_pair { |element_name, locator| link(element_name, locator) }
284
283
  end
285
284
 
286
285
  # Declare and instantiate a single table UI Element for this page section.
@@ -291,11 +290,11 @@ module TestCentricity
291
290
  # table :payments_table, "//table[@class='payments_table']"
292
291
  #
293
292
  def self.table(element_name, locator)
294
- define_element(element_name, TestCentricity::Table, locator)
293
+ define_element(element_name, TestCentricity::Elements::Table, locator)
295
294
  end
296
295
 
297
296
  def self.tables(element_hash)
298
- element_hash.each(&method(:table))
297
+ element_hash.each_pair { |element_name, locator| table(element_name, locator) }
299
298
  end
300
299
 
301
300
  # Declare and instantiate a single select list UI Element for this page section.
@@ -307,11 +306,11 @@ module TestCentricity
307
306
  # selectlist :gender_select, "//select[@id='customer_gender']"
308
307
  #
309
308
  def self.selectlist(element_name, locator)
310
- define_element(element_name, TestCentricity::SelectList, locator)
309
+ define_element(element_name, TestCentricity::Elements::SelectList, locator)
311
310
  end
312
311
 
313
312
  def self.selectlists(element_hash)
314
- element_hash.each(&method(:selectlist))
313
+ element_hash.each_pair { |element_name, locator| selectlist(element_name, locator) }
315
314
  end
316
315
 
317
316
  # Declare and instantiate a single list UI Element for this page section.
@@ -322,11 +321,11 @@ module TestCentricity
322
321
  # list :y_axis_list, 'g.y_axis'
323
322
  #
324
323
  def self.list(element_name, locator)
325
- define_element(element_name, TestCentricity::List, locator)
324
+ define_element(element_name, TestCentricity::Elements::List, locator)
326
325
  end
327
326
 
328
327
  def self.lists(element_hash)
329
- element_hash.each(&method(:list))
328
+ element_hash.each_pair { |element_name, locator| list(element_name, locator) }
330
329
  end
331
330
 
332
331
  # Declare and instantiate a single image UI Element for this page section.
@@ -338,11 +337,11 @@ module TestCentricity
338
337
  # image :corporate_logo_image, "//img[@alt='MyCompany_logo']"
339
338
  #
340
339
  def self.image(element_name, locator)
341
- define_element(element_name, TestCentricity::Image, locator)
340
+ define_element(element_name, TestCentricity::Elements::Image, locator)
342
341
  end
343
342
 
344
343
  def self.images(element_hash)
345
- element_hash.each(&method(:image))
344
+ element_hash.each_pair { |element_name, locator| image(element_name, locator) }
346
345
  end
347
346
 
348
347
  # Declare and instantiate a single video UI Element for this page section.
@@ -353,11 +352,11 @@ module TestCentricity
353
352
  # video :video_player, 'video#my_video_player'
354
353
  #
355
354
  def self.video(element_name, locator)
356
- define_element(element_name, TestCentricity::Video, locator)
355
+ define_element(element_name, TestCentricity::Elements::Video, locator)
357
356
  end
358
357
 
359
358
  def self.videos(element_hash)
360
- element_hash.each(&method(:video))
359
+ element_hash.each_pair { |element_name, locator| video(element_name, locator) }
361
360
  end
362
361
 
363
362
  # Declare and instantiate a single HTML5 audio UI Element for this page section.
@@ -368,11 +367,11 @@ module TestCentricity
368
367
  # audio :audio_player, 'audio#my_audio_player'
369
368
  #
370
369
  def self.audio(element_name, locator)
371
- define_element(element_name, TestCentricity::Audio, locator)
370
+ define_element(element_name, TestCentricity::Elements::Audio, locator)
372
371
  end
373
372
 
374
373
  def self.audios(element_hash)
375
- element_hash.each(&method(:audio))
374
+ element_hash.each_pair { |element_name, locator| audio(element_name, locator) }
376
375
  end
377
376
 
378
377
  # Declare and instantiate a single File Field UI Element for this page section.
@@ -383,11 +382,11 @@ module TestCentricity
383
382
  # filefield :attach_file, 's_SweFileName'
384
383
  #
385
384
  def self.filefield(element_name, locator)
386
- define_element(element_name, TestCentricity::FileField, locator)
385
+ define_element(element_name, TestCentricity::Elements::FileField, locator)
387
386
  end
388
387
 
389
388
  def self.filefields(element_hash)
390
- element_hash.each(&method(:filefield))
389
+ element_hash.each_pair { |element_name, locator| filefield(element_name, locator) }
391
390
  end
392
391
 
393
392
  # Instantiate a single PageSection object within this PageSection object.
@@ -407,9 +406,7 @@ module TestCentricity
407
406
  end
408
407
 
409
408
  def self.sections(section_hash)
410
- section_hash.each do |section_name, class_name|
411
- section(section_name, class_name)
412
- end
409
+ section_hash.each_pair { |section_name, class_name| section(section_name, class_name) }
413
410
  end
414
411
 
415
412
  # Does Section object exists?