-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Cypress sets the height of the size-container to 0px #2052
Comments
This should definitely not be happening. A lot of the height calculations are done in this file: https://github.com/cypress-io/cypress/blob/develop/packages/runner/src/lib/state.js#L3 So, it's initially set to 660 and then adjusted depending on the scale/resizing of the window. Do you have anything in your Also - this is likely unrelated, but could you try setting |
Thanks for the quick reply, Jennifer!
Nope, I only use {
"baseUrl": "http://localhost:3000/"
} And I'm not usning env variables when running
No, it's not changing anything. Thanks for the help :) |
@konekoya Do you have any code within your application that does deal with setting the height of this element or other elements on the page? This one is a weird one to track down and would be best if we could get a public url or reproducible example to try this on. I know that's difficult sometimes though. |
@konekoya hello, we're also experiencing this issue in our tests and it's super hard to reproduce (next to impossible). However, today I've noticed a particular case and I wonder if that's also true for you. I have single test running in two suits on different versions of my site. In one test passes without any problems and I cannot see any exceptions or errors in JS console. On the other, however, I see that one of the script files failed to load with 404 and in this particular case Cypress constantly (!) loads page in 0px height container. |
@tkociemba-olx Could you try blacklisting the googletagmanager consistently and see if this happens due to that? https://on.cypress.io/configuration#blacklistHosts So in your {
"blacklistHosts": ["www.googletagmanager.com"]
} |
@jennifer-shehane I've tried what you suggested and the test has passed. Unfortunately it also passed without this entry, so I guess it wasn't the reason after all. What I noticed though, is that today my page loads different set of advertisements than yesterday, which makes me to believe that the problem isn't with gtm but with some external scripts being loaded through one of our various ad partners. I can try to blacklist them all and see if we still have this problem. I wonder if there would be a way to blacklist all external domains and maybe whitelist ones relevant to the page I'm testing. Edit: I've done exactly that, blacklisted every single external host and what do you know - no grey screen (no 0px height container). Our test suites are as green as they should be. |
@tkociemba-olx Someone has opened a PR to pass a whitelist options for hosts #1451 |
Closing as resolved. Please comment if you are still having this issue and we will consider reopening. |
@jennifer-shehane sorry, I'm not working on the project anymore. So it's difficult for me to provide a reproducible example 😅 |
Hi there,
Current behavior:
I'm working on a single page web app that is built with React, React router 3.x and Redux. I use Cypress to test login, signup, create posts pages, etc. It all works well. But when I'm testing two particular pages. Their page height(on
.size-container
element) is sometimes set to0px
(see the screenshot, click on the screenshot to get a bigger view). And so the page cannot be seen. The test can be passed when I reset the viewport withcy.viewport()
after visiting the page withcy.visit()
but then I ended up with so manycy.viewport()
in my test suites.Desired behavior:
The height of the
.size-container
should not be0px
.Steps to reproduce:
I've been trying to reproduce this bug but without success.
These two particular pages are a bit different when compare with others:
forum/list
, it will redirect you toforum/list/:category/:sort/
.forum/list/中文/中文
Versions
Cypress: 3.0.1
OS: macOS High Sierra 10.13.5
Browser: Google Chorme 67.0.3396.99 (Official Build) (64-bit)
Sorry, I know this is not a valid bug report since I cannot reproduce the bug. But I've been battling with this bug for two days and cannot find any directions from Google or stackoverflow.
Thanks for the help!
The text was updated successfully, but these errors were encountered: