如何使用Thin服务器而不是默认的Webrick来运行黄瓜硒?

Aut*_*act 6 selenium thin cucumber ruby-on-rails-3

我的黄瓜使用默认的Webrick服务器进行selenium运行(对于Rails 3应用程序).

如何强制或设置与Thin服务器而不是Webrick一起运行?要放入env.rb文件的任何设置还是其他?

Mat*_* J. 6

这是使用最近的水豚来实现这一目标的新方法

require "rack/handler/unicorn"
Capybara.register_server(:unicorn) do |app, port, host|
  Rack::Handler::Unicorn.run(app, :Port => port)
end
Capybara.server = :unicorn
Run Code Online (Sandbox Code Playgroud)

  • 工作一种享受.注册后,我还必须设置服务器; `Capybara.server =:独角兽`. (2认同)

Jos*_*hua 0

两种方式:

1)关闭水豚内置服务器并自行运行。

2)看起来有人在这里修补了该功能https://github.com/jnicklas/capybara/pull/175

  • 只需在 Gemfile 中包含瘦服务器 gem `gem "thin"` 也可以。 (2认同)