I'd like to find closest parent of an html element in cucumber. just like the .closest() function of jQuery does.
this is my (pseudo) code:
aspect = find('.dropdown li:contains('+selector+')')
dropdown = aspect.closest('.dropdown') #<-- the closest() function does not exist
if not aspect.hasClass('.selected')
dropdown.click
sleep 1
aspect.click
end
can anybody tell me how to accomplish this using Capybara?
Cheers!
Manuel