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:
parent
44bdf818f3
commit
3d0e86ca26
1 changed files with 7 additions and 2 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue