Sha256: 80e25ebcdb17fca2ffd3e7a36f4519477c61e1aa0ede0b45f25768f3de541466

Contents?: true

Size: 943 Bytes

Versions: 11

Compression:

Stored size: 943 Bytes

Contents

# encoding: utf-8
module Watir
  class TextField < Input
    include UserEditable

    attributes Watir::TextArea.typed_attributes
    remove_method :type # we want Input#type here, which was overriden by TextArea's attributes

    private

    def locator_class
      TextFieldLocator
    end

    def selector_string
      selector = @selector.dup
      selector[:type] = '(any text type)'
      selector[:tag_name] = "input or textarea"
      selector.inspect
    end
  end

  module Container
    def text_field(*args)
      TextField.new(self, extract_selector(args).merge(:tag_name => "input"))
    end

    def text_fields(*args)
      TextFieldCollection.new(self, extract_selector(args).merge(:tag_name => "input"))
    end
  end # Container

  class TextFieldCollection < InputCollection
    private

    def locator_class
      TextFieldLocator
    end

    def element_class
      TextField
    end
  end # TextFieldCollection
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
watir-webdriver-0.6.1 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.0 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.8 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.7 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.6 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.5 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.4 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.3 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.2 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.1 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.5.0 lib/watir-webdriver/elements/text_field.rb