Module: CapybaraTestHelpers::Finders

Included in:
TestHelper
Defined in:
lib/capybara_test_helpers/finders.rb

Overview

Internal: Wraps Capybara finders to be aware of the selector aliases, and to auto-wrap the returned elements with test helpers.

Instance Method Summary collapse

Instance Method Details

#all(*args, **kwargs, &filter) ⇒ Object

Public: Returns all the Capybara nodes that match the specified selector.

Returns an Array of Capybara::Element that match the query.



23
24
25
26
27
28
29
# File 'lib/capybara_test_helpers/finders.rb', line 23

def all(*args, **kwargs, &filter)
  if defined?(::RSpec::Matchers::BuiltIn::All) && args.first.respond_to?(:matches?)
    ::RSpec::Matchers::BuiltIn::All.new(*args, **kwargs)
  else
    find_all(*args, **kwargs, &filter)
  end
end