Sha256: 9d4ecadfe88d4a7d0e223898739f6ca928a3bcbd2b70f9b0eed3aea476d6b7fa

Contents?: true

Size: 651 Bytes

Versions: 13

Compression:

Stored size: 651 Bytes

Contents

module Watir
  module Locators
    class Element
      class Validator
        def validate(element, selector)
          selector_tag_name = selector[:tag_name]
          element_tag_name = element.tag_name.downcase

          if selector_tag_name
            return unless selector_tag_name === element_tag_name
          end

          if element_tag_name == 'input'
            # TODO - Verify this is desired behavior based on https://bugzilla.mozilla.org/show_bug.cgi?id=1290963
            return if selector[:type] && selector[:type] != element.attribute(:type).downcase
          end

          element
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
watir-6.3.0 lib/watir/locators/element/validator.rb
watir-6.2.1 lib/watir/locators/element/validator.rb
watir-6.2.0 lib/watir/locators/element/validator.rb
watir-6.1.0 lib/watir/locators/element/validator.rb
watir-6.0.3 lib/watir/locators/element/validator.rb
watir-6.0.2 lib/watir/locators/element/validator.rb
watir-6.0.1 lib/watir/locators/element/validator.rb
watir-6.0.0 lib/watir/locators/element/validator.rb
watir-6.0.0.beta5 lib/watir/locators/element/validator.rb
watir-6.0.0.beta4 lib/watir/locators/element/validator.rb
watir-6.0.0.beta3 lib/watir/locators/element/validator.rb
watir-6.0.0.beta2 lib/watir/locators/element/validator.rb
watir-6.0.0.beta1 lib/watir/locators/element/validator.rb