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.0.0.beta4 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.0.0.beta3 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.0.0.beta2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.0.0.beta1 lib/watir/locators/button/selector_builder/xpath.rb
watir-webdriver-0.9.3 lib/watir-webdriver/locators/button/selector_builder/xpath.rb
watir-webdriver-0.9.2 lib/watir-webdriver/locators/button/selector_builder/xpath.rb