Sha256: 68e9ee9a9efca8e7e3ac5074b573408174689f5cadee978122c0d0247f037237

Contents?: true

Size: 963 Bytes

Versions: 8

Compression:

Stored size: 963 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 # TextField

  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 # Watir

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
watir-webdriver-0.6.9 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.8 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.7 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.6 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.5 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.4 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.3 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.6.2 lib/watir-webdriver/elements/text_field.rb