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

Taking a full size screenshot doesn't work #39

Open
yjukaku opened this issue Jan 28, 2020 · 2 comments · May be fixed by #43
Open

Taking a full size screenshot doesn't work #39

yjukaku opened this issue Jan 28, 2020 · 2 comments · May be fixed by #43

Comments

@yjukaku
Copy link

yjukaku commented Jan 28, 2020

The full: true option to save_screenshot should give back a full sized screenshot, but it doesn't.

I've created a minimal Rails application that reproduces this bug. https://github.com/yjukaku/test_apparition_screenshot

You can see that the screenshot saved doesn't include the full page.

Expected screenshot:

localhost_3002_

Actual

test_full

Environment

  • apparition (0.5.0)
  • capybara (3.31.0)
  • chromedriver-helper (2.1.1)
  • Mac OS X 10.15.2
@henrik
Copy link

henrik commented Jan 31, 2020

I'm sure you're aware, but as a workaround, you can change the window size, e.g.

Capybara.register_driver :apparition do |app|
  Capybara::Apparition::Driver.new(app,
    …
    window_size: [1024, 12345],
  )
end

To be clear, I'm not saying this isn't a bug :)

@benpickles benpickles linked a pull request Mar 5, 2020 that will close this issue
@georf
Copy link

georf commented Jan 12, 2021

I got the same error. I think the following line is the problem:

{ width: document.documentElement.clientWidth, height: document.documentElement.clientHeight}

Here is the context:

        elsif options[:full]
          evaluate <<~JS
            { width: document.documentElement.clientWidth, height: document.documentElement.clientHeight}
          JS
        else

document.documentElement.clientHeight is not the full high of the content. It is the height of the window part. If I use the selector: 'html' option I got the full screenshot.

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

Successfully merging a pull request may close this issue.

3 participants