lib/celerity/elements/option.rb in celerity-0.0.4 vs lib/celerity/elements/option.rb in celerity-0.0.6
- old
+ new
@@ -1,18 +1,32 @@
module Celerity
- # Represents a select list option.
+
+ #
+ # Represents an option in a select list.
+ #
+
class Option < Element
include ClickableElement
include DisabledElement
-
+
TAGS = [ Identifier.new('option')]
ATTRIBUTES = BASE_ATTRIBUTES | [:selected, :disabled, :label, :value]
DEFAULT_HOW = :text
alias_method :select, :click
+ #
+ # Is this option selected?
+ #
+
def selected?
assert_exists
@object.isSelected
+ end
+
+ def label
+ # overrides Container#label
+ assert_exists
+ @object.getAttribute("label")
end
end
end
\ No newline at end of file