Make sure celerity driver doesn't choke up when no nodes found
This commit is contained in:
parent
10fd24b62b
commit
f74bb11732
|
@ -80,7 +80,7 @@ class Capybara::Driver::Celerity < Capybara::Driver::Base
|
|||
def find(locator)
|
||||
noko_node = Nokogiri::HTML(driver.body).xpath(node.xpath).first
|
||||
all_nodes = noko_node.xpath(locator).map { |n| n.path }.join(' | ')
|
||||
driver.find(all_nodes)
|
||||
if all_nodes.empty? then [] else driver.find(all_nodes) end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue