class PageMagic::Element::Query::MultipleResults

class MultipleResults - use to query for multiple results

Public Instance Methods

find(capybara_element, &block) click to toggle source

Find multiple elements The supplied block will be used to decorate the results @param [Capybara::Node::Element] capybara_element the element to be searched within @return [Array<Capybara::Node::Element>] the results

# File lib/page_magic/element/query/multiple_results.rb, line 12
def find(capybara_element, &block)
  results = capybara_element.all(*selector_args, **options).to_a.tap do |result|
    raise Capybara::ElementNotFound if result.empty?
  end
  results.collect { |result| block.call(result) }
end