1
votes

I'm using capybara (1.1.4), poltergeist (1.0.2) and rails (3.2.13). I'm trying to take a screenshot to debug some errors I'm getting. However, both the capybara and poltergeist save screenshot methods aren't working. When I do poltergeist (and all my tests have js: true), I get this:

Failure/Error: save_screenshot('test.png')
     NoMethodError:
       undefined method `save_screenshot' for #<RSpec::Core::ExampleGroup::Nested_1:0x007fb5fcce3178>

When I do the Capybara way I get this:

Failure/Error: page.save_screenshot('screenshot.png')
     NoMethodError:
       undefined method `save_screenshot' for #<Capybara::Session>

I'm completely stumped on why this isn't working and googling has been completely unhelpful. If you need more info, just ask and I'll respond ASAP. I'd really appreciate the help!

1
Is the Capybara::DSL included here? Log out page to check. Otherwise be sure to... require 'capybara' require 'capybara/dsl' require 'capybara/poltergeist' require 'nokogiri'ChuckJHardy
Not sure what you mean by log out page. But even though I required spec_helper.rb and they're all required in there, I put in all the requires and it still didn't work.Anoel
page refers to the Capybara instance/session.ChuckJHardy

1 Answers

4
votes

I noticed you stated you were on poltergeist 1.0.2 yet the syntax you are using is from a later version. Try upgrading to version 1.3.0.