Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"'
like image 686
joscas Avatar asked Apr 10 '13 16:04

joscas


1 Answers

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.

like image 78
keith Avatar answered Nov 06 '22 21:11

keith