切换到Poltergeist时出现NotImplementedError

时间:2013-04-10 16:31:29

标签: cucumber capybara phantomjs poltergeist

我有这个 cucumber 步骤定义适用于Selenium但是当我使用 poltergeist 驱动程序尝试时,我得到NotImplementedError

安装了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

确切的错误是:

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"'

1 个答案:

答案 0 :(得分:13)

我最近也遇到了这个问题 - 当前版本的恶作剧者(1.1.0)不支持capybara 2.1.0 - 将capybara降级到2.0.x并且你应该好好去。