Sha256: 1be195eff1e88779faa24b65c4509c9b5ae1622a9b6cf6dcee4d3f5ce5debf43

Contents?: true

Size: 935 Bytes

Versions: 3

Compression:

Stored size: 935 Bytes

Contents

module Watir
  class TextField < Input
    include UserEditable

    inherit_attributes_from Watir::TextArea
    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

3 entries across 3 versions & 1 rubygems

Version Path
watir-webdriver-0.9.1 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.9.0 lib/watir-webdriver/elements/text_field.rb
watir-webdriver-0.8.0 lib/watir-webdriver/elements/text_field.rb