Sha256: 443935ccb95ef8994f911abbc535b02cb4f7d22a5799efe653b07f2f0b4dc7c2

Contents?: true

Size: 616 Bytes

Versions: 4

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true

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

4 entries across 4 versions & 1 rubygems

Version Path
watir-7.3.0 lib/watir/locators/option/matcher.rb
watir-7.2.2 lib/watir/locators/option/matcher.rb
watir-7.2.1 lib/watir/locators/option/matcher.rb
watir-7.2.0 lib/watir/locators/option/matcher.rb