Selenium resets session more thoroughly between tests
This commit is contained in:
parent
7a9b784dbb
commit
0062f7f432
|
@ -163,7 +163,10 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
|
|||
|
||||
def reset!
|
||||
# Use instance variable directly so we avoid starting the browser just to reset the session
|
||||
@browser.manage.delete_all_cookies if @browser
|
||||
if @browser
|
||||
@browser.manage.delete_all_cookies
|
||||
@browser.navigate.to('about:blank')
|
||||
end
|
||||
end
|
||||
|
||||
def within_frame(frame_id)
|
||||
|
|
|
@ -113,7 +113,8 @@ module Capybara
|
|||
# @return [String] Path of the current page, without any domain information
|
||||
#
|
||||
def current_path
|
||||
URI.parse(current_url).path
|
||||
path = URI.parse(current_url).path
|
||||
path if path and not path.empty?
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
@ -75,7 +75,7 @@ shared_examples_for "session" do
|
|||
@session.current_path.should == '/with_html'
|
||||
|
||||
@session.reset!
|
||||
@session.current_path.should == ""
|
||||
@session.current_path.should be_nil
|
||||
end
|
||||
|
||||
it "resets page body" do
|
||||
|
|
Loading…
Reference in New Issue