question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress sets the height of the size-container to 0px

See original GitHub issue

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 to 0px(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 with cy.viewport() after visiting the page with cy.visit() but then I ended up with so many cy.viewport() in my test suites.

Cypress wrong viewport size

Desired behavior:

The height of the .size-container should not be 0px.

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:

  • They redirect from another route via react-router: when you go to the route forum/list, it will redirect you to forum/list/:category/:sort/.
  • They use Chinese characters in the URL: something like 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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jennifer-shehanecommented, Apr 25, 2019

Closing as resolved. Please comment if you are still having this issue and we will consider reopening.

1reaction
jennifer-shehanecommented, Apr 25, 2019

@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 cypress.json config:

{
  "blacklistHosts": ["www.googletagmanager.com"]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to check if element width is less than or equal to a ...
I am testing this to make sure the element resizes correctly. This is easy to do in Cypress, where I can toggle the...
Read more >
cy.viewport()
To set the viewport size and dimension, use the cy.viewport() command. ... a set of preset sizes // to easily set the screen...
Read more >
A Complete Guide To CSS Container Queries
This blog dive deeps into the concept of CSS Container Queries and why it can become a game-changing feature.
Read more >
A Complete Guide To CSS Container Queries
It assigns a query container to an element. Depending on the value, descendants can query aspects of its size, layout, style, and state...
Read more >
font - CSS: Cascading Style Sheets - MDN Web Docs
The font CSS shorthand property sets all the different properties of an element's ... Set the font size to 12px and the line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found