Search code examples
ruby-on-rails-3seleniumrspec2capybaraspork

rspec+capybara+selenium+spork not closing browser


The same problem with rails tests as here, but on Mac OS X.

And when I start specs next time, they hang on js specs until I close the browser manually. And those tests fail, I need to restart specs again.

What's the solution here?


Solution

  • https://github.com/timcharper/spork/issues/144

    1) [optional] to close only my processes

    cp /Applications/Firefox.app/Contents/MacOS/firefox-bin /Applications/Firefox.app/Contents/MacOS/firefox-bin-selenium

    Selenium::WebDriver::Firefox.path = "/Applications/Firefox.app/Contents/MacOS/firefox-bin-selenium"
    

    2)

    Spork.each_run do
    \`killall firefox-bin-selenium\`
    end