Attempting to run integration tests using javascript for my application (Chrome being the browser of choice), I encountered an issue where Capybara failed to detect the Selenium driver.
The testing environment consists of:
Linux (Ubuntu 12.10) RoR 3.1 Rspec CapybaraTo address this, I incorporated database_cleaner and made adjustments to my spec_helper and environment as outlined below:
spec_helper
#Database_cleaner
config.use_transactional_fixtures = false
config.before(:each) { DatabaseCleaner.start }
config.after(:each) { DatabaseCleaner.clean }
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
In addition, I downloaded the chromedriver, relocated it to /user/bin, and executed the following command to ensure its functionality:
sudo chmod +x /usr/bin/chromedriver
A failure message surfaced during autotest execution:
Failure/Error: visit root_path
LoadError:
Capybara's selenium driver is unable to load `selenium-webdriver`, please install the gem and add `gem 'selenium-webdriver'` to your Gemfile if you are using bundler.
Seeking assistance in resolving this matter promptly.