Sha256: 1d70a0c386da7bfb1a384675eae937b9521e508f5bac53e54fcec3f546efd076

Contents?: true

Size: 933 Bytes

Versions: 6

Compression:

Stored size: 933 Bytes

Contents

module Watir
  class TextField < Input
    include UserEditable

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

    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

6 entries across 6 versions & 1 rubygems

Version Path
watir-6.13.0 lib/watir/elements/text_field.rb
watir-6.12.0 lib/watir/elements/text_field.rb
watir-6.11.0 lib/watir/elements/text_field.rb
watir-6.11.0.beta2 lib/watir/elements/text_field.rb
watir-6.11.0.beta1 lib/watir/elements/text_field.rb
watir-6.10.3 lib/watir/elements/text_field.rb