Sha256: 4aedbd4bd4aabd14f92032501ee8cb0e222893907fdd9da2fba3003e0c499ba3

Contents?: true

Size: 707 Bytes

Versions: 46

Compression:

Stored size: 707 Bytes

Contents

module Watir
  module Locators
    class Button
      class SelectorBuilder
        class XPath < Element::SelectorBuilder::XPath
          def lhs_for(building, key)
            if building == :input && key == :text
              "@value"
            else
              super
            end
          end

          private

          def equal_pair(building, key, value)
            if building == :button && key == :value
              # :value should look for both node text and @value attribute
              text = XpathSupport.escape(value)
              "(text()=#{text} or @value=#{text})"
            else
              super
            end
          end
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
watir-6.13.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.12.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.11.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.11.0.beta2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.11.0.beta1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.10.3 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.10.2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.10.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.9.1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.9.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.8.4 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.8.3 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.8.2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.8.1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.8.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.7.3 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.7.2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.7.1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.7.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.6.3 lib/watir/locators/button/selector_builder/xpath.rb