garris / garris/BackstopJS

Take screenshot without resizing page

Open
#820 40 comments 7 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

Is there any way to take a screenshot without resizing the page? Unfortunately the template (see here - https://demos.creative-tim.com/now-ui-kit/index.html) I use has some sections which use things like:
.landing-page .page-header {
height: 100vh;
position: relative;
}
which unfortunately means that the page-header element becomes huge when taking the screenshot and doesn't represent what it actually looks like on the device.

See the attached screenshots - the shorter two are taken with "Capture Screenshot", scroll, "Capture Screenshot" etc. The longer one is taken with "Capture full size screenshot" - which is I think what BackstepJS is doing. I would expect the longer one to look like the two shorted ones stitched together, but as you can see it's quite different.

Is there any way to get BackstepJS to screenshot without resizing the page (or whatever it is that it's doing).

Hope this makes sense? Many thanks.

Update: 2018-11-13 - I've replaced the screenshots with links (as the hugescreenshots were overwhelming). However in my comment today (see below) I've added a scaled down comparison of what backstop currently does and how our patch works.
Screen 1
https://user-images.githubusercontent.com/1828283/42628830-33ad21ce-85c9-11e8-8372-e885a5b07f1b.png
Screen 2 (just scrolled down from screen 1)
https://user-images.githubusercontent.com/1828283/42628841-3bee2fae-85c9-11e8-8a4d-f445cc72216b.png

Screenshot from BackstepJS - notice the page has re-layed out and now looks nothing like screens 1 and 2?
https://user-images.githubusercontent.com/1828283/42628843-3ef98356-85c9-11e8-82f3-1c5cc4c1a139.png

Contributor guide

Open the contributing guide

Research direction

No source file or test is named in the issue. Start by reproducing the BackstopJS full-size screenshot against the linked template and compare it with the two viewport screenshots; done means the full screenshot preserves the page layout instead of resizing or reflowing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.