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