如何运行使用硒驱动程序的单个水豚测试?

tyl*_*ler 1 selenium rspec capybara

有很多示例,您可以使用rspec,硒和水豚来运行以如下方式开始的测试:

it "does something", :js => true do
Run Code Online (Sandbox Code Playgroud)

您可以通过运行“ rake spec”来运行所有内容,但是如何运行一个水豚/硒测试?我无法弄清楚我的一生。

zet*_*tic 5

您可以标记一个示例

it "does something", :js => true, :focus => true do

$ rspec . --tag focus
Run Code Online (Sandbox Code Playgroud)

或者,您可以指定规范的行号

$ rspec my_spec.rb:37
Run Code Online (Sandbox Code Playgroud)