lib/watir-webdriver/elements/input.rb in watir-webdriver-0.0.1.dev vs lib/watir-webdriver/elements/input.rb in watir-webdriver-0.0.1.dev2

- old
+ new

@@ -1,12 +1,21 @@ # encoding: utf-8 module Watir - class Input + class Input < HTMLElement alias_method :readonly?, :read_only? def enabled? !disabled? + end + + def type + assert_exists + value = rescue_no_match { @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 # # not sure about this #