使用ruby 2.4.0p0 , Rails 5.2.3。
在运行rails应用的系统测试用例时出现错误。
Error:
SubscriptionsTest#test_visit_susbcription:
Selenium::WebDriver::Error::WebDriverError: Unable to find chromedriver. Please download the server from
https://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
我的系统测试是这样的。
require "application_system_test_case"
class SubscriptionsTest < ApplicationSystemTestCase
test "visit susbcription" do
visit subscriptions_url
end
end
请提示可能的解决方法。 运行系统测试的命令。
RAILS_ENV=test rails test -v test/system/subscriptions_test.rb
这个问题可以通过在 gemfile 中添加以下 gem 来解决。
gem 'webdrivers', '~> 4.0'