Sha256: fc5d7eb6515d5609113b3f2adbdfd158c2ad714eb9dd1ad5fb7fef377cb6c52d
Contents?: true
Size: 705 Bytes
Versions: 39
Compression:
Stored size: 705 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(applied = false) desc = super sibling_query = @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
39 entries across 38 versions & 2 rubygems