Sha256: f8afc5afd417f27e6750e77a9faa2032ec10826724ad2328ae6ae8de7b212fda

Contents?: true

Size: 913 Bytes

Versions: 8

Compression:

Stored size: 913 Bytes

Contents

module Watir
  class TextField < Input
    include UserEditable

    NON_TEXT_TYPES = %w[file radio checkbox submit reset image button hidden range color]

    protected

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

      if @query_scope.is_a?(Browser) || @query_scope.is_a?(IFrame)
        super
      else
        "#{@query_scope.selector_string} --> #{selector.inspect}"
      end
    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 element_class
      TextField
    end
  end # TextFieldCollection
end # Watir

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
watir-6.10.2 lib/watir/elements/text_field.rb
watir-6.10.0 lib/watir/elements/text_field.rb
watir-6.9.1 lib/watir/elements/text_field.rb
watir-6.9.0 lib/watir/elements/text_field.rb
watir-6.8.4 lib/watir/elements/text_field.rb
watir-6.8.3 lib/watir/elements/text_field.rb
watir-6.8.2 lib/watir/elements/text_field.rb
watir-6.8.1 lib/watir/elements/text_field.rb