lib/capybara/poltergeist/client/browser.coffee in poltergeist-1.15.0 vs lib/capybara/poltergeist/client/browser.coffee in poltergeist-1.16.0
- old
+ new
@@ -17,11 +17,11 @@
[@_counter, @pages] = [0, []]
if @page?
unless @page.closed
@page.clearLocalStorage() if @page.currentUrl() != 'about:blank'
- @page.release()
+ @page.close()
phantom.clearCookies()
@page = @currentPage = new Poltergeist.WebPage
@page.setViewportSize(width: @width, height: @height)
@page.handle = "#{@_counter++}"
@@ -278,11 +278,11 @@
@current_command.sendResponse(true)
close_window: (handle) ->
page = @getPageByHandle(handle)
if page
- page.release()
+ page.close()
@current_command.sendResponse(true)
else
@current_command.sendResponse(false)
mouse_event: (page_id, id, name) ->
@@ -517,9 +517,14 @@
@currentPage.state = 'wait_for_loading'
@currentPage.goForward()
@_waitForHistoryChange()
else
@current_command.sendResponse(false)
+
+ refresh: ->
+ @currentPage.state = 'wait_for_loading'
+ @currentPage.reload()
+ @_waitForHistoryChange()
set_url_whitelist: (wildcards...)->
@currentPage.urlWhitelist = (@_wildcardToRegexp(wc) for wc in wildcards)
@current_command.sendResponse(true)