Sha256: 22b483365ee185c5fb9e474dddb4b924eb25d00beff6cc8cb3f5f5c6e18a07f8

Contents?: true

Size: 553 Bytes

Versions: 8

Compression:

Stored size: 553 Bytes

Contents

module Watir
  module Locators
    class TextField
      class Validator < Element::Validator
        VALID_TEXT_FIELD_TAGS = %w[input textarea]

        def validate(element, selector)
          element_tag_name = element.tag_name.downcase

          if element.tag_name.downcase == 'textarea'
            warn "Locating textareas with '#text_field' is deprecated. Please, use '#textarea' method instead."
          end
          return unless VALID_TEXT_FIELD_TAGS.include?(element_tag_name)

          element
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
watir-webdriver-0.9.9 lib/watir-webdriver/locators/text_field/validator.rb
watir-6.0.0.beta5 lib/watir/locators/text_field/validator.rb
watir-6.0.0.beta4 lib/watir/locators/text_field/validator.rb
watir-6.0.0.beta3 lib/watir/locators/text_field/validator.rb
watir-6.0.0.beta2 lib/watir/locators/text_field/validator.rb
watir-6.0.0.beta1 lib/watir/locators/text_field/validator.rb
watir-webdriver-0.9.3 lib/watir-webdriver/locators/text_field/validator.rb
watir-webdriver-0.9.2 lib/watir-webdriver/locators/text_field/validator.rb