Sha256: 31ce8901974f07083d684dc3605c07b12aecce31669d466a6d6d381d0b3ff7fd

Contents?: true

Size: 585 Bytes

Versions: 6

Compression:

Stored size: 585 Bytes

Contents

module Watir
  module Locators
    class Option
      class Matcher < Element::Matcher
        def fetch_value(element, how)
          case how
          when :any
            [element.attribute(:value),
             execute_js(:getTextContent, element).gsub(/\s+/, ' ').strip,
             element.attribute(:label)]
          else
            super
          end
        end

        def matches_values?(found, expected)
          return super unless found.is_a?(Array)

          found.find { |possible| matches_values?(possible, expected) }
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
watir-7.1.0 lib/watir/locators/option/matcher.rb
watir-7.0.0 lib/watir/locators/option/matcher.rb
watir-7.0.0.beta5 lib/watir/locators/option/matcher.rb
watir-7.0.0.beta4 lib/watir/locators/option/matcher.rb
watir-7.0.0.beta3 lib/watir/locators/option/matcher.rb
watir-7.0.0.beta2 lib/watir/locators/option/matcher.rb