Sha256: ef376faa48bf82861d675a4c904f9f782014d1417375bd8ba4f6017962cd7880

Contents?: true

Size: 960 Bytes

Versions: 38

Compression:

Stored size: 960 Bytes

Contents

module Watir
  module Locators
    class Button
      class Locator < Element::Locator
        def locate_all
          find_all_by_multiple
        end

        private

        def wd_find_first_by(how, what)
          if how == :tag_name
            how  = :xpath
            what = ".//button | .//input[#{selector_builder.xpath_builder.attribute_expression(:input, type: Watir::Button::VALID_TYPES)}]"
          end

          super
        end

        def can_convert_regexp_to_contains?
          # regexp conversion won't work with the complex xpath selector
          false
        end

        def matches_selector?(element, selector)
          if selector.key?(:value)
            copy  = selector.dup
            value = copy.delete(:value)

            super(element, copy) && (value === fetch_value(element, :value) || value === fetch_value(element, :text))
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
watir-6.9.1 lib/watir/locators/button/locator.rb
watir-6.9.0 lib/watir/locators/button/locator.rb
watir-6.8.4 lib/watir/locators/button/locator.rb
watir-6.8.3 lib/watir/locators/button/locator.rb
watir-6.8.2 lib/watir/locators/button/locator.rb
watir-6.8.1 lib/watir/locators/button/locator.rb
watir-6.8.0 lib/watir/locators/button/locator.rb
watir-6.7.3 lib/watir/locators/button/locator.rb
watir-6.7.2 lib/watir/locators/button/locator.rb
watir-6.7.1 lib/watir/locators/button/locator.rb
watir-6.7.0 lib/watir/locators/button/locator.rb
watir-6.6.3 lib/watir/locators/button/locator.rb
watir-6.6.2 lib/watir/locators/button/locator.rb
watir-6.6.1 lib/watir/locators/button/locator.rb
watir-6.6.0 lib/watir/locators/button/locator.rb
watir-6.5.0 lib/watir/locators/button/locator.rb
watir-6.4.3 lib/watir/locators/button/locator.rb
watir-6.4.2 lib/watir/locators/button/locator.rb
watir-6.4.1 lib/watir/locators/button/locator.rb
watir-6.4.0 lib/watir/locators/button/locator.rb