Sha256: 550a53c8a2720b7757765b1e0b46760acab1e1cf121069071c1869a101613f3c

Contents?: true

Size: 526 Bytes

Versions: 5

Compression:

Stored size: 526 Bytes

Contents

module Watir
  module Locators
    class Button
      class Validator < Element::Validator
        def validate(element, _selector)
          tag_name = element.tag_name.downcase
          return unless %w[input button].include?(tag_name)
          # TODO - Verify this is desired behavior based on https://bugzilla.mozilla.org/show_bug.cgi?id=1290963
          return if tag_name == "input" && !Watir::Button::VALID_TYPES.include?(element.attribute(:type).downcase)

          element
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
watir-6.13.0 lib/watir/locators/button/validator.rb
watir-6.12.0 lib/watir/locators/button/validator.rb
watir-6.11.0 lib/watir/locators/button/validator.rb
watir-6.11.0.beta2 lib/watir/locators/button/validator.rb
watir-6.11.0.beta1 lib/watir/locators/button/validator.rb