cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.7k stars 3.16k forks source link

After a simple visit, the runner viewport suddenly shrinks in size and it stays like that when I run other tests: #30223

Open matt-vrtula opened 6 days ago

matt-vrtula commented 6 days ago

After a simple visit, the runner viewport suddenly shrinks in size and it stays like that when I run other tests:

Screenshot_1

The test runs fine till the end, but it is very uncomfortable to continue working. I´ve attached a screenshot of the result. It happens consistently for me under these conditions:

What I have tried so far with no result:

The minimal reproducible example in my case is:

beforeEach(() => {
     cy.viewport('iphone-x')
 })
 it('Thhis is it', () => {
     cy.visit('https://www.kimbino.sk/101-drogerie/101-drogerie-letak-od-stredy-04-09-2024-2794364/')
 })

Just wait a few seconds after the test passes and then move the mouse around. The current Cypress version is 13.12.0, running on Windows 10. This issue persists over 20 months.

Originally posted by @matt-vrtula in https://github.com/cypress-io/cypress/discussions/30216

jennifer-shehane commented 6 days ago

I'm not seeing this behavior when I run this test and follow your instructions, maybe some more specifics might help narrow it down (or maybe it is an issue only in Windows??)

This behavior really makes no sense to me and I haven't seen it before. It's almost like the logic of the viewport resizing has jumped up to the outward-most window.

Screenshot 2024-09-11 at 12 44 47 PM

matt-vrtula commented 5 days ago

this is my current configuration: `const { defineConfig } = require('cypress')

module.exports = defineConfig({ defaultCommandTimeout: 10000, runInCICD: false, e2e: { env:{ grepFilterSpecs: true, googleCookiesActive: true, countryId: 'sk', baseUrl: 'https://www.kimbino.sk', trackerUrl: 'https://tracker.prod.ams3.k8s.hyperia.sk/api/v1', scheduleName: '', }, baseUrl: 'https://www.kimbino.sk', specPattern: '*/.cy.js', chromeWebSecurity: false, modifyObstructiveCode: false, keyStrokeDelay: 200, requestTimeout: 20000, hideXHR: true, experimentalMemoryManagement: true, numTestsKeptInMemory: 30, video: false, screenshotOnRunFailure: false, grepFilterSpecs: true, }, })`

The error appears in Chrome 128 and in Edge 128. There´s no problem in Electron. Firefox is not working for some reason, so I couldn´t check.

I am running npx cypress open command to open the gui. The viewport shrinks also when running via npx cypress run --browser chrome --headed --spec ...

There are no extensions installed.