Class: PageObject::Elements::Media

Inherits:
Element
  • Object
show all
Defined in:
lib/page-object/elements/media.rb

Direct Known Subclasses

Audio, Video

Instance Attribute Summary

Attributes inherited from Element

#element

Instance Method Summary collapse

Methods inherited from Element

#class_name, #click, #disabled?, #enabled?, #initialize, #inspect, #method_missing, plural_form, selenium_identifier_for, #style, watir_identifier_for

Methods included from NestedElements

included

Constructor Details

This class inherits a constructor from PageObject::Elements::Element

Dynamic Method Handling

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

Instance Method Details

#autoplay?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/page-object/elements/media.rb', line 6

def autoplay?
  attribute(:autoplay)
end

#durationObject



18
19
20
21
# File 'lib/page-object/elements/media.rb', line 18

def duration
  duration = attribute(:duration)
  return duration.to_f if duration
end

#ended?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/page-object/elements/media.rb', line 28

def ended?
  attribute(:ended)
end

#has_controls?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/page-object/elements/media.rb', line 10

def has_controls?
  attribute(:controls)
end

#loop?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/page-object/elements/media.rb', line 36

def loop?
  attribute(:loop)
end

#muted?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/page-object/elements/media.rb', line 40

def muted?
  attribute(:muted)
end

#paused?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/page-object/elements/media.rb', line 14

def paused?
  attribute(:paused)
end

#seeking?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/page-object/elements/media.rb', line 32

def seeking?
  attribute(:seeking)
end

#volumeObject



23
24
25
26
# File 'lib/page-object/elements/media.rb', line 23

def volume
  volume = attribute(:volume)
  return volume.to_i if volume
end