Sha256: 1c9d18e7824037ece1831d3383e33ca24d8f024c1f466048246938c3c407305f

Contents?: true

Size: 897 Bytes

Versions: 7

Compression:

Stored size: 897 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].freeze

    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(opts = {})
      TextField.new(self, opts.merge(tag_name: 'input'))
    end

    def text_fields(opts = {})
      TextFieldCollection.new(self, opts.merge(tag_name: 'input'))
    end
  end # Container

  class TextFieldCollection < InputCollection
    private

    def element_class
      TextField
    end
  end # TextFieldCollection
end # Watir

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
watir-7.1.0 lib/watir/elements/text_field.rb
watir-7.0.0 lib/watir/elements/text_field.rb
watir-7.0.0.beta5 lib/watir/elements/text_field.rb
watir-7.0.0.beta4 lib/watir/elements/text_field.rb
watir-7.0.0.beta3 lib/watir/elements/text_field.rb
watir-7.0.0.beta2 lib/watir/elements/text_field.rb
watir-7.0.0.beta1 lib/watir/elements/text_field.rb