1
0
Fork 0
mirror of https://github.com/teampoltergeist/poltergeist.git synced 2022-11-09 12:05:00 -05:00

make within_frame handle capybara nodes

This commit is contained in:
Jon Leighton 2013-03-03 15:42:40 +00:00
parent 44bdf818f3
commit 3d0e86ca26

View file

@ -101,8 +101,13 @@ module Capybara::Poltergeist
command 'execute', script
end
def within_frame(name, &block)
command 'push_frame', name
def within_frame(handle, &block)
if handle.is_a?(Capybara::Node::Base)
command 'push_frame', handle['id']
else
command 'push_frame', handle
end
yield
ensure
command 'pop_frame'