【发布时间】:2019-09-22 00:52:20
【问题描述】:
我将Rails-App 设置为Capybara。测试工作正常,但我收到此错误:
2019-05-03 14:51:58 警告硒 [弃用] Selenium::WebDriver::Chrome#driver_path= 已弃用。采用 Selenium::WebDriver::Chrome::Service#driver_path=。
宝石文件
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
test_helper.rb (有或没有禁用线没有区别)
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'capybara/rspec'
require 'rspec/rails'
require 'capybara/rails'
RSpec.configure do |config|
# Capybara.register_driver :chrome do |app|
# Capybara::Selenium::Driver.new app, browser: :chrome,
# options: Selenium::WebDriver::Chrome::Options.new(args: %w[headless disable-gpu])
# end
# Capybara.javascript_driver = :chrome
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.shared_context_metadata_behavior = :apply_to_host_groups
Kernel.srand config.seed
end
有什么想法吗?
【问题讨论】:
标签: ruby-on-rails ruby selenium selenium-webdriver selenium-chromedriver