Sha256: 339fdaaf839b3fcc1c2377ddac0ee9f0ab8781032c5f443a8e8a7c8ce9a655f1

Contents?: true

Size: 625 Bytes

Versions: 8

Compression:

Stored size: 625 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

          [: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

8 entries across 8 versions & 1 rubygems

Version Path
watir-6.13.0 lib/watir/locators/text_field/locator.rb
watir-6.12.0 lib/watir/locators/text_field/locator.rb
watir-6.11.0 lib/watir/locators/text_field/locator.rb
watir-6.11.0.beta2 lib/watir/locators/text_field/locator.rb
watir-6.11.0.beta1 lib/watir/locators/text_field/locator.rb
watir-6.10.3 lib/watir/locators/text_field/locator.rb
watir-6.10.2 lib/watir/locators/text_field/locator.rb
watir-6.10.0 lib/watir/locators/text_field/locator.rb