Sha256: 66cfd8aa6534fd142290ef3f6a12d8f9c4deed062c4174bc8c0359608c80c7fd
Contents?: true
Size: 704 Bytes
Versions: 8
Compression:
Stored size: 704 Bytes
Contents
# frozen_string_literal: true module Capybara module Queries class SiblingQuery < MatchQuery # @api private def resolve_for(node, exact = nil) @sibling_node = node node.synchronize do match_results = super(node.session.current_scope, exact) node.all(:xpath, XPath.preceding_sibling + XPath.following_sibling) do |el| match_results.include?(el) end end end def description desc = super sibling_query = @sibling_node && @sibling_node.instance_variable_get(:@query) desc += " that is a sibling of #{sibling_query.description}" if sibling_query desc end end end end
Version data entries
8 entries across 8 versions & 1 rubygems