Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screenshot_and_save_page only creating the html file in cucumber #178

Open
CID-DAVE opened this issue Jun 18, 2016 · 6 comments
Open

screenshot_and_save_page only creating the html file in cucumber #178

CID-DAVE opened this issue Jun 18, 2016 · 6 comments
Labels

Comments

@CID-DAVE
Copy link

My screenshot_and_save_page is only creating the html file. Doing nothing special in the cucumber test just calling that method.

maybe somebody has a solution.

@zedtux
Copy link

zedtux commented Dec 13, 2016

You're not using a JavaScript driver so no image screenshot. Tag your scenario with @javascript, install a driver like selenium or poltergeist and you'll get your image :)

@alexbannon
Copy link

Any solution here? I'm using rspec and capybara-screenshot and not doing anything particularly special and only getting the html output.

@alexbannon
Copy link

For me, the issue was how I was registering drivers. This eventually put me on the right path: #211 (comment)

require "spec_helper"
require "rspec/rails"
require "selenium-webdriver"
require "capybara/rspec"
require "capybara-screenshot/rspec"

Capybara.register_driver :selenium do |app|
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
    chromeOptions: { args: %w(headless disable-gpu) }
  )

  Capybara::Selenium::Driver.new app,
    browser: :chrome,
    desired_capabilities: capabilities
end

Capybara.javascript_driver = :selenium

@mattheworiordan
Copy link
Owner

Sorry for the delay @alexbannon. Does this issue only happen with headless chrome then? If you are able to provide me with a reproducible bit of code (i.e. ideally a simple app), then I can drop in this gem and work on a more permanent fix.

@mattheworiordan
Copy link
Owner

If so, this is the same issue as #211 right?

@alexbannon
Copy link

Yep looks like it's the same. Feel free to close as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants