Selenium resets session more thoroughly between tests

This commit is contained in:
Jonas Nicklas 2011-04-07 17:08:32 +02:00
parent 7a9b784dbb
commit 0062f7f432
3 changed files with 7 additions and 3 deletions

View File

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

View File

@ -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
##

View File

@ -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