Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot do save_screenshot give NotSupportedByDriver in Capybara/Poltergeist

I am running Capybara with Poltergeist and I have a step:

Given(/^take a screenshot$/) do
  page.save_screenshot("/tmp/page.png", :full => true)
end

And it keeps saying:

Capybara::Driver::Base#save_screenshot (Capybara::NotSupportedByDriverError)
./features/step_definitions/job_steps.rb:19:in `/^take a screenshot$/'
features/jobs_board/user_management.feature:9:in `And take a screenshot'

Any ideas where to look? My config in env.rb looks like this:

Capybara.javascript_driver = :poltergeist
Capybara.current_driver = :poltergeist
like image 404
RedMage Avatar asked Jan 20 '14 15:01

RedMage


1 Answers

Figured it out. I needed to add:

Capybara.default_driver = :poltergeist 

And change

require 'poltergeist'

to

require 'capybara/poltergeist'
like image 95
RedMage Avatar answered Nov 09 '22 19:11

RedMage