-
Notifications
You must be signed in to change notification settings - Fork 607
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
Issues using vh units in CSS #785
Comments
What happens if your selectors prop is set to |
@garris then I just get the viewport instead of the fullPage.... |
please post your config. and version info. |
Getting the same issue. Viewport units (maybe just vh) are (more than?) twice what they should be. |
As far as I can tell this may be a Chromy issue: OnetapInc/chromy#117 @justlevine are you also using Chromy? I'd love to just switch to Puppeteer, but it causes a host of other capturing issues that the Chromy plugin doesn't have. (Puppeteer captures incorrect section of the page, rendering the correct dimensions of the element but for the completely wrong coordinates.) |
Has anyone tried bumping the puppeteer version in backstop? Perhaps there will be some improvements? |
See my bug #820 - this seems to be an issue with the way Chrome(y) takes the screenshot by resizing the page - you can reproduce the issue in desktop Chrome by using "Capture Full size screenshot" in the "Developer Tools + mobile view". What I think we need to do is screenshot, scroll, screenshot, scroll and then stitch together. I've no idea of any current + working workaround, but without a work around unfortunately I can't use backstep :( :( :( |
@JamieMcNaught Why doesn't Puppeteer have this issue? Only Chromy does, but I can't use the Puppeteer Backstop engine because it has other bugs. |
I have the same issue, using latest versions of BackstopJS and Puppeteer. "viewports": [
{
"label": "mobile",
"width": 320,
"height": 480
},
],
"engine": "puppeteer",
"onBeforeScript": "puppet/onBefore.js",
"onReadyScript": "puppet/onReady.js" style.less @media @xs-only, @sm-only {
margin: 0 -1rem;
height: 61.5vh;
border-radius: 0;
…
} |
I've made a just-good-enough fix for this so that I can snapshot toyota.com.au, which has CSS that heavily uses VH units: (See Unfortunately this fix crashes on some other sites like lexus.com.au (i.e. no screenshot taken), so your mileage may vary. |
This issue is from 2018, we're now in 2021, should we abandon hope that backstop can be used as a visual regression tool in real life projects, or is this going to be resolved soon? This whole project is super awesome, but this issue is a stopper for myself and countless others unfortunately. If this was fixed, backstop would be an amazing tool for all of us front end engineers, however, with this vh issue, I don't see how anyone could use backstop. Sure there are websites that don't use vh (but most do these days, I would imagine), but imagine you spent the time to add backstop to your first 20+ templates on a project and then you got to one that had vh, boom, you just realized that all of your efforts with backstop were wasted....which is what happened to me. Could someone from the backstop project chime in please and let us know if this is going to be resolved? Just need to know so that we can decide if we should rip backstop out of our project, or continue to wait for a resolution. Please advise. [Edit] @garris I see that you are the maintainer. I personally don't have time to contribute code to the project, but I am happy to do PR reviews and locally test any branches you have laying around that might solve this. I know you work your butt off for this project and like I said it's awesome (except for this blocker), so if you need another set of hands to help review code, please let me know, I'm more than capable and willing to do so. |
@vegaskev thanks for the help. This product is 100% free -- it depends on community for support. I would love if the community would self-organize and solve this problem in a non-breaking way. Please review the PRs and provide feedback. The question I would have is... What solution is the best to resolve this issue and why? |
Here's how I get around this issue: CSS variables to the rescueStep 1: Set all
|
How do I get backstopJS to respect
height: [num]vh
in my css?Theyre getting comically stretched out.
Eg. (viewport: 1366x768, selectors: 'document')
Actual Chrome Browser (1366x768) - showing just the second section, for reference:
Those two stretched-out sections have a
height:90vh
.The text was updated successfully, but these errors were encountered: