Sha256: e4a8dbec41f3517b6064a5498b15eac85c6e1b8144f41714c3f6004b22ba3842

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

module Watir
  module Locators
    class TextField
      class Locator < Element::Locator
        private

        def using_selenium(*)
          # force Watir usage
        end

        def matches_selector?(element, rx_selector)
          rx_selector = rx_selector.dup

          tag_name = element.tag_name.downcase

          %i[text value label].each do |key|
            if rx_selector.key?(key)
              correct_key = tag_name == 'input' ? :value : :text
              rx_selector[correct_key] = rx_selector.delete(key)
            end
          end

          super
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-6.14.0 lib/watir/locators/text_field/locator.rb