testcentricity_web 4.6.9 → 4.6.10
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 +4 -4
- data/CHANGELOG.md +27 -0
- data/README.md +44 -38
- data/lib/testcentricity_web/data_objects/environment.rb +1 -1
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +10 -0
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +5 -8
- data/lib/testcentricity_web/web_elements/media.rb +121 -3
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de6418809f79980fa606328879c38f0307e96d03d62abe5d1e1d2e7054a9a9fb
|
|
4
|
+
data.tar.gz: cb56e40775606d4d00557402656d98ff9e0b214d5bc58dad599bda6ed09c368a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0c860cb2b14e91a790c9fedbaceeb722cc480b3379abf8a30a691c8d57b3e1e900ce410c7eea2b5e8202f1bdfb2f405a7f78e06a9747cb36632f722f0ba8775
|
|
7
|
+
data.tar.gz: 4ad95f8ceedaa1acbebb5eb1869067b25a7eca38a6cc9daae6a68733d98913a21d0dc2db76e6cf9077df596db53ee060d5808c374b4dc1ec8bb64d3aca65fa7a
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [4.6.10] - 07-NOV-2025
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
* Added the following `Media` methods to support verification of media text tracks (subtitles, captions,
|
|
10
|
+
chapters, descriptions, or metadata):
|
|
11
|
+
* `active_track_cue_count`
|
|
12
|
+
* `track_cue_count`
|
|
13
|
+
* `active_cue_text`
|
|
14
|
+
* `cue_text`
|
|
15
|
+
* `active_cue_data`
|
|
16
|
+
* `all_cues_text`
|
|
17
|
+
* `all_cues_data`
|
|
18
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of the following
|
|
19
|
+
`Media` properties:
|
|
20
|
+
* `:active_track_cue_count`
|
|
21
|
+
* `active_cue_text`
|
|
22
|
+
* `all_tracks_data`
|
|
23
|
+
* `active_cue_data`
|
|
24
|
+
* `all_cues_text`
|
|
25
|
+
* `all_cues_data`
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
* `Media.current_time` and `Media.duration` now return `Float` rounded to nearest tenth.
|
|
30
|
+
|
|
31
|
+
|
|
5
32
|
## [4.6.9] - 31-OCT-2025
|
|
6
33
|
|
|
7
34
|
### Added
|
data/README.md
CHANGED
|
@@ -796,30 +796,36 @@ The `verify_ui_states` method supports the following property/state pairs:
|
|
|
796
796
|
|
|
797
797
|
**Audio/Video Media Objects**
|
|
798
798
|
|
|
799
|
-
:autoplay
|
|
800
|
-
:ended
|
|
801
|
-
:controls
|
|
802
|
-
:loop
|
|
803
|
-
:muted
|
|
804
|
-
:default_muted
|
|
805
|
-
:paused
|
|
806
|
-
:seeking
|
|
807
|
-
:src
|
|
808
|
-
:current_time
|
|
809
|
-
:default_playback_rate
|
|
810
|
-
:duration
|
|
811
|
-
:playback_rate
|
|
812
|
-
:ready_state
|
|
813
|
-
:volume
|
|
814
|
-
:preload
|
|
815
|
-
:poster
|
|
816
|
-
:track_count
|
|
817
|
-
:active_track
|
|
818
|
-
:active_track_data
|
|
819
|
-
:all_tracks_data
|
|
820
|
-
:track_data
|
|
821
|
-
:active_track_source
|
|
822
|
-
:track_source
|
|
799
|
+
:autoplay Boolean
|
|
800
|
+
:ended Boolean
|
|
801
|
+
:controls Boolean
|
|
802
|
+
:loop Boolean
|
|
803
|
+
:muted Boolean
|
|
804
|
+
:default_muted Boolean
|
|
805
|
+
:paused Boolean
|
|
806
|
+
:seeking Boolean
|
|
807
|
+
:src String
|
|
808
|
+
:current_time Float
|
|
809
|
+
:default_playback_rate Float
|
|
810
|
+
:duration Float
|
|
811
|
+
:playback_rate Float
|
|
812
|
+
:ready_state Integer
|
|
813
|
+
:volume Float
|
|
814
|
+
:preload String
|
|
815
|
+
:poster String
|
|
816
|
+
:track_count Integer
|
|
817
|
+
:active_track Integer
|
|
818
|
+
:active_track_data Hash
|
|
819
|
+
:all_tracks_data Array of Hash
|
|
820
|
+
:track_data Hash
|
|
821
|
+
:active_track_source String
|
|
822
|
+
:track_source String
|
|
823
|
+
:active_track_cue_count Integer
|
|
824
|
+
:active_cue_text String
|
|
825
|
+
:all_tracks_data Array of Hash
|
|
826
|
+
:active_cue_data Array of Hash
|
|
827
|
+
:all_cues_text Array of Hash
|
|
828
|
+
:all_cues_data Array of Hash
|
|
823
829
|
|
|
824
830
|
#### ARIA Accessibility Property/State Pairs
|
|
825
831
|
|
|
@@ -1463,7 +1469,7 @@ If the optional `options` hash is not provided when calling the `TestCentricity:
|
|
|
1463
1469
|
then **Environment Variables** must be used to specify the target local or remote web browser, and the various webdriver
|
|
1464
1470
|
capability parameters required to establish a connection with a single target web browser.
|
|
1465
1471
|
|
|
1466
|
-
### Specifying Options and Capabilities
|
|
1472
|
+
### Specifying Options and Capabilities using the `options` Hash
|
|
1467
1473
|
|
|
1468
1474
|
For those test scenarios requiring the instantiation of multiple WebDriver objects, or where cumbersome **Environment
|
|
1469
1475
|
Variables** are less than ideal, call the `TestCentricity::WebDriverConnect.initialize_web_driver` method with an `options`
|
|
@@ -1523,7 +1529,7 @@ expects a driver name, specified as a `Symbol`.
|
|
|
1523
1529
|
|
|
1524
1530
|
### Setting Desktop Browser Window Size
|
|
1525
1531
|
|
|
1526
|
-
#### Using `:browser_size`
|
|
1532
|
+
#### Using `:browser_size` using the `options` Hash
|
|
1527
1533
|
|
|
1528
1534
|
The size (width and height) of a desktop browser window can be specified in the `options` hash for browsers that are hosted
|
|
1529
1535
|
locally, in a Selenium Grid, or by a cloud hosted browser service provider. You cannot set the size of a mobile device web
|
|
@@ -1597,7 +1603,7 @@ the following Environment Variables must be set as described in the table below:
|
|
|
1597
1603
|
Refer to [**section 8.9 (Using Browser Specific Profiles in `cucumber.yml`)**](#using-browser-specific-profiles-in-cucumber-yml) below.
|
|
1598
1604
|
|
|
1599
1605
|
|
|
1600
|
-
#### Local Desktop Browser
|
|
1606
|
+
#### Local Desktop Browser using the `options` Hash
|
|
1601
1607
|
|
|
1602
1608
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
1603
1609
|
- `driver:` must be set to `:webdriver`
|
|
@@ -1745,7 +1751,7 @@ then the following Environment Variables must be set as described in the table b
|
|
|
1745
1751
|
Refer to [**section 8.9 (Using Browser Specific Profiles in `cucumber.yml`)**](#using-browser-specific-profiles-in-cucumber-yml) below.
|
|
1746
1752
|
|
|
1747
1753
|
|
|
1748
|
-
#### Local Emulated Mobile Browser
|
|
1754
|
+
#### Local Emulated Mobile Browser using the `options` Hash
|
|
1749
1755
|
|
|
1750
1756
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
1751
1757
|
- `driver:` must be set to `:webdriver`
|
|
@@ -1853,7 +1859,7 @@ then the following Environment Variables must be set as described in the table b
|
|
|
1853
1859
|
Refer to [**section 8.9 (Using Browser Specific Profiles in `cucumber.yml`)**](#using-browser-specific-profiles-in-cucumber-yml) below.
|
|
1854
1860
|
|
|
1855
1861
|
|
|
1856
|
-
#### Grid Browser
|
|
1862
|
+
#### Grid Browser using the `options` Hash
|
|
1857
1863
|
|
|
1858
1864
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
1859
1865
|
- `driver:` must be set to `:grid`
|
|
@@ -1939,7 +1945,7 @@ from the Appium Server GUI app. A security violation error will occur without re
|
|
|
1939
1945
|
Refer to [**section 8.9 (Using Browser Specific Profiles in `cucumber.yml`)**](#using-browser-specific-profiles-in-cucumber-yml) below.
|
|
1940
1946
|
|
|
1941
1947
|
|
|
1942
|
-
##### Local Mobile Safari Browser
|
|
1948
|
+
##### Local Mobile Safari Browser using the `options` Hash
|
|
1943
1949
|
|
|
1944
1950
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
1945
1951
|
- `driver:` must be set to `:appium`
|
|
@@ -2025,7 +2031,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2025
2031
|
Refer to [**section 8.9 (Using Browser Specific Profiles in `cucumber.yml`)**](#using-browser-specific-profiles-in-cucumber-yml) below.
|
|
2026
2032
|
|
|
2027
2033
|
|
|
2028
|
-
##### Local Mobile Android Browser
|
|
2034
|
+
##### Local Mobile Android Browser using the `options` Hash
|
|
2029
2035
|
|
|
2030
2036
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2031
2037
|
- `driver:` must be set to `:appium`
|
|
@@ -2187,7 +2193,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2187
2193
|
| `NETWORK_LOGS` | [Optional] Capture network logs (`true` or `false`) |
|
|
2188
2194
|
|
|
2189
2195
|
|
|
2190
|
-
##### BrowserStack Desktop Browser
|
|
2196
|
+
##### BrowserStack Desktop Browser using the `options` Hash
|
|
2191
2197
|
|
|
2192
2198
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2193
2199
|
- `driver:` must be set to `:browserstack`
|
|
@@ -2284,7 +2290,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2284
2290
|
| `APPIUM_LOGS` | [Optional] Generate Appium logs (`true` or `false`) |
|
|
2285
2291
|
|
|
2286
2292
|
|
|
2287
|
-
##### BrowserStack Mobile Browser
|
|
2293
|
+
##### BrowserStack Mobile Browser using the `options` Hash
|
|
2288
2294
|
|
|
2289
2295
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2290
2296
|
- `driver:` must be set to `:browserstack`
|
|
@@ -2374,7 +2380,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2374
2380
|
| `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`) |
|
|
2375
2381
|
|
|
2376
2382
|
|
|
2377
|
-
##### Sauce Labs Desktop Browser
|
|
2383
|
+
##### Sauce Labs Desktop Browser using the `options` Hash
|
|
2378
2384
|
|
|
2379
2385
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2380
2386
|
- `driver:` must be set to `:saucelabs`
|
|
@@ -2460,7 +2466,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2460
2466
|
| `ORIENTATION` | [Optional] Set to `PORTRAIT` or `LANDSCAPE` |
|
|
2461
2467
|
|
|
2462
2468
|
|
|
2463
|
-
##### Sauce Labs Mobile Browser
|
|
2469
|
+
##### Sauce Labs Mobile Browser using the `options` Hash
|
|
2464
2470
|
|
|
2465
2471
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2466
2472
|
- `driver:` must be set to `:saucelabs`
|
|
@@ -2551,7 +2557,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2551
2557
|
| `BROWSER_SIZE` | [Optional] Specify width, height of browser window |
|
|
2552
2558
|
|
|
2553
2559
|
|
|
2554
|
-
##### TestingBot Desktop Browser
|
|
2560
|
+
##### TestingBot Desktop Browser using the `options` Hash
|
|
2555
2561
|
|
|
2556
2562
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2557
2563
|
- `driver:` must be set to `:testingbot`
|
|
@@ -2631,7 +2637,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2631
2637
|
| `ORIENTATION` | [Optional] Set to `portrait` or `landscape` |
|
|
2632
2638
|
|
|
2633
2639
|
|
|
2634
|
-
##### TestingBot Mobile Browser
|
|
2640
|
+
##### TestingBot Mobile Browser using the `options` Hash
|
|
2635
2641
|
|
|
2636
2642
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2637
2643
|
- `driver:` must be set to `:testingbot`
|
|
@@ -2714,7 +2720,7 @@ the following **Environment Variables** must be set as described in the table be
|
|
|
2714
2720
|
| `CONSOLE_LOGS` | [Optional] Used to capture browser console logs. |
|
|
2715
2721
|
|
|
2716
2722
|
|
|
2717
|
-
##### LambdaTest Desktop Browser
|
|
2723
|
+
##### LambdaTest Desktop Browser using the `options` Hash
|
|
2718
2724
|
|
|
2719
2725
|
When using the `options` hash, the following options and capabilities must be specified:
|
|
2720
2726
|
- `driver:` must be set to `:lambdatest`
|
|
@@ -65,7 +65,6 @@ module TestCentricity
|
|
|
65
65
|
@session_id = Time.now.strftime('%d%H%M%S%L')
|
|
66
66
|
@session_time_stamp = Time.now.strftime('%Y%m%d%H%M%S')
|
|
67
67
|
@test_environment = ENV['TEST_ENVIRONMENT']
|
|
68
|
-
@a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
|
|
69
68
|
@locale = ENV['LOCALE'] || 'en'
|
|
70
69
|
@language = ENV['LANGUAGE'] || 'English'
|
|
71
70
|
@screen_shots = []
|
|
@@ -147,6 +146,7 @@ module TestCentricity
|
|
|
147
146
|
@deep_link_prefix = data['DEEP_LINK_PREFIX']
|
|
148
147
|
@ios_bundle_id = data['IOS_BUNDLE_ID']
|
|
149
148
|
@android_app_id = data['ANDROID_APP_ID']
|
|
149
|
+
@a11y_standard = ENV['ACCESSIBILITY_STANDARD'] || 'best-practice'
|
|
150
150
|
|
|
151
151
|
url = @hostname.blank? ? "#{@base_url}#{@append}" : "#{@hostname}/#{@base_url}#{@append}"
|
|
152
152
|
@app_host = if @user_id.blank? || @password.blank?
|
|
@@ -149,8 +149,18 @@ module TestCentricity
|
|
|
149
149
|
ui_object.active_track_data
|
|
150
150
|
when :active_track_source
|
|
151
151
|
ui_object.active_track_source
|
|
152
|
+
when :active_track_cue_count
|
|
153
|
+
ui_object.active_track_cue_count
|
|
154
|
+
when :active_cue_text
|
|
155
|
+
ui_object.active_cue_text
|
|
152
156
|
when :all_tracks_data
|
|
153
157
|
ui_object.all_tracks_data
|
|
158
|
+
when :active_cue_data
|
|
159
|
+
ui_object.active_cue_data
|
|
160
|
+
when :all_cues_text
|
|
161
|
+
ui_object.all_cues_text
|
|
162
|
+
when :all_cues_data
|
|
163
|
+
ui_object.all_cues_data
|
|
154
164
|
when :preload
|
|
155
165
|
ui_object.preload
|
|
156
166
|
when :poster
|
|
@@ -198,12 +198,6 @@ module TestCentricity
|
|
|
198
198
|
Environ.session_state = :running
|
|
199
199
|
end
|
|
200
200
|
|
|
201
|
-
# :nocov:
|
|
202
|
-
|
|
203
|
-
def self.set_domain(url)
|
|
204
|
-
Capybara.app_host = url
|
|
205
|
-
end
|
|
206
|
-
|
|
207
201
|
def self.close_tunnel
|
|
208
202
|
unless @bs_local.nil?
|
|
209
203
|
@bs_local.stop
|
|
@@ -214,6 +208,11 @@ module TestCentricity
|
|
|
214
208
|
end
|
|
215
209
|
end
|
|
216
210
|
end
|
|
211
|
+
|
|
212
|
+
# :nocov:
|
|
213
|
+
def self.set_domain(url)
|
|
214
|
+
Capybara.app_host = url
|
|
215
|
+
end
|
|
217
216
|
# :nocov:
|
|
218
217
|
|
|
219
218
|
private
|
|
@@ -432,7 +431,6 @@ module TestCentricity
|
|
|
432
431
|
end
|
|
433
432
|
# specify endpoint url
|
|
434
433
|
@endpoint = "https://#{ENV['BS_USERNAME']}:#{ENV['BS_AUTHKEY']}@hub-cloud.browserstack.com/wd/hub" if @endpoint.nil?
|
|
435
|
-
# :nocov:
|
|
436
434
|
# enable tunneling if specified
|
|
437
435
|
if ENV['TUNNELING']
|
|
438
436
|
@bs_local = BrowserStack::Local.new
|
|
@@ -444,7 +442,6 @@ module TestCentricity
|
|
|
444
442
|
puts 'BrowserStack Local instance failed to start'
|
|
445
443
|
end
|
|
446
444
|
end
|
|
447
|
-
# :nocov:
|
|
448
445
|
# define BrowserStack options
|
|
449
446
|
options = if @capabilities.nil?
|
|
450
447
|
Environ.os = "#{ENV['BS_OS']} #{ENV['BS_OS_VERSION']}"
|
|
@@ -126,7 +126,7 @@ module TestCentricity
|
|
|
126
126
|
def current_time
|
|
127
127
|
obj, = find_element(visible = :all)
|
|
128
128
|
object_not_found_exception(obj, @type)
|
|
129
|
-
obj.native.attribute('currentTime').to_f.round(
|
|
129
|
+
obj.native.attribute('currentTime').to_f.round(1)
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
# Return media defaultPlaybackRate property
|
|
@@ -150,7 +150,7 @@ module TestCentricity
|
|
|
150
150
|
def duration
|
|
151
151
|
obj, = find_element(visible = :all)
|
|
152
152
|
object_not_found_exception(obj, @type)
|
|
153
|
-
obj.native.attribute('duration').to_f.round(
|
|
153
|
+
obj.native.attribute('duration').to_f.round(1)
|
|
154
154
|
end
|
|
155
155
|
|
|
156
156
|
# Return media playbackRate property
|
|
@@ -195,7 +195,7 @@ module TestCentricity
|
|
|
195
195
|
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
|
196
196
|
wait.until do
|
|
197
197
|
reset_mru_cache
|
|
198
|
-
ready_state
|
|
198
|
+
compare(value, ready_state)
|
|
199
199
|
end
|
|
200
200
|
rescue StandardError
|
|
201
201
|
if post_exception
|
|
@@ -325,6 +325,124 @@ module TestCentricity
|
|
|
325
325
|
track_obj[:src]
|
|
326
326
|
end
|
|
327
327
|
|
|
328
|
+
# Return number of text cues of active text track of associated media
|
|
329
|
+
#
|
|
330
|
+
# @return [Integer] number of text cues
|
|
331
|
+
# @example
|
|
332
|
+
# num_cues = media_player.active_track_cue_count
|
|
333
|
+
#
|
|
334
|
+
def active_track_cue_count
|
|
335
|
+
active = active_track
|
|
336
|
+
return nil if active.zero?
|
|
337
|
+
|
|
338
|
+
track_cue_count(active)
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# Return number of text cues of specified text track of associated media
|
|
342
|
+
#
|
|
343
|
+
# @param track [Integer] index of requested track
|
|
344
|
+
# @return [Integer] number of text cues
|
|
345
|
+
# @example
|
|
346
|
+
# num_cues = media_player.track_cue_count(2)
|
|
347
|
+
#
|
|
348
|
+
def track_cue_count(track)
|
|
349
|
+
obj, = find_element(visible = :all)
|
|
350
|
+
object_not_found_exception(obj, @type)
|
|
351
|
+
page.execute_script("return arguments[0].textTracks[#{track - 1}].cues.length", obj)
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# Return cue text of active text track of associated media
|
|
355
|
+
#
|
|
356
|
+
# @return [String] cue text of active track
|
|
357
|
+
# @example
|
|
358
|
+
# caption = media_player.active_cue_text
|
|
359
|
+
#
|
|
360
|
+
def active_cue_text
|
|
361
|
+
active = active_track
|
|
362
|
+
return nil if active.zero?
|
|
363
|
+
|
|
364
|
+
cue_text(active)
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
# Return text cue of specified text track of associated media
|
|
368
|
+
#
|
|
369
|
+
# @param track [Integer] index of requested track
|
|
370
|
+
# @return [String] cue text of requested track
|
|
371
|
+
# @example
|
|
372
|
+
# caption = media_player.cue_text(2)
|
|
373
|
+
#
|
|
374
|
+
def cue_text(track)
|
|
375
|
+
obj, = find_element(visible = :all)
|
|
376
|
+
object_not_found_exception(obj, @type)
|
|
377
|
+
page.execute_script("return arguments[0].textTracks[#{track - 1}].activeCues[0].text", obj)
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
# Return properties of active text cue of associated media
|
|
381
|
+
#
|
|
382
|
+
# @return [Array of Hash] properties of active text cue (:text, :start, :end)
|
|
383
|
+
# @example
|
|
384
|
+
# cue_data = media_player.active_cue_data
|
|
385
|
+
#
|
|
386
|
+
def active_cue_data
|
|
387
|
+
active = active_track
|
|
388
|
+
return nil if active.zero?
|
|
389
|
+
|
|
390
|
+
obj, = find_element(visible = :all)
|
|
391
|
+
object_not_found_exception(obj, @type)
|
|
392
|
+
{
|
|
393
|
+
text: page.execute_script('return arguments[0].textTracks[0].activeCues[0].text', obj),
|
|
394
|
+
start: page.execute_script('return arguments[0].textTracks[0].activeCues[0].startTime', obj),
|
|
395
|
+
end: page.execute_script('return arguments[0].textTracks[0].activeCues[0].endTime', obj)
|
|
396
|
+
}
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
# Return all text cues of active track of associated media
|
|
400
|
+
#
|
|
401
|
+
# @return [Array of Hash] all text cues
|
|
402
|
+
# @example
|
|
403
|
+
# all_captions = media_player.all_cues_text
|
|
404
|
+
#
|
|
405
|
+
def all_cues_text
|
|
406
|
+
active = active_track
|
|
407
|
+
return nil if active.zero?
|
|
408
|
+
|
|
409
|
+
obj, = find_element(visible = :all)
|
|
410
|
+
object_not_found_exception(obj, @type)
|
|
411
|
+
num_cues = page.execute_script('return arguments[0].textTracks[0].cues.length', obj)
|
|
412
|
+
all_text = []
|
|
413
|
+
(1..num_cues).each do |cue|
|
|
414
|
+
all_text.push( { cue - 1 => page.execute_script("return arguments[0].textTracks[0].cues[#{cue - 1}].text", obj) })
|
|
415
|
+
end
|
|
416
|
+
all_text
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
# Return properties of all cues of active track of associated media
|
|
420
|
+
#
|
|
421
|
+
# @return [Array of Hash] properties of all active track cues (:text, :start, :end)
|
|
422
|
+
# @example
|
|
423
|
+
# cue_data = media_player.all_cues_data
|
|
424
|
+
#
|
|
425
|
+
def all_cues_data
|
|
426
|
+
active = active_track
|
|
427
|
+
return nil if active.zero?
|
|
428
|
+
|
|
429
|
+
obj, = find_element(visible = :all)
|
|
430
|
+
object_not_found_exception(obj, @type)
|
|
431
|
+
num_cues = page.execute_script('return arguments[0].textTracks[0].cues.length', obj)
|
|
432
|
+
all_data = []
|
|
433
|
+
(1..num_cues).each do |cue|
|
|
434
|
+
all_data.push(
|
|
435
|
+
{ cue - 1 => {
|
|
436
|
+
text: page.execute_script("return arguments[0].textTracks[0].cues[#{cue - 1}].text", obj),
|
|
437
|
+
start: page.execute_script("return arguments[0].textTracks[0].cues[#{cue - 1}].startTime", obj),
|
|
438
|
+
end: page.execute_script("return arguments[0].textTracks[0].cues[#{cue - 1}].endTime", obj)
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
end
|
|
443
|
+
all_data
|
|
444
|
+
end
|
|
445
|
+
|
|
328
446
|
# Set the media currentTime property
|
|
329
447
|
#
|
|
330
448
|
# @param value [Float] time in seconds
|
metadata
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: testcentricity_web
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.6.
|
|
4
|
+
version: 4.6.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: 2025-
|
|
11
|
+
date: 2025-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: axe-core-cucumber
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: bundler
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|