Method: PageMagic::Element::Query#execute

Defined in:
lib/page_magic/element/query.rb

#execute(capybara_element, &block) ⇒ Array<Capybara::Node::Element>, NullElement

TODO: - test for decoration? Run query against the scope of the given element The supplied block will be used to decorate the results

Parameters:

  • capybara_element (Capybara::Node::Element)

    the element to be searched within

Returns:

  • (Array<Capybara::Node::Element>)

    the results

  • (NullElement)

    when the element is not found



25
26
27
28
29
# File 'lib/page_magic/element/query.rb', line 25

def execute(capybara_element, &block)
  find(capybara_element, &(block || DEFAULT_DECORATOR))
rescue Capybara::ElementNotFound => e
  NotFound.new(e)
end