切换到Poltergeist时出现NotImplementedError

sub*_*ing 6 cucumber capybara phantomjs poltergeist

我有这个与Selenium一起使用的黄瓜步骤定义,但是NotImplementedError当我尝试使用poltergeist驱动程序时,我得到了它.

安装了phantom.js,我甚至可以从我看来正确的步骤定义中截取屏幕截图.我正在测试Ember.js/Rails应用程序.看到它正确访问了页面,但是当我尝试查找链接时它失败了.

When(/^I visit the App$/) do
  visit("/")
end

Then(/^I should see link "(.*?)"$/) do |arg1|
  find_link(arg1)
end

When(/^I click "(.*?)"$/) do |arg1|
  find_link(arg1).click
end

When(/^I fill in "(.*?)" with "(.*?)"$/) do |arg1, arg2|
  fill_in arg1, :with => arg2
end

When(/^I click "(.*?)" button$/) do |arg1|
  find_button(arg1).click
end
Run Code Online (Sandbox Code Playgroud)

确切的错误是这样的:

When I visit the App                                  # features/step_definitions/sign_in_steps.rb:1
Then I should see link "Sign Up"                      # features/step_definitions/sign_in_steps.rb:5
  NotImplementedError (NotImplementedError)
  ./features/step_definitions/sign_in_steps.rb:6:in `/^I should see link "(.*?)"$/'
  features/sign_in.feature:9:in `Then I should see link "Sign Up"'
Run Code Online (Sandbox Code Playgroud)

小智 13

我最近遇到了这个问题 - 目前发布的恶作剧者(1.1.0)不支持capybara 2.1.0 - 将水豚降级到2.0.x并且你应该好好去.