Sha256: 4c05b674d22f4a7b4a87f14185cab5a407ade6cfbedcdfb3ff455545714fe5d4

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

module Watir
  module Locators
    class Cell
      class SelectorBuilder < Element::SelectorBuilder
        def build_wd_selector(selectors)
          return if selectors.values.any? { |e| e.is_a? Regexp }

          expressions = %w[./th ./td]
          attr_expr = xpath_builder.attribute_expression(nil, selectors)

          expressions.map! { |e| "#{e}[#{attr_expr}]" } unless attr_expr.empty?

          xpath = expressions.join(' | ')

          p build_wd_selector: xpath if $DEBUG

          [:xpath, xpath]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-6.14.0 lib/watir/locators/cell/selector_builder.rb