Class: Watir::Locators::Button::Matcher

Inherits:
Element::Matcher
  • Object
show all
Defined in:
lib/watir/locators/button/matcher.rb

Instance Method Summary collapse

Instance Method Details

#validate_tag(element, _expected) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/watir/locators/button/matcher.rb', line 7

def validate_tag(element, _expected)
  tag_name = fetch_value(element, :tag_name)
  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