1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

remove support for Driver#within_frame

This commit is contained in:
Thomas Walpole 2016-08-17 14:07:44 -07:00
parent 1bb9a73c9e
commit 71f0c8578f

View file

@ -418,30 +418,12 @@ module Capybara
# @overload within_frame(index)
# @param [Integer] index index of a frame (0 based)
def within_frame(*args)
frame = _find_frame(*args)
begin
switch_to_frame(frame)
switch_to_frame(_find_frame(*args))
begin
yield
ensure
switch_to_frame(:parent)
end
rescue Capybara::NotSupportedByDriverError
# Support older driver frame API for now
if driver.respond_to?(:within_frame)
begin
scopes.push(:frame)
driver.within_frame(frame) do
yield
end
ensure
scopes.pop
end
else
raise
end
end
end
##
@ -915,7 +897,6 @@ module Capybara
end
def _find_frame(*args)
within(document) do # Previous 2.x versions ignored current scope when finding frames - consider changing in 3.0
case args[0]
when Capybara::Node::Element
args[0]
@ -930,7 +911,6 @@ module Capybara
raise TypeError
end
end
end
def _switch_to_window(window = nil, options= {})
options, window = window, nil if window.is_a? Hash