Sha256: 57b4a49f4a05e5e435b3271b180c80f95e0c196c0f787fde0fb6bab94467fa73

Contents?: true

Size: 575 Bytes

Versions: 37

Compression:

Stored size: 575 Bytes

Contents

# encoding: utf-8
module Watir
  class Input < HTMLElement

    alias_method :readonly?, :read_only?

    def enabled?
      !disabled?
    end

    #
    # Return the type attribute of the element, or 'text' if the attribute is invalid.
    # TODO: discuss.
    #
    # @return [String]
    #

    def type
      assert_exists
      value = @element.attribute("type").to_s

      # we return 'text' if the type is invalid
      # not sure if we really should do this
      TextFieldLocator::NON_TEXT_TYPES.include?(value) ? value : 'text'
    end

  end # Input
end # Watir

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
watir-webdriver-0.6.1 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.6.0 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.8 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.7 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.6 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.5 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.4 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.3 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.2 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.1 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.5.0 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.4.1 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.4.0 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.9 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.8 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.7 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.6 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.5 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.4 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.3 lib/watir-webdriver/elements/input.rb