Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome driver doesn't quit after capybara test

I'm using capybara 2.1.0 with the selenium webdriver by default, minitest and test::unit, and for some tests who needs to access to the .hover method, I'm using the Chrome webdriver

At the end of almost every test which need chrome, I have a blank chrome window, that I have to close manually to end my test.

Here is a part of my test helper :

def use_chrome_driver
  Capybara.register_driver :selenium_chrome do |app|
    Capybara::Selenium::Driver.new(app, :browser => :chrome)
  end
  Capybara.current_driver = :selenium_chrome
end

def setup
  DatabaseCleaner.start
  Capybara.current_driver = :selenium
end

def teardown
  Capybara.reset_session!
  Capybara.use_default_driver
  DatabaseCleaner.clean
end

The setup method is overwritten by use_chrome_driver called at the beginning of chrome tests. i.e :

def test_example
  use_chrome_driver
  ...
end

This test_example will never quit if I don't close manually the Chrome browser opened. When I manually quit him, the test is finished and passed with no errors.

So why this Chrome browser window doesn't close automatically every time ? (Sometimes it does close automatically ~15%!)

like image 951
Evers Avatar asked Sep 13 '13 12:09

Evers


1 Answers

This seems to be a recent issue: https://github.com/jnicklas/capybara/issues/1035#issuecomment-24301966

like image 168
Brett Porter Avatar answered Oct 04 '22 21:10

Brett Porter