Sha256: 73397c8c443544d8d8165eed146a060bf956b53503eea8818cf1a24c9794748c

Contents?: true

Size: 750 Bytes

Versions: 38

Compression:

Stored size: 750 Bytes

Contents

module Celerity

  #
  # Represents an option in a select list.
  #

  class Option < Element
    include ClickableElement
    include DisabledElement

    TAGS = [ Identifier.new('option') ]
    ATTRIBUTES = BASE_ATTRIBUTES | [
                                      :disabled,
                                      :label,
                                      :selected,
                                      :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.getLabelAttribute
    end
  end
end

Version data entries

38 entries across 38 versions & 6 rubygems

Version Path
celerity_thingista-0.9.3 lib/celerity/elements/option.rb
celerity_thingista-0.9.2 lib/celerity/elements/option.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/elements/option.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/elements/option.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/elements/option.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/elements/option.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/elements/option.rb
celerity-0.9.2 lib/celerity/elements/option.rb
celerity-0.9.1 lib/celerity/elements/option.rb
no-click-exception-celerity-0.9.0 lib/celerity/elements/option.rb
celerity-0.9.0 lib/celerity/elements/option.rb
celerity-0.8.9 lib/celerity/elements/option.rb
celerity-0.8.9.pre lib/celerity/elements/option.rb
celerity-0.8.8 lib/celerity/elements/option.rb
celerity-0.8.7 lib/celerity/elements/option.rb
celerity-0.8.6 lib/celerity/elements/option.rb
celerity-0.8.5 lib/celerity/elements/option.rb
celerity-0.8.4 lib/celerity/elements/option.rb
celerity-0.8.2 lib/celerity/elements/option.rb
celerity-0.8.1 lib/celerity/elements/option.rb