Class: Capybara::Queries::SiblingQuery Private
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: 
          self,
           SelectorQuery,BaseQuery | |
| Instance Chain: 
          self,
           SelectorQuery,BaseQuery | |
| Inherits: | Capybara::Queries::SelectorQuery 
 | 
| Defined in: | lib/capybara/queries/sibling_query.rb | 
Constant Summary
Class Method Summary
Instance Attribute Summary
SelectorQuery - Inherited
BaseQuery - Inherited
| #expects_none? | Checks if a count of 0 is valid for the query Returns false if query does not have any count options specified. | 
| #options, #session_options, #session_options=, #count_specified? | |
Instance Method Summary
- #description(applied = false) Internal use only
- #resolve_for(node, exact = nil) Internal use only Internal use only
SelectorQuery - Inherited
BaseQuery - Inherited
| #failure_message | Generates a failure message from the query description and count options. | 
| #matches_count? | Checks if the given count matches the query count options. | 
| #negative_failure_message, #wait, #assert_valid_keys, #count_message, #occurrences | |
Constructor Details
This class inherits a constructor from Capybara::Queries::SelectorQuery
Instance Method Details
#description(applied = false)
[ GitHub ]# File 'lib/capybara/queries/sibling_query.rb', line 19
def description(applied = false) # rubocop:disable Style/OptionalBooleanParameter desc = super sibling_query = @sibling_node&.instance_variable_get(:@query) desc += " that is a sibling of #{sibling_query.description}" if sibling_query desc end
#resolve_for(node, exact = nil)
    This method is for internal use only.
  
  [ GitHub ]
# File 'lib/capybara/queries/sibling_query.rb', line 7
def resolve_for(node, exact = nil) @sibling_node = node node.synchronize do scope = node.respond_to?(:session) ? node.session.current_scope : node.find(:xpath, '/*') match_results = super(scope, exact) siblings = node.find_xpath((XPath.preceding_sibling + XPath.following_sibling).to_s) .map(&method(:to_element)) .select { |el| match_results.include?(el) } Capybara::Result.new(ordered_results(siblings), self) end end