Class: TestCentricity::Video
- Defined in:
- lib/testcentricity_web/web_elements/video.rb
Constant Summary
Constants inherited from UIElement
UIElement::CSS_SELECTORS, UIElement::XPATH_SELECTORS
Instance Attribute Summary
Attributes inherited from UIElement
#alt_locator, #context, #locator, #locator_type, #name, #original_style, #parent, #type
Instance Method Summary collapse
-
#autoplay? ⇒ Boolean
Return video autoplay property.
-
#controls? ⇒ Boolean
Return video controls property.
-
#current_time ⇒ Float
Return video currentTime property.
-
#current_time=(value) ⇒ Object
Set the video currentTime property.
-
#default_muted? ⇒ Boolean
Return video defaultMuted property.
-
#default_playback_rate ⇒ Integer or Float
Return video defaultPlaybackRate property.
-
#duration ⇒ Float
Return video duration property.
-
#ended? ⇒ Boolean
Return video ended property.
-
#initialize(name, parent, locator, context) ⇒ Video
constructor
A new instance of Video.
-
#loop? ⇒ Boolean
Return video loop property.
-
#muted? ⇒ Boolean
Return video muted property.
-
#pause ⇒ Object
Pause the video.
-
#paused? ⇒ Boolean
Return video paused property.
-
#play ⇒ Object
Play the video.
-
#playback_rate ⇒ Integer or Float
Return video playbackRate property.
-
#ready_state ⇒ Integer or Float
Return video readyState property.
-
#seeking? ⇒ Boolean
Return video seeking property.
-
#src ⇒ String
Return video src property.
-
#video_height ⇒ Integer
Return video Height property.
-
#video_width ⇒ Integer
Return video Width property.
-
#volume ⇒ Integer or Float
Return video volume property.
Methods inherited from UIElement
#aria_checked?, #aria_colcount, #aria_describedby, #aria_disabled?, #aria_expanded?, #aria_haspopup?, #aria_hidden?, #aria_invalid?, #aria_label, #aria_labelledby, #aria_live, #aria_pressed?, #aria_readonly?, #aria_required?, #aria_rowcount, #aria_selected?, #aria_sort, #clear_alt_locator, #click, #click_at, #count, #disabled?, #displayed?, #double_click, #drag_and_drop, #drag_by, #enabled?, #exists?, #get_attribute, #get_locator, #get_locator_type, #get_name, #get_native_attribute, #get_object_type, #get_siebel_object_type, #get_value, #height, #hidden?, #highlight, #hover, #hover_at, #invoke_siebel_dialog, #right_click, #role, #send_keys, #set, #set_alt_locator, #set_locator_type, #style, #tabindex, #title, #unhighlight, #verify_value, #visible?, #wait_until_exists, #wait_until_gone, #wait_until_hidden, #wait_until_value_changes, #wait_until_value_is, #wait_until_visible, #width, #x, #y
Constructor Details
#initialize(name, parent, locator, context) ⇒ Video
Returns a new instance of Video.
3 4 5 6 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 3 def initialize(name, parent, locator, context) super @type = :video end |
Instance Method Details
#autoplay? ⇒ Boolean
Return video autoplay property
14 15 16 17 18 19 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 14 def autoplay? obj, = find_element object_not_found_exception(obj, nil) state = obj.native.attribute('autoplay') state.boolean? ? state : state == 'true' end |
#controls? ⇒ Boolean
Return video controls property
40 41 42 43 44 45 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 40 def controls? obj, = find_element object_not_found_exception(obj, nil) state = obj.native.attribute('controls') state.boolean? ? state : state == 'true' end |
#current_time ⇒ Float
Return video currentTime property
130 131 132 133 134 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 130 def current_time obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('currentTime').to_f end |
#current_time=(value) ⇒ Object
Set the video currentTime property
226 227 228 229 230 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 226 def current_time=(value) obj, = find_element object_not_found_exception(obj, nil) page.execute_script('arguments[0].currentTime = arguments[1]', obj, value) end |
#default_muted? ⇒ Boolean
Return video defaultMuted property
79 80 81 82 83 84 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 79 def default_muted? obj, = find_element object_not_found_exception(obj, nil) mute_state = obj.native.attribute('defaultMuted') mute_state.boolean? ? mute_state : mute_state == 'true' end |
#default_playback_rate ⇒ Integer or Float
Return video defaultPlaybackRate property
142 143 144 145 146 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 142 def default_playback_rate obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('defaultPlaybackRate') end |
#duration ⇒ Float
Return video duration property
154 155 156 157 158 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 154 def duration obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('duration').to_f end |
#ended? ⇒ Boolean
Return video ended property
27 28 29 30 31 32 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 27 def ended? obj, = find_element object_not_found_exception(obj, nil) state = obj.native.attribute('ended') state.boolean? ? state : state == 'true' end |
#loop? ⇒ Boolean
Return video loop property
53 54 55 56 57 58 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 53 def loop? obj, = find_element object_not_found_exception(obj, nil) loop_state = obj.native.attribute('loop') loop_state.boolean? ? loop_state : loop_state == 'true' end |
#muted? ⇒ Boolean
Return video muted property
66 67 68 69 70 71 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 66 def muted? obj, = find_element object_not_found_exception(obj, nil) mute_state = obj.native.attribute('muted') mute_state.boolean? ? mute_state : mute_state == 'true' end |
#pause ⇒ Object
Pause the video
248 249 250 251 252 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 248 def pause obj, = find_element object_not_found_exception(obj, nil) page.execute_script('arguments[0].pause()', obj) end |
#paused? ⇒ Boolean
Return video paused property
92 93 94 95 96 97 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 92 def paused? obj, = find_element object_not_found_exception(obj, nil) paused_state = obj.native.attribute('paused') paused_state.boolean? ? paused_state : paused_state == 'true' end |
#play ⇒ Object
Play the video
237 238 239 240 241 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 237 def play obj, = find_element object_not_found_exception(obj, nil) page.execute_script('arguments[0].play()', obj) end |
#playback_rate ⇒ Integer or Float
Return video playbackRate property
166 167 168 169 170 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 166 def playback_rate obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('playbackRate') end |
#ready_state ⇒ Integer or Float
Return video readyState property
178 179 180 181 182 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 178 def ready_state obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('readyState') end |
#seeking? ⇒ Boolean
Return video seeking property
105 106 107 108 109 110 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 105 def seeking? obj, = find_element object_not_found_exception(obj, nil) state = obj.native.attribute('seeking') state.boolean? ? state : state == 'true' end |
#src ⇒ String
Return video src property
118 119 120 121 122 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 118 def src obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('src') end |
#video_height ⇒ Integer
Return video Height property
202 203 204 205 206 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 202 def video_height obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('videoHeight') end |
#video_width ⇒ Integer
Return video Width property
214 215 216 217 218 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 214 def video_width obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('videoWidth') end |
#volume ⇒ Integer or Float
Return video volume property
190 191 192 193 194 |
# File 'lib/testcentricity_web/web_elements/video.rb', line 190 def volume obj, = find_element object_not_found_exception(obj, nil) obj.native.attribute('volume') end |