cypress: Cypress stuck at cy.visit()

Current behavior

I have experienced the following issue before and reported it here #27185 but the website in question was really problematic and the discussion went anywhere but to the point.

I am now experiencing it in the most simple webapp possible: saucedemo.com

The error is this

Your page did not fire its load event within 60000ms

It seems to work is some cases, but I’ll provide instructions on how to reproduce it consistently.

Desired behavior

Cypress should not get stuck at cy.visit()

Test code to reproduce

Run both tests in this repo headed (npx cypress run --headed), or open the suite and run the tests. https://github.com/esbarila/crowdar/tree/master

Cypress Version

12.17.3

Node version

18.16.0

Operating System

Linux (tried in Ubuntu 22.10 and Linux Mint 21)

Debug Logs

CypressError: Timed out after waiting `60000ms` for your remote page to load.

Your page did not fire its `load` event within `60000ms`.

Other

No response

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 10
  • Comments: 38 (7 by maintainers)

Most upvoted comments

I can confirm this is happening in the example repo provided. There are a couple ways I’m able to reproduce the issue show below where the AUT url is not displaying even though the AUT itself appears to have loaded:

cy.visit() error

I can trigger this when running the following command:

npx cypress run --headed

Note: this only appears to happen in electron

I can also trigger it in open mode using the following command:

npx cypress open

Note: this appears to happen in every browser

I was facing this issue. My solution was cypress->developer tools -> View Appdata. here I deleted the “production” folder closed cypress and open it again

cypress 12.17.4 node v20.5.0

Any update on this issue?

Having the same issue with latest cypress 13.6.2 The tests with Chrome 120, stucks at visit command

I have the same issue and none of those workarounds worked for me ;[ the funny thing is that:

  • it started 2 weeks ago without any changes on our end
  • the first test runs fine, the problem is with all subsequent tests

Hi, I was having the same issue (Chrome) and my solution was : cypress.config added chromeWebSecurity: false

const { defineConfig } = require('cypress')

module.exports = defineConfig({

  chromeWebSecurity: false // add this line
})

Cypress v13.6.4

Solution: https://github.com/cypress-io/cypress/issues/19826 cc: @cachafla

Same issue here, first test passes but the subsequent tests are facing :
“Your page did not fire its load event within 60000ms.” Even though my page seems to have loaded. Headed or not does not fix the issue. The tests were running fine before, nothing has changed on my end.

Cypress 13.6.2

I’m getting the same issue after setting up vite-pwa on a Vue application. Removing the file provided by @renzho7 fixed it on the GUI, but it still failed headlessly… currently the only way I got it to work was by deleting the service worker

 cy.visit('/', {
    onBeforeLoad(win) {
      delete win.navigator.__proto__.serviceWorker;
    },
  }); 

Hello everybody, I’ve noticed that while I unregister service worker (using pwa in nuxt) everything works. So with this founding I used

beforeEach(() => {
  if (!window.navigator || !navigator.serviceWorker) {
    return null;
  }
  const cypressPromise = new Cypress.Promise((resolve, reject) => {
    navigator.serviceWorker.getRegistrations().then((registrations) => {
      if(!registrations.length) resolve();
      Promise.all(registrations).then(() => {
        resolve();
      });
    });
  });
  cy.wrap('Unregister service workers').then(() => cypressPromise)
});

and my tests seems to work, hope that will help you all 😃

I was facing this issue. My solution was cypress->developer tools -> View Appdata. here I deleted the “production” folder closed cypress and open it again

cypress 12.17.4 node v20.5.0

tks!!!

Having the same issue with latest cypress 13.6.2 The tests with Chrome 120, stucks at visit command

I have the same issue and none of those workarounds worked for me ;[ the funny thing is that:

  • it started 2 weeks ago without any changes on our end
  • the first test runs fine, the problem is with all subsequent tests

I have this same issue and it only happens on Chrome 120 headlessly (headed works fine)

Chrome 118 the exact same test passes fine headless and headed

Having the same issue with latest cypress 13.6.2 The tests with Chrome 120 stucks at visit command

the first one runs but all below fail, any work around guys?

I was facing this issue. My solution was cypress->developer tools -> View Appdata. here I deleted the “production” folder closed cypress and open it again cypress 12.17.4 node v20.5.0

Thank you @renzho7! After removing the production folder it worked for me for the only one test run and I had to remove it every time and rerun cypress. Thanks for your answer I decided to figure out where exactly in that folder is the problem. So I’ve finally found that you just need to delete this folder: ~/Library/Application Support/Cypress/cy/production/browsers/chrome-stable/interactive/Default/Service Worker/CacheStorage. After removing this folder saucedemo visit constantly works.

The path and the result is here: https://youtu.be/AdcBb6CAofs cc: @MikeMcC399

This works just fine for me 😃 Thanks!

I was facing this issue. My solution was cypress->developer tools -> View Appdata. here I deleted the “production” folder closed cypress and open it again

cypress 12.17.4 node v20.5.0

Thank you @renzho7! After removing the production folder it worked for me for the only one test run and I had to remove it every time and rerun cypress. Thanks for your answer I decided to figure out where exactly in that folder is the problem. So I’ve finally found that you just need to delete this folder: ~/Library/Application Support/Cypress/cy/production/browsers/chrome-stable/interactive/Default/Service Worker/CacheStorage. After removing this folder saucedemo visit constantly works.

The path and the result is here: https://youtu.be/AdcBb6CAofs cc: @MikeMcC399

In our case the problem was caused by an external resource that had no route in our internal network, so it ran into a connection timeout which in turn used up the 60 seconds of the Cypress connection test before the actual tests gets executed.

So I am not sure if this is actually the problem described in this issue but I was able to debug it using the DEBUG env-variable to get extended debug information:

DEBUG="cypress:*" cypress ...

I hope this helps someone with the same issue.

@omartaghlabi

This issue is about the site https://www.saucedemo.com/ producing the error message

Timed out after waiting 60000ms for your remote page to load.

You have a different error message, so it would be better for you to open a different issue so that you can supply all the relevant details, including, for instance, which browser isn’t connecting.

@sumabala9

can you check and let me know if am doing anything mistake here

Sorry for any confusion! I was also not able to get the workaround to solve the problem. We need to wait for further feedback from the Cypress team.