Class: CapybaraPageObject::MediaElement
- Inherits:
-
Element
- Object
- Element
- CapybaraPageObject::MediaElement
show all
- Defined in:
- lib/capybara_page_object/elements/media_element.rb
Instance Attribute Summary
Attributes inherited from Element
#element, #page
Instance Method Summary
collapse
Methods inherited from Element
#attribute, #class, #enabled?, #focus, #html, #initialize, #method_missing, #native, #parent, #respond_to_missing?, #scroll_into_view, #within
Instance Method Details
#autoplay? ⇒ Boolean
4
5
6
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 4
def autoplay?
true?(attribute(:autoplay))
end
|
#duration ⇒ Object
16
17
18
19
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 16
def duration
duration = attribute(:duration)
return duration.to_f if duration
end
|
#ended? ⇒ Boolean
26
27
28
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 26
def ended?
true?(attribute(:ended))
end
|
#has_controls? ⇒ Boolean
8
9
10
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 8
def has_controls?
true?(attribute(:controls))
end
|
#loop? ⇒ Boolean
34
35
36
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 34
def loop?
true?(attribute(:loop))
end
|
#muted? ⇒ Boolean
38
39
40
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 38
def muted?
true?(attribute(:muted))
end
|
#paused? ⇒ Boolean
12
13
14
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 12
def paused?
true?(attribute(:paused))
end
|
#seeking? ⇒ Boolean
30
31
32
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 30
def seeking?
true?(attribute(:seeking))
end
|
#true?(value) ⇒ Boolean
42
43
44
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 42
def true?(value)
value == true || value == 'true'
end
|
#volume ⇒ Object
21
22
23
24
|
# File 'lib/capybara_page_object/elements/media_element.rb', line 21
def volume
volume = attribute(:volume)
return volume.to_i if volume
end
|