I use capybara 2.1.0 with selenium webdriver
by default, minitest
and test::unit
, and for some tests that need access to the .hover
method, I use the Chrome web browser
At the end of almost every test that needs chrome, I have an empty chrome window that I have to close manually to finish my test.
Here is part of my test assistant:
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 configuration method is overwritten by use_chrome_driver
, called at the beginning of the chrome tests. ie:
def test_example use_chrome_driver ... end
This test_example
will never be completed unless I manually close the Chrome browser. When I manually exit it, the test completes and passes without errors.
So why doesn't this Chrome browser window close automatically every time? (Sometimes it automatically closes ~ 15%!)
Evers source share