Class: CapybaraPageObject::MediaElement

Inherits:
Element
  • Object
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

Constructor Details

This class inherits a constructor from CapybaraPageObject::Element

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CapybaraPageObject::Element

Instance Method Details

#autoplay?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/capybara_page_object/elements/media_element.rb', line 4

def autoplay?
  true?(attribute(:autoplay))
end

#durationObject



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

Returns:

  • (Boolean)


26
27
28
# File 'lib/capybara_page_object/elements/media_element.rb', line 26

def ended?
  true?(attribute(:ended))
end

#has_controls?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/capybara_page_object/elements/media_element.rb', line 8

def has_controls?
  true?(attribute(:controls))
end

#loop?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/capybara_page_object/elements/media_element.rb', line 34

def loop?
  true?(attribute(:loop))
end

#muted?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/capybara_page_object/elements/media_element.rb', line 38

def muted?
  true?(attribute(:muted))
end

#paused?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/capybara_page_object/elements/media_element.rb', line 12

def paused?
  true?(attribute(:paused))
end

#seeking?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/capybara_page_object/elements/media_element.rb', line 30

def seeking?
  true?(attribute(:seeking))
end

#true?(value) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/capybara_page_object/elements/media_element.rb', line 42

def true?(value)
  value == true || value == 'true'
end

#volumeObject



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