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%!)
This seems to be a recent issue: https://github.com/jnicklas/capybara/issues/1035#issuecomment-24301966
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With