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.6.2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.6.1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.6.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.5.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.4.3 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.4.2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.4.1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.4.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.4.0.rc2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.4.0.rc1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.3.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.2.1 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.2.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.1.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.0.3 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.0.2 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.0.1 lib/watir/locators/button/selector_builder/xpath.rb
watir-webdriver-0.9.9 lib/watir-webdriver/locators/button/selector_builder/xpath.rb
watir-6.0.0 lib/watir/locators/button/selector_builder/xpath.rb
watir-6.0.0.beta5 lib/watir/locators/button/selector_builder/xpath.rb