Add deprecation warnings to legacy window methods
* Capybara 2.3 provides a new window API.
This commit is contained in:
parent
e49886d668
commit
99f4a88f2f
|
@ -126,13 +126,21 @@ module Capybara::Webkit
|
||||||
JSON.parse(command('GetWindowHandles'))
|
JSON.parse(command('GetWindowHandles'))
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :window_handles, :get_window_handles
|
def window_handles
|
||||||
|
warn '[DEPRECATION] Capybara::Webkit::Browser#window_handles ' \
|
||||||
|
'is deprecated. Please use Capybara::Session#windows instead.'
|
||||||
|
get_window_handles
|
||||||
|
end
|
||||||
|
|
||||||
def get_window_handle
|
def get_window_handle
|
||||||
command('GetWindowHandle')
|
command('GetWindowHandle')
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :window_handle, :get_window_handle
|
def window_handle
|
||||||
|
warn '[DEPRECATION] Capybara::Webkit::Browser#window_handle ' \
|
||||||
|
'is deprecated. Please use Capybara::Session#current_window instead.'
|
||||||
|
get_window_handle
|
||||||
|
end
|
||||||
|
|
||||||
def accept_confirm(options)
|
def accept_confirm(options)
|
||||||
command("SetConfirmAction", "Yes", options[:text])
|
command("SetConfirmAction", "Yes", options[:text])
|
||||||
|
|
|
@ -97,6 +97,8 @@ module Capybara::Webkit
|
||||||
end
|
end
|
||||||
|
|
||||||
def resize_window(width, height)
|
def resize_window(width, height)
|
||||||
|
warn '[DEPRECATION] Capybara::Webkit::Driver#resize_window ' \
|
||||||
|
'is deprecated. Please use Capybara::Window#resize_to instead.'
|
||||||
resize_window_to(current_window_handle, width, height)
|
resize_window_to(current_window_handle, width, height)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue