testcentricity_web 3.0.15 → 3.0.16

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: f45bd2fe6c901c8d3e0409f9e2840347a0eea1e3
4
- data.tar.gz: 445b57defbb02ff5fa3c15d2afdd255ac77cd1b3
3
+ metadata.gz: 59511d3c1058420271406cf0301c0e70d68d5359
4
+ data.tar.gz: 0ae473931053acfc7aef79062bc95bb43db644cd
5
5
  SHA512:
6
- metadata.gz: 35159fd12f89b212b21bdbdb638775dd9ed73eb1440a8752a8f36c09f39037475b95e349988635b4ddd90b6839074c631fdf8940b5d067b81a27b36d43f4c701
7
- data.tar.gz: ce6f61a344de88fc0af06ae2d8ce50af8d77cc55835bd71fe47a829a2262091dc4ac7c71a923510d39a69f7a9445f4cd3065f5bc03b4360924f80d8efc2efca4
6
+ metadata.gz: e023a7d3b88b63c1f13c67d2173db58151ffaf6fe6ac9278bf05acd05b28ee9baa13c0abcfebe816d82d9c87a195450b16788fbf7428304a623a08f5b8052682
7
+ data.tar.gz: 52ab694da1a11f5bf5b0530c76c5f7c72a73454ea158932fbd12b9c1431b90fcf6c943e2e98fdc3f0357d893986c0d3e2659f6537a1e2ade758074dbf1670b0c
data/CHANGELOG.md CHANGED
@@ -1,32 +1,44 @@
1
1
  # CHANGELOG
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [3.0.16] - 2018-09-21
5
+
6
+ ### Added
7
+ * `Image.src` and `Image.alt` method.
8
+ * Added `Video` and `Audio` type `UIElement` to support verification of HTML5 Video and Audio Objects.
9
+
10
+
4
11
  ## [3.0.15] - 2018-09-19
5
12
 
6
13
  ### Added
7
14
  * `UIElement.hover_at` method.
8
15
  * Added support for specifying IP Geolocation when testing on BrowserStack cloud hosted browsers.
9
16
 
17
+
10
18
  ## [3.0.14] - 2018-09-17
11
19
 
12
20
  ### Added
13
21
  * Added support for performing file uploads in browsers running on remote cloud hosted services as well as in Selenium Grid and Dockerized Selenium
14
22
  Grid environments.
15
23
 
24
+
16
25
  ## [3.0.13] - 2018-08-10
17
26
 
18
27
  ### Fixed
19
28
  * Improved response times of `List.get_item_count` and `List.get_list_items` methods by shortening `wait` time.
20
29
 
30
+
21
31
  ## [3.0.12] - 2018-08-09
22
32
  ### Added
23
33
  * `PageSection.hover` method.
24
34
  * `List.hover_item` method.
25
35
 
36
+
26
37
  ## [3.0.11] - 2018-08-05
27
38
  ### Added
28
39
  * `UIElement.count` method.
29
40
 
41
+
30
42
  ## [3.0.10] - 2018-07-20
31
43
  ### Added
32
44
  * `Image.broken?` method.
@@ -56,6 +68,7 @@ any UI element with property states that do not match expected results.
56
68
  * `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods now accept optional `fail_message` string parameter to add context to error
57
69
  messages when UI verifications raise an exception.
58
70
 
71
+
59
72
  ## [3.0.7] - 2018-06-21
60
73
 
61
74
  ### Added
@@ -66,6 +79,7 @@ Grid environments.
66
79
  ### Deprecated
67
80
  * Deprecated `TestCentricity::WebDriverConnect.set_webdriver_path` method because the correct WebDriver is now automatically set.
68
81
 
82
+
69
83
  ## [3.0.6] - 2018-06-14
70
84
 
71
85
  ### Added
@@ -78,26 +92,31 @@ logs when running tests on BrowserStack hosted browsers. Refer to **section 8.5.
78
92
  * Updated device profiles for iPhone 7 (iOS 11) with Mobile Edge browser and iPad (iOS 11) with Mobile Edge browser.
79
93
  * Updated device profiles for iPhone 7 (iOS 11) with Mobile Chrome browser and iPad (iOS 11) with Mobile Chrome browser.
80
94
 
95
+
81
96
  ## [3.0.5] - 2018-05-17
82
97
 
83
98
  ### Added
84
99
  * Added `Environ.headless` method. Will return `true` if testing against a *headless* instance of Chrome or Firefox.
85
100
 
101
+
86
102
  ## [3.0.4] - 2018-05-12
87
103
 
88
104
  ### Fixed
89
105
  * Refactored `SelectList` methods to work with Capybara version 3.x.
90
106
 
107
+
91
108
  ## [3.0.3] - 2018-05-09
92
109
 
93
110
  ### Changed
94
111
  * Pinning to Capybara version 2.18.0 because Capybara 3.x breaks several `SelectList` methods.
95
112
 
113
+
96
114
  ## [3.0.2] - 2018-05-09
97
115
 
98
116
  ### Changed
99
117
  * `PageManager.find_page` method now raises an exception if the requested page object has not been defined and instantiated.
100
118
 
119
+
101
120
  ## [3.0.1] - 2018-04-28
102
121
 
103
122
  ### Changed
@@ -105,6 +124,7 @@ logs when running tests on BrowserStack hosted browsers. Refer to **section 8.5.
105
124
  * Updated device profiles for iPhone 7 (iOS 11) with Mobile Edge browser and iPad (iOS 10) with Mobile Edge browser.
106
125
  * Updated device profiles for iPhone 7 (iOS 11) with Mobile Chrome browser and iPad (iOS 10) with Mobile Chrome browser.
107
126
 
127
+
108
128
  ## [3.0.0] - 2018-04-25
109
129
 
110
130
  ### Added
@@ -118,16 +138,19 @@ of Firefox web browsers.
118
138
  * `TestCentricity::WebDriverConnect.set_webdriver_path` method now sets the path to the appropriate **geckodriver** file for OS X or Windows when testing on
119
139
  locally hosted Firefox browsers.
120
140
 
141
+
121
142
  ## [2.4.3] - 2018-04-11
122
143
 
123
144
  ### Changed
124
145
  * Updated device profiles for iPhone 7 (iOS 11) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
125
146
 
147
+
126
148
  ## [2.4.1] - 2018-03-27
127
149
 
128
150
  ### Added
129
151
  * Added device profiles for iPad (iOS 10) with MS Edge browser.
130
152
 
153
+
131
154
  ## [2.4.0] - 2018-03-25
132
155
 
133
156
  ### Changed
@@ -135,11 +158,13 @@ locally hosted Firefox browsers.
135
158
  Variables and set the corresponding `fullReset`, `noReset`, and `newCommandTimeout` Appium capabilities for iOS and Android physical devices and simulators.
136
159
  Also reads the `WDA_LOCAL_PORT` Environment Variable and sets the `wdaLocalPort` Appium capability for iOS physical devices only.
137
160
 
161
+
138
162
  ## [2.3.19] - 2018-03-14
139
163
 
140
164
  ### Fixed
141
165
  * Fixed device profile for `android_phone` - Generic Android Phone.
142
166
 
167
+
143
168
  ## [2.3.18] - 2018-03-11
144
169
 
145
170
  ### Changed
@@ -151,6 +176,7 @@ Also reads the `WDA_LOCAL_PORT` Environment Variable and sets the `wdaLocalPort`
151
176
  ### Fixed
152
177
  * Fixed `SelectList.choose_option` to also accept `:text`, `:value`, and `:index` option hashes across all types of select list objects.
153
178
 
179
+
154
180
  ## [2.3.17] - 2018-03-08
155
181
 
156
182
  ### Added
@@ -159,11 +185,13 @@ Also reads the `WDA_LOCAL_PORT` Environment Variable and sets the `wdaLocalPort`
159
185
  ### Changed
160
186
  * `UIElement.wait_until_value_is` and `List.wait_until_item_count_is` methods now accept comparison hash.
161
187
 
188
+
162
189
  ## [2.3.16] - 2018-03-04
163
190
 
164
191
  ### Added
165
192
  * Added `PageSection.double_click`, `PageObject.right_click`, and `PageObject.send_keys` methods.
166
193
 
194
+
167
195
  ## [2.3.15] - 2018-03-02
168
196
 
169
197
  ### Added
@@ -173,22 +201,26 @@ Also reads the `WDA_LOCAL_PORT` Environment Variable and sets the `wdaLocalPort`
173
201
  * Fixed bug in `UIElement.get_object_type` method that could result in a `NoMethodError obj not defined` error.
174
202
  * Fixed bug in `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods that failed to enqueue errors when UI elements could not be found.
175
203
 
204
+
176
205
  ## [2.3.14] - 2018-02-28
177
206
 
178
207
  ### Changed
179
208
  * Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser.
180
209
 
210
+
181
211
  ## [2.3.13] - 2018-02-09
182
212
 
183
213
  ### Added
184
214
  * Added `AppiumServer.start`, `AppiumServer.running?`, and `AppiumServer.stop` methods for starting and stopping the Appium Server prior to executing tests on
185
215
  iOS physical devices or simulators, or Android virtual device emulators.
186
216
 
217
+
187
218
  ## [2.3.12] - 2018-02-07
188
219
 
189
220
  ### Added
190
221
  * Added `Environ.is_simulator?` and `Environ.is_web?` methods.
191
222
 
223
+
192
224
  ## [2.3.11] - 2018-02-02
193
225
 
194
226
  ### Added
@@ -197,6 +229,7 @@ iOS physical devices or simulators, or Android virtual device emulators.
197
229
  ### Changed
198
230
  * Updated device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
199
231
 
232
+
200
233
  ## [2.3.10] - 2018-01-31
201
234
 
202
235
  ### Added
@@ -204,6 +237,7 @@ iOS physical devices or simulators, or Android virtual device emulators.
204
237
  * Added `displayed?`, `get_all_items_count`, and `get_all_list_items` methods to `PageSection` class.
205
238
  * Added `get_all_items_count`, and `get_all_list_items` methods to `List` class.
206
239
 
240
+
207
241
  ## [2.3.9] - 2018-01-27
208
242
 
209
243
  ### Changed
@@ -211,16 +245,19 @@ iOS physical devices or simulators, or Android virtual device emulators.
211
245
  * Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser, iPhone 7 (iOS 10) with Chrome browser, and iPhone 7 (iOS 10) with Firefox browser.
212
246
  * Updated device profiles for iPad (iOS 10) with Chrome browser and iPad (iOS 10) with Firefox browser.
213
247
 
248
+
214
249
  ## [2.3.8] - 2018-01-23
215
250
 
216
251
  ### Fixed
217
252
  * Fixed locator resolution for **Indexed PageSection Objects**.
218
253
 
254
+
219
255
  ## [2.3.7] - 2018-01-18
220
256
 
221
257
  ### Added
222
258
  * Added `width`, `height`, `x`, `y`, and `displayed?` methods to `UIElement` class.
223
259
 
260
+
224
261
  ## [2.3.6] - 2017-12-21
225
262
 
226
263
  ### Added
@@ -229,18 +266,21 @@ iOS physical devices or simulators, or Android virtual device emulators.
229
266
  ### Changed
230
267
  * `TextField.clear` method now works with most `number` type fields.
231
268
 
269
+
232
270
  ## [2.3.5] - 2017-12-19
233
271
 
234
272
  ### Changed
235
273
  * Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to be compatible with Redactor editor fields.
236
274
  * Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser, iPhone 7 (iOS 10) with Chrome browser, and iPhone 7 (iOS 10) with Firefox browser.
237
275
 
276
+
238
277
  ## [2.3.4] - 2017-12-12
239
278
 
240
279
  ### Fixed
241
280
  * Fixed bug in `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods that prevented deletion of data in number type textfields
242
281
  and textarea controls.
243
282
 
283
+
244
284
  ## [2.3.3] - 2017-12-09
245
285
 
246
286
  ### Added
@@ -249,6 +289,7 @@ and textarea controls.
249
289
  ### Fixed
250
290
  * Corrected device profiles for iPad (iOS 10) with Mobile Chrome browser and iPad (iOS 10) with Mobile Firefox browser.
251
291
 
292
+
252
293
  ## [2.3.1] - 2017-12-07
253
294
 
254
295
  ### Added
@@ -257,44 +298,52 @@ Environment Variable is set to `true`. `Environ.tunneling` will be set to true i
257
298
  * Added `TestCentricity::WebDriverConnect.close_tunnel` method to close BrowserStack Local instance when Local testing is enabled. Refer to the
258
299
  **Remotely hosted desktop and mobile web browsers** section for information on usage.
259
300
 
301
+
260
302
  ## [2.2.1] - 2017-11-29
261
303
 
262
304
  ### Changed
263
305
  * `SelectList.choose_option` method now accepts index values for Chosen list objects.
264
306
 
307
+
265
308
  ## [2.2.0] - 2017-11-29
266
309
 
267
310
  ### Changed
268
311
  * CSS selectors or XPath expressions may be used as locators for all types of **UI Elements**, including tables.
269
312
 
313
+
270
314
  ## [2.1.10] - 2017-11-14
271
315
 
272
316
  ### Added
273
317
  * Added device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
274
318
 
319
+
275
320
  ## [2.1.9] - 2017-11-13
276
321
 
277
322
  ### Fixed
278
323
  * Fixed bug in `SelectList.choose_option`, `SelectList.get_options`, `SelectList.get_option_count`, and `SelectList.get_selected_option` methods which
279
324
  did not recognize grouped option in Chosen list objects.
280
325
 
326
+
281
327
  ## [2.1.8] - 2017-11-09
282
328
 
283
329
  ### Added
284
330
  * Added `PageSection.verify_list_items` method for **Indexed PageSection Objects**.
285
331
 
332
+
286
333
  ## [2.1.7] - 2017-11-07
287
334
 
288
335
  ### Changed
289
336
  * Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to use backspace characters to delete contents of a textfield
290
337
  instead of using `clear`, which was preventing `onchange` JavaScript events from being triggered in some browsers.
291
338
 
339
+
292
340
  ## [2.1.6] - 2017-10-31
293
341
 
294
342
  ### Fixed
295
343
  * Fixed bug in `TestCentricity::WebDriverConnect.set_webdriver_path` method that was failing to set the path to the appropriate **chromedriver** file for OS X
296
344
  and Windows.
297
345
 
346
+
298
347
  ## [2.1.5] - 2017-10-28
299
348
 
300
349
  ### Added
@@ -306,6 +355,7 @@ for textfields.
306
355
  * Fixed Chrome and Firefox support for setting browser language via the `LOCALE` Environment Variable. This capability now works for emulated mobile
307
356
  browsers hosted in a local instance of Chrome or Firefox.
308
357
 
358
+
309
359
  ## [2.1.4] - 2017-10-24
310
360
 
311
361
  ### Added
@@ -319,12 +369,14 @@ browsers hosted in a local instance of Chrome or Firefox.
319
369
  concurrent parallel thread being executed, the position of each browser will be offset by 100 pixels right and 100 pixels down. For parallel test execution,
320
370
  use the [parallel_tests gem](https://rubygems.org/gems/parallel_tests) to decrease overall test execution time.
321
371
 
372
+
322
373
  ## [2.1.2] - 2017-10-01
323
374
 
324
375
  ### Added
325
376
  * Added device profiles for Microsoft Lumia 950, Blackberry Leap, Blackberry Passport, and Kindle Fire HD 10
326
377
  * Added ability to set browser language support via the `LOCALE` Environment Variable for local instances of Chrome browsers
327
378
 
379
+
328
380
  ## [2.1.0] - 2017-09-23
329
381
 
330
382
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (3.0.14)
4
+ testcentricity_web (3.0.16)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
@@ -20,15 +20,15 @@ GEM
20
20
  specs:
21
21
  addressable (2.5.2)
22
22
  public_suffix (>= 2.0.2, < 4.0)
23
- appium_lib (9.15.0)
24
- appium_lib_core (~> 1.9.0)
23
+ appium_lib (9.15.1)
24
+ appium_lib_core (~> 2.0.0)
25
25
  nokogiri (~> 1.8, >= 1.8.1)
26
26
  tomlrb (~> 1.1)
27
- appium_lib_core (1.9.0)
27
+ appium_lib_core (2.0.1)
28
28
  faye-websocket (~> 0.10.0)
29
29
  selenium-webdriver (~> 3.14)
30
30
  browserstack-local (1.3.0)
31
- capybara (3.6.0)
31
+ capybara (3.8.0)
32
32
  addressable
33
33
  mini_mime (>= 0.1.3)
34
34
  nokogiri (~> 1.8)
@@ -54,14 +54,14 @@ GEM
54
54
  mini_portile2 (~> 2.3.0)
55
55
  os (1.0.0)
56
56
  power_assert (1.1.3)
57
- public_suffix (3.0.2)
57
+ public_suffix (3.0.3)
58
58
  rack (2.0.5)
59
59
  rack-test (1.1.0)
60
60
  rack (>= 1.0, < 3)
61
61
  rake (11.1.2)
62
62
  redcarpet (3.3.4)
63
63
  ruby-ole (1.2.12.1)
64
- rubyzip (1.2.1)
64
+ rubyzip (1.2.2)
65
65
  selenium-webdriver (3.14.0)
66
66
  childprocess (~> 0.5)
67
67
  rubyzip (~> 1.2)
data/README.md CHANGED
@@ -20,6 +20,7 @@ The TestCentricity™ Web gem supports running automated tests against the follo
20
20
  [TestingBot](https://testingbot.com/features), or [Gridlastic](https://www.gridlastic.com/test-environments.html) services.
21
21
  * web portals utilizing JavaScript front end application frameworks like Ember, React, Angular, and GWT
22
22
  * enterprise web portals build using Siebel Open UI
23
+ * web pages containing HTML5 Video and Audio objects
23
24
 
24
25
 
25
26
  ## What's New
@@ -378,8 +379,9 @@ Once your **Page Object** has been instantiated, you can call its **PageSection*
378
379
  ## UI Elements
379
380
 
380
381
  **Page Objects** and **PageSection Objects** are typically made up of **UI Element** like text fields, check boxes, combo boxes, radio buttons,
381
- tables, lists, buttons, etc. **UI Elements** are declared and instantiated within the class definition of the **Page Object** or **PageSection
382
- Object** in which they are contained. With TestCentricity Web, all UI elements are based on the **UIElement** class.
382
+ tables, lists, buttons, images, HTML5 video objects, HTML5 audio objects, etc. **UI Elements** are declared and instantiated within the class
383
+ definition of the **Page Object** or **PageSection Object** in which they are contained. With TestCentricity Web, all UI elements are based on
384
+ the **UIElement** class.
383
385
 
384
386
 
385
387
  ### Declaring and Instantiating UI Element
@@ -412,6 +414,8 @@ Supported **UI Element** elementTypes and their declarations have the following
412
414
  list :list_name, locator
413
415
  table :table_name, locator
414
416
  image :image_name, locator
417
+ video :video_name, locator
418
+ audio :audio_name, locator
415
419
  filefield :filefield_name, locator
416
420
 
417
421
  end
@@ -443,9 +447,13 @@ Supported **UI Element** elementTypes and their declarations have the following
443
447
  table_X_name: locator
444
448
  images image_1_name: locator,
445
449
  image_X_name: locator
450
+ videos video_1_name: locator,
451
+ video_X_name: locator
452
+ audios audio_1_name: locator,
453
+ audio_X_name: locator
446
454
  filefields filefield_1_name: locator,
447
455
  filefield_X_name: locator
448
-
456
+
449
457
  end
450
458
 
451
459
 
@@ -6,6 +6,10 @@ class Object
6
6
  def present?
7
7
  !blank?
8
8
  end
9
+
10
+ def boolean?
11
+ [true, false].include? self
12
+ end
9
13
  end
10
14
 
11
15
 
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.0.15'
2
+ VERSION = '3.0.16'
3
3
  end
@@ -261,6 +261,40 @@ module TestCentricity
261
261
  end
262
262
  end
263
263
 
264
+ # Declare and instantiate a single HTML5 video UI Element for this page object.
265
+ #
266
+ # @param element_name [Symbol] name of an HTML5 video object (as a symbol)
267
+ # @param locator [String] CSS selector or XPath expression that uniquely identifies object
268
+ # @example
269
+ # video :video_player, 'video#my_video_player'
270
+ #
271
+ def self.video(element_name, locator)
272
+ define_element(element_name, TestCentricity::Video, locator)
273
+ end
274
+
275
+ def self.videos(element_hash)
276
+ element_hash.each do |element_name, locator|
277
+ video(element_name, locator)
278
+ end
279
+ end
280
+
281
+ # Declare and instantiate a single HTML5 audio UI Element for this page object.
282
+ #
283
+ # @param element_name [Symbol] name of an HTML5 audio object (as a symbol)
284
+ # @param locator [String] CSS selector or XPath expression that uniquely identifies object
285
+ # @example
286
+ # audio :audio_player, 'audio#my_audio_player'
287
+ #
288
+ def self.audio(element_name, locator)
289
+ define_element(element_name, TestCentricity::Audio, locator)
290
+ end
291
+
292
+ def self.audios(element_hash)
293
+ element_hash.each do |element_name, locator|
294
+ audio(element_name, locator)
295
+ end
296
+ end
297
+
264
298
  # Declare and instantiate a single File Field UI Element for this page object.
265
299
  #
266
300
  # @param element_name [Symbol] name of file field object (as a symbol)
@@ -580,6 +614,38 @@ module TestCentricity
580
614
  actual = ui_object.loaded?
581
615
  when :broken
582
616
  actual = ui_object.broken?
617
+ when :alt
618
+ actual = ui_object.alt
619
+ when :src
620
+ actual = ui_object.src
621
+ when :autoplay
622
+ actual = ui_object.autoplay?
623
+ when :ended
624
+ actual = ui_object.ended?
625
+ when :controls
626
+ actual = ui_object.controls?
627
+ when :loop
628
+ actual = ui_object.loop?
629
+ when :muted
630
+ actual = ui_object.muted?
631
+ when :default_muted
632
+ actual = ui_object.default_muted?
633
+ when :paused
634
+ actual = ui_object.paused?
635
+ when :seeking
636
+ actual = ui_object.seeking?
637
+ when :current_time
638
+ actual = ui_object.current_time
639
+ when :default_playback_rate
640
+ actual = ui_object.default_playback_rate
641
+ when :duration
642
+ actual = ui_object.duration
643
+ when :playback_rate
644
+ actual = ui_object.playback_rate
645
+ when :ready_state
646
+ actual = ui_object.ready_state
647
+ when :volume
648
+ actual = ui_object.volume
583
649
  when :options, :items, :list_items
584
650
  actual = ui_object.get_list_items
585
651
  when :optioncount, :itemcount
@@ -361,7 +361,7 @@ module TestCentricity
361
361
  end
362
362
  end
363
363
 
364
- # Declare and instantiate an single image UI Element for this page section.
364
+ # Declare and instantiate a single image UI Element for this page section.
365
365
  #
366
366
  # @param element_name [Symbol] name of image object (as a symbol)
367
367
  # @param locator [String] CSS selector or XPath expression that uniquely identifies object
@@ -379,6 +379,40 @@ module TestCentricity
379
379
  end
380
380
  end
381
381
 
382
+ # Declare and instantiate a single video UI Element for this page section.
383
+ #
384
+ # @param element_name [Symbol] name of video object (as a symbol)
385
+ # @param locator [String] CSS selector or XPath expression that uniquely identifies object
386
+ # @example
387
+ # video :video_player, 'video#my_video_player'
388
+ #
389
+ def self.video(element_name, locator)
390
+ define_element(element_name, TestCentricity::Video, locator)
391
+ end
392
+
393
+ def self.videos(element_hash)
394
+ element_hash.each do |element_name, locator|
395
+ video(element_name, locator)
396
+ end
397
+ end
398
+
399
+ # Declare and instantiate a single HTML5 audio UI Element for this page section.
400
+ #
401
+ # @param element_name [Symbol] name of an HTML5 audio object (as a symbol)
402
+ # @param locator [String] CSS selector or XPath expression that uniquely identifies object
403
+ # @example
404
+ # audio :audio_player, 'audio#my_audio_player'
405
+ #
406
+ def self.audio(element_name, locator)
407
+ define_element(element_name, TestCentricity::Audio, locator)
408
+ end
409
+
410
+ def self.audios(element_hash)
411
+ element_hash.each do |element_name, locator|
412
+ audio(element_name, locator)
413
+ end
414
+ end
415
+
382
416
  # Declare and instantiate a single File Field UI Element for this page section.
383
417
  #
384
418
  # @param element_name [Symbol] name of file field object (as a symbol)
@@ -780,6 +814,38 @@ module TestCentricity
780
814
  actual = ui_object.loaded?
781
815
  when :broken
782
816
  actual = ui_object.broken?
817
+ when :alt
818
+ actual = ui_object.alt
819
+ when :src
820
+ actual = ui_object.src
821
+ when :autoplay
822
+ actual = ui_object.autoplay?
823
+ when :ended
824
+ actual = ui_object.ended?
825
+ when :controls
826
+ actual = ui_object.controls?
827
+ when :loop
828
+ actual = ui_object.loop?
829
+ when :muted
830
+ actual = ui_object.muted?
831
+ when :default_muted
832
+ actual = ui_object.default_muted?
833
+ when :paused
834
+ actual = ui_object.paused?
835
+ when :seeking
836
+ actual = ui_object.seeking?
837
+ when :current_time
838
+ actual = ui_object.current_time
839
+ when :default_playback_rate
840
+ actual = ui_object.default_playback_rate
841
+ when :duration
842
+ actual = ui_object.duration
843
+ when :playback_rate
844
+ actual = ui_object.playback_rate
845
+ when :ready_state
846
+ actual = ui_object.ready_state
847
+ when :volume
848
+ actual = ui_object.volume
783
849
  when :options, :items, :list_items
784
850
  actual = ui_object.get_list_items
785
851
  when :optioncount, :itemcount
@@ -0,0 +1,196 @@
1
+ module TestCentricity
2
+ class Audio < UIElement
3
+ def initialize(name, parent, locator, context)
4
+ super
5
+ @type = :audio
6
+ end
7
+
8
+ # Return audio autoplay property
9
+ #
10
+ # @return [Boolean]
11
+ # @example
12
+ # audio_player.autoplay?
13
+ #
14
+ def autoplay?
15
+ obj, = find_element(visible = :all)
16
+ object_not_found_exception(obj, :audio)
17
+ state = obj.native.attribute('autoplay')
18
+ state.boolean? ? state : state == 'true'
19
+ end
20
+
21
+ # Return audio ended property
22
+ #
23
+ # @return [Boolean]
24
+ # @example
25
+ # audio_player.ended?
26
+ #
27
+ def ended?
28
+ obj, = find_element(visible = :all)
29
+ object_not_found_exception(obj, :audio)
30
+ state = obj.native.attribute('ended')
31
+ state.boolean? ? state : state == 'true'
32
+ end
33
+
34
+ # Return audio controls property
35
+ #
36
+ # @return [Boolean]
37
+ # @example
38
+ # audio_player.controls?
39
+ #
40
+ def controls?
41
+ obj, = find_element(visible = :all)
42
+ object_not_found_exception(obj, :audio)
43
+ state = obj.native.attribute('controls')
44
+ state.boolean? ? state : state == 'true'
45
+ end
46
+
47
+ # Return audio loop property
48
+ #
49
+ # @return [Boolean]
50
+ # @example
51
+ # audio_player.loop?
52
+ #
53
+ def loop?
54
+ obj, = find_element(visible = :all)
55
+ object_not_found_exception(obj, :audio)
56
+ loop_state = obj.native.attribute('loop')
57
+ loop_state.boolean? ? loop_state : loop_state == 'true'
58
+ end
59
+
60
+ # Return audio muted property
61
+ #
62
+ # @return [Boolean]
63
+ # @example
64
+ # audio_player.muted?
65
+ #
66
+ def muted?
67
+ obj, = find_element(visible = :all)
68
+ object_not_found_exception(obj, :audio)
69
+ mute_state = obj.native.attribute('muted')
70
+ mute_state.boolean? ? mute_state : mute_state == 'true'
71
+ end
72
+
73
+ # Return audio defaultMuted property
74
+ #
75
+ # @return [Boolean]
76
+ # @example
77
+ # audio_player.default_muted?
78
+ #
79
+ def default_muted?
80
+ obj, = find_element(visible = :all)
81
+ object_not_found_exception(obj, :audio)
82
+ mute_state = obj.native.attribute('defaultMuted')
83
+ mute_state.boolean? ? mute_state : mute_state == 'true'
84
+ end
85
+
86
+ # Return audio paused property
87
+ #
88
+ # @return [Boolean]
89
+ # @example
90
+ # audio_player.paused?
91
+ #
92
+ def paused?
93
+ obj, = find_element(visible = :all)
94
+ object_not_found_exception(obj, :audio)
95
+ paused_state = obj.native.attribute('paused')
96
+ paused_state.boolean? ? paused_state : paused_state == 'true'
97
+ end
98
+
99
+ # Return audio seeking property
100
+ #
101
+ # @return [Boolean]
102
+ # @example
103
+ # audio_player.seeking?
104
+ #
105
+ def seeking?
106
+ obj, = find_element(visible = :all)
107
+ object_not_found_exception(obj, :audio)
108
+ state = obj.native.attribute('seeking')
109
+ state.boolean? ? state : state == 'true'
110
+ end
111
+
112
+ # Return audio src property
113
+ #
114
+ # @return [String] value of src property
115
+ # @example
116
+ # src_value = audio_player.src
117
+ #
118
+ def src
119
+ obj, = find_element(visible = :all)
120
+ object_not_found_exception(obj, :audio)
121
+ obj.native.attribute('src')
122
+ end
123
+
124
+ # Return audio currentTime property
125
+ #
126
+ # @return [Integer or Float] current playback position in seconds
127
+ # @example
128
+ # current_player_time = audio_player.current_time
129
+ #
130
+ def current_time
131
+ obj, = find_element(visible = :all)
132
+ object_not_found_exception(obj, :audio)
133
+ obj.native.attribute('currentTime')
134
+ end
135
+
136
+ # Return audio defaultPlaybackRate property
137
+ #
138
+ # @return [Integer or Float] default playback speed
139
+ # @example
140
+ # default_speed = audio_player.default_playback_rate
141
+ #
142
+ def default_playback_rate
143
+ obj, = find_element(visible = :all)
144
+ object_not_found_exception(obj, :audio)
145
+ obj.native.attribute('defaultPlaybackRate')
146
+ end
147
+
148
+ # Return audio duration property
149
+ #
150
+ # @return [Integer or Float] duration of audio
151
+ # @example
152
+ # how_long = audio_player.duration
153
+ #
154
+ def duration
155
+ obj, = find_element(visible = :all)
156
+ object_not_found_exception(obj, :audio)
157
+ obj.native.attribute('duration')
158
+ end
159
+
160
+ # Return audio playbackRate property
161
+ #
162
+ # @return [Integer or Float] current playback speed
163
+ # @example
164
+ # playback_speed = audio_player.playback_rate
165
+ #
166
+ def playback_rate
167
+ obj, = find_element(visible = :all)
168
+ object_not_found_exception(obj, :audio)
169
+ obj.native.attribute('playbackRate')
170
+ end
171
+
172
+ # Return audio readyState property
173
+ #
174
+ # @return [Integer or Float] audio ready state
175
+ # @example
176
+ # audio_status = audio_player.ready_state
177
+ #
178
+ def ready_state
179
+ obj, = find_element(visible = :all)
180
+ object_not_found_exception(obj, :audio)
181
+ obj.native.attribute('readyState')
182
+ end
183
+
184
+ # Return audio volume property
185
+ #
186
+ # @return [Integer or Float] audio volume setting
187
+ # @example
188
+ # volume_level = audio_player.volume
189
+ #
190
+ def volume
191
+ obj, = find_element(visible = :all)
192
+ object_not_found_exception(obj, :audio)
193
+ obj.native.attribute('volume')
194
+ end
195
+ end
196
+ end
@@ -9,7 +9,7 @@ module TestCentricity
9
9
  #
10
10
  # @return [Boolean]
11
11
  # @example
12
- # company_logo_image.is_loaded??
12
+ # company_logo_image.is_loaded?
13
13
  #
14
14
  def loaded?
15
15
  obj, = find_element
@@ -23,7 +23,7 @@ module TestCentricity
23
23
  #
24
24
  # @return [Boolean]
25
25
  # @example
26
- # company_logo_image.broken???
26
+ # company_logo_image.broken?
27
27
  #
28
28
  def broken?
29
29
  obj, = find_element
@@ -52,5 +52,29 @@ module TestCentricity
52
52
  loaded?
53
53
  end
54
54
  end
55
+
56
+ # Return image alt property
57
+ #
58
+ # @return [String] value of alt property
59
+ # @example
60
+ # alt_value = company_logo_image.alt
61
+ #
62
+ def alt
63
+ obj, = find_element
64
+ object_not_found_exception(obj, nil)
65
+ obj.native.attribute('alt')
66
+ end
67
+
68
+ # Return image src property
69
+ #
70
+ # @return [String] value of src property
71
+ # @example
72
+ # src_value = company_logo_image.src
73
+ #
74
+ def src
75
+ obj, = find_element
76
+ object_not_found_exception(obj, nil)
77
+ obj.native.attribute('src')
78
+ end
55
79
  end
56
80
  end
@@ -0,0 +1,196 @@
1
+ module TestCentricity
2
+ class Video < UIElement
3
+ def initialize(name, parent, locator, context)
4
+ super
5
+ @type = :video
6
+ end
7
+
8
+ # Return video autoplay property
9
+ #
10
+ # @return [Boolean]
11
+ # @example
12
+ # video_player.autoplay?
13
+ #
14
+ def autoplay?
15
+ obj, = find_element
16
+ object_not_found_exception(obj, nil)
17
+ state = obj.native.attribute('autoplay')
18
+ state.boolean? ? state : state == 'true'
19
+ end
20
+
21
+ # Return video ended property
22
+ #
23
+ # @return [Boolean]
24
+ # @example
25
+ # video_player.ended?
26
+ #
27
+ def ended?
28
+ obj, = find_element
29
+ object_not_found_exception(obj, nil)
30
+ state = obj.native.attribute('ended')
31
+ state.boolean? ? state : state == 'true'
32
+ end
33
+
34
+ # Return video controls property
35
+ #
36
+ # @return [Boolean]
37
+ # @example
38
+ # video_player.controls?
39
+ #
40
+ def controls?
41
+ obj, = find_element
42
+ object_not_found_exception(obj, nil)
43
+ state = obj.native.attribute('controls')
44
+ state.boolean? ? state : state == 'true'
45
+ end
46
+
47
+ # Return video loop property
48
+ #
49
+ # @return [Boolean]
50
+ # @example
51
+ # video_player.loop?
52
+ #
53
+ def loop?
54
+ obj, = find_element
55
+ object_not_found_exception(obj, nil)
56
+ loop_state = obj.native.attribute('loop')
57
+ loop_state.boolean? ? loop_state : loop_state == 'true'
58
+ end
59
+
60
+ # Return video muted property
61
+ #
62
+ # @return [Boolean]
63
+ # @example
64
+ # video_player.muted?
65
+ #
66
+ def muted?
67
+ obj, = find_element
68
+ object_not_found_exception(obj, nil)
69
+ mute_state = obj.native.attribute('muted')
70
+ mute_state.boolean? ? mute_state : mute_state == 'true'
71
+ end
72
+
73
+ # Return video defaultMuted property
74
+ #
75
+ # @return [Boolean]
76
+ # @example
77
+ # video_player.default_muted?
78
+ #
79
+ def default_muted?
80
+ obj, = find_element
81
+ object_not_found_exception(obj, nil)
82
+ mute_state = obj.native.attribute('defaultMuted')
83
+ mute_state.boolean? ? mute_state : mute_state == 'true'
84
+ end
85
+
86
+ # Return video paused property
87
+ #
88
+ # @return [Boolean]
89
+ # @example
90
+ # video_player.paused?
91
+ #
92
+ def paused?
93
+ obj, = find_element
94
+ object_not_found_exception(obj, nil)
95
+ paused_state = obj.native.attribute('paused')
96
+ paused_state.boolean? ? paused_state : paused_state == 'true'
97
+ end
98
+
99
+ # Return video seeking property
100
+ #
101
+ # @return [Boolean]
102
+ # @example
103
+ # video_player.seeking?
104
+ #
105
+ def seeking?
106
+ obj, = find_element
107
+ object_not_found_exception(obj, nil)
108
+ state = obj.native.attribute('seeking')
109
+ state.boolean? ? state : state == 'true'
110
+ end
111
+
112
+ # Return video src property
113
+ #
114
+ # @return [String] value of src property
115
+ # @example
116
+ # src_value = video_player.src
117
+ #
118
+ def src
119
+ obj, = find_element
120
+ object_not_found_exception(obj, nil)
121
+ obj.native.attribute('src')
122
+ end
123
+
124
+ # Return video currentTime property
125
+ #
126
+ # @return [Integer or Float] current playback position in seconds
127
+ # @example
128
+ # current_player_time = video_player.current_time
129
+ #
130
+ def current_time
131
+ obj, = find_element
132
+ object_not_found_exception(obj, nil)
133
+ obj.native.attribute('currentTime')
134
+ end
135
+
136
+ # Return video defaultPlaybackRate property
137
+ #
138
+ # @return [Integer or Float] default playback speed
139
+ # @example
140
+ # default_speed = video_player.default_playback_rate
141
+ #
142
+ def default_playback_rate
143
+ obj, = find_element
144
+ object_not_found_exception(obj, nil)
145
+ obj.native.attribute('defaultPlaybackRate')
146
+ end
147
+
148
+ # Return video duration property
149
+ #
150
+ # @return [Integer or Float] duration of video
151
+ # @example
152
+ # how_long = video_player.duration
153
+ #
154
+ def duration
155
+ obj, = find_element
156
+ object_not_found_exception(obj, nil)
157
+ obj.native.attribute('duration')
158
+ end
159
+
160
+ # Return video playbackRate property
161
+ #
162
+ # @return [Integer or Float] current playback speed
163
+ # @example
164
+ # playback_speed = video_player.playback_rate
165
+ #
166
+ def playback_rate
167
+ obj, = find_element
168
+ object_not_found_exception(obj, nil)
169
+ obj.native.attribute('playbackRate')
170
+ end
171
+
172
+ # Return video readyState property
173
+ #
174
+ # @return [Integer or Float] video ready state
175
+ # @example
176
+ # vid_status = video_player.ready_state
177
+ #
178
+ def ready_state
179
+ obj, = find_element
180
+ object_not_found_exception(obj, nil)
181
+ obj.native.attribute('readyState')
182
+ end
183
+
184
+ # Return video volume property
185
+ #
186
+ # @return [Integer or Float] video volume setting
187
+ # @example
188
+ # volume_level = video_player.volume
189
+ #
190
+ def volume
191
+ obj, = find_element
192
+ object_not_found_exception(obj, nil)
193
+ obj.native.attribute('volume')
194
+ end
195
+ end
196
+ end
@@ -30,6 +30,8 @@ require 'testcentricity_web/web_elements/select_list'
30
30
  require 'testcentricity_web/web_elements/list'
31
31
  require 'testcentricity_web/web_elements/table'
32
32
  require 'testcentricity_web/web_elements/textfield'
33
+ require 'testcentricity_web/web_elements/audio'
34
+ require 'testcentricity_web/web_elements/video'
33
35
  require 'testcentricity_web/web_elements/cell_element'
34
36
  require 'testcentricity_web/web_elements/cell_button'
35
37
  require 'testcentricity_web/web_elements/cell_checkbox'
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.0.15
4
+ version: 3.0.16
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-09-18 00:00:00.000000000 Z
11
+ date: 2018-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -263,6 +263,7 @@ files:
263
263
  - lib/testcentricity_web/web_core/page_objects_helper.rb
264
264
  - lib/testcentricity_web/web_core/page_sections_helper.rb
265
265
  - lib/testcentricity_web/web_core/webdriver_helper.rb
266
+ - lib/testcentricity_web/web_elements/audio.rb
266
267
  - lib/testcentricity_web/web_elements/button.rb
267
268
  - lib/testcentricity_web/web_elements/cell_button.rb
268
269
  - lib/testcentricity_web/web_elements/cell_checkbox.rb
@@ -285,6 +286,7 @@ files:
285
286
  - lib/testcentricity_web/web_elements/table.rb
286
287
  - lib/testcentricity_web/web_elements/textfield.rb
287
288
  - lib/testcentricity_web/web_elements/ui_elements_helper.rb
289
+ - lib/testcentricity_web/web_elements/video.rb
288
290
  - lib/testcentricity_web/world_extensions.rb
289
291
  - my_templates/default/method_details/setup.rb
290
292
  - testcentricity_web.gemspec