Firefox is slow! Go with Chrome. It's fast and headless. *QT5*
> brew install [email protected] > brew install chromedriver https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#macos-sierra-1012-el-capitan-1011-and-yosemite-1010 *GEMFILE* group :test do gem "database_cleaner" gem "shoulda-matchers", github: "thoughtbot/shoulda-matchers" gem "rspec-rails" gem "rack_session_access" gem "capybara-webkit" gem "launchy" gem "selenium-webdriver" gem "simplecov" end *RAILS_HELPER* Capybara.register_driver :selenium_chrome do |app| Capybara::Selenium::Driver.new(app, :browser => :chrome) end Capybara.default_driver = :selenium_chrome *SCREENSHOTS* You don't need capybara-screenshot. Capybara has screenshots built in now page.save_screenshot('screenshot.png') Ryan Felton 816.591.6257 [email protected] http://www.linkedin.com/in/ryanfelton On Tue, May 30, 2017 at 5:21 AM, Benjamin Wanicur <[email protected]> wrote: > Hi Everyone > > I've been stuck on trying to get rSpec / Capybara / Selenium working > together. I'm getting a strange error message that is not producing many > google results :( > > Here I am trying to use Firefox 47.0.1 and selenium-wedriver 2.53.4 > > > Relevant part of my Gemfile: > > group :test do > gem 'database_cleaner' > gem 'shoulda-matchers', github: 'thoughtbot/shoulda-matchers' > gem 'rack_session_access' > gem "capybara" > gem 'capybara-screenshot' > gem "launchy" > gem 'selenium-webdriver', '2.53.4' > gem 'simplecov' > end > > > Config from spec/rails_helper.rb: > > ## CAPYBARA CONFIG > Selenium::WebDriver::Firefox::Binary.path = "/usr/local/bin/firefox47.0.1- > bin" > Capybara.register_driver :selenium do |app| > Capybara::Selenium::Driver.new( > app, > browser: :firefox, > desired_capabilities: Selenium::WebDriver::Remote:: > Capabilities.firefox(marionette: false) > ) > end > Capybara::Screenshot.prune_strategy = { keep: 10 } > > > > Sample feature test (stripped down): > > require "rails_helper" > > feature 'Blah blah' do > background do > visit '/' > end > > scenario 'blah blah blah', js: true do > expect(page).to have_content('Foobar Company Name') > end > end > > > Error Message: > > An error occurred in an after hook > Selenium::WebDriver::Error::WebDriverError: *unable to start Firefox > cleanly, args: ["-foreground"]* > occurred at *******/.rvm/gems/ruby-2.3.3/gems/selenium-webdriver-2.53. > 4/lib/selenium/webdriver/firefox/binary.rb:97:in > `cope_with_mac_strangeness' > > > I've seen similar error messages online, but not with the failed > ["-foreground"] argument. I've tried a variety of gem versions and/or > Firefox versions. > > -- > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > --- > You received this message because you are subscribed to the Google Groups > "SD Ruby" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby --- You received this message because you are subscribed to the Google Groups "SD Ruby" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
