Sha256: 75c07aa5893568d94f695322fb0b4c1d113cafd9304027678fb26e04d0d9fc80

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

module Watizzle
  module Locators
    class Element
      class SelectorBuilder < Watir::Locators::Element::SelectorBuilder
        def build(selector)
          given_xpath_or_css(selector.dup) || build_sizzle_selector(selector)
        end

        private

        def given_xpath_or_css(selector)
          # index/visible should not be present for given_xpath_or_css
          selector.delete(:index)
          selector.delete(:visible)
          super
        end

        def build_sizzle_selector(selectors)
          sizzle_builder.build(selectors)
        end

        def sizzle_builder
          @sizzle_builder ||= Sizzle.new
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watizzle-0.1.0 lib/watizzle/locators/element/selector_builder.rb