Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Add deprecation warnings to legacy window methods
Browse files Browse the repository at this point in the history
* Capybara 2.3 provides a new window API.
  • Loading branch information
mhoran committed Jul 14, 2014
1 parent e49886d commit 99f4a88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/capybara/webkit/browser.rb
Expand Up @@ -126,13 +126,21 @@ def get_window_handles
JSON.parse(command('GetWindowHandles'))
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
command('GetWindowHandle')
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)
command("SetConfirmAction", "Yes", options[:text])
Expand Down
2 changes: 2 additions & 0 deletions lib/capybara/webkit/driver.rb
Expand Up @@ -97,6 +97,8 @@ def status_code
end

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)
end

Expand Down

0 comments on commit 99f4a88

Please sign in to comment.