joscas
joscas

Reputation: 7674

NotImplementedError when switching to Poltergeist

I have this cucumber step definitions that work with Selenium but I get NotImplementedError when I try them with the poltergeist driver.

phantom.js is installed and I can even take screenshots from my step definitions that look right. I'm testing an Ember.js/Rails application. See that it visits the page correctly but then it fails when I try to find a link.

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

The exact error is this:

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

Upvotes: 6

Views: 779

Answers (1)

keith
keith

Reputation: 146

I ran into this recently as well - the current release of poltergeist (1.1.0) does not support capybara 2.1.0 - downgrade capybara to 2.0.x and you should be good to go.

Upvotes: 13

Related Questions