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.3.2 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.1 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.3.0 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.9 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.8 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.7 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.6 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.5 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.4 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.3 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.2 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.1 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.0 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.0.dev2 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.2.0.dev lib/watir-webdriver/elements/input.rb
watir-webdriver-0.1.9 lib/watir-webdriver/elements/input.rb
watir-webdriver-0.1.8 lib/watir-webdriver/elements/input.rb