Closed vpetrache closed 6 years ago
This is the local Storage when the visit command fails.
@vpetrache It appears that your application is not firing it's load
event within 60 seconds.
Have you tried increasing the timeout to allow more time for your page to load? cy.visit('url', { timeout: 80000 })
Can you verify that your app is firing the load event and Cypress is incorrectly logging this error anyway?
I encountered a similar issue very often. even the same test. sometimes it just fails. I wonder if anyway that we can debug or capture more log for troubleshooting.
CypressError: Timed out after waiting '50000ms' for your remote page to load.
Your page did not fire its 'load' event within '50000ms'.
You can try increasing the 'pageLoadTimeout' value in 'cypress.json' to wait longer.
Browsers will not fire the 'load' event until all stylesheets and scripts are done downloading.
When this 'load' event occurs, Cypress will continue running commands.
Because this error occurred during a 'before all' hook we are skipping the remaining tests in the current suite: 'Account Setup'
I also encountered this issue. We are running our app in a docker container on the bitbucket pipelines, and then run cypress tests which randomly fail (we reran it a few times, and each time other tasks fail). After bumping the value to 3 minutes it seems not to happen anymore.
@EdwinMeijne @jennifer-shehane Increasing the load timeout to 120000 fixed the issue. Thanks for the solution.
I have to come back from my previous statement; I just had failing tests again. I will bump now to 5 minutes to see if that resolves it as we add more tests (we are mainly writing tests currently)
@EdwinMeijne We're having the same issue. Identical setup
We're also experiencing the same issue, with a React SPA, even though the page is visibly done loading in the screenshot taken by Cypress. This only happens in CI, and also only randomly.
We'll need a reproducible example to reopen this issue. Can anyone provide a way to reproduce this?
After tuning the timeouts to 30000
we haven't run into this issue in CI. Sometimes on very busy machines. If people still need help with the bitbucket setup, etc. feel free to ask
Everything works perfectly locally, but when ran on Bitbucket Pipelines, it flakes out consistently.
Adding cy.visit('url', { timeout: 30000 })
solved it. Thanks!
Something about Docker makes it need more time.
I wonder if there is a way to retry the commands once or twice before failing? that way we wound't need to bump the timeout too high because if the page randomly got stuck on loading, it doesn't matter how long the wait it, because it just makes the whole testing suite to be very slow.
@rodrigovolkmer There is an issue open regarding retrying tests / commands here: https://github.com/cypress-io/cypress/issues/1313 with some current workarounds to implement this.
How can we just try a retry, if cy.visit() fails once?
@canderson22 See this thread: https://github.com/cypress-io/cypress/issues/1313 Also this plugin: https://github.com/Bkucera/cypress-plugin-retries
before(()=>{
cy.visit((URL, {timeout: 80000 }); //Color Screen
cy.login();
});
url is redirection, meaning its callas login.aspx but get back default.aspx. Server redirects it to different page.
"before all" hook for "Test numeric field":
CypressError: Timed out after waiting `80000ms` for your remote page to load.
Your page did not fire its `load` event within `80000ms`.
You can try increasing the `pageLoadTimeout` value in `cypress.json` to wait longer.
Browsers will not fire the `load` event until all stylesheets and scripts are done downloading.
When this `load` event occurs, Cypress will continue running commands.
Because this error occurred during a `before all` hook we are skipping the remaining tests in the current suite: `Test screen feature II`
at timedOutWaitingForPageLoad (URL__cypress/runner/cypress_runner.js:144463:13)
at (URL/__cypress/runner/cypress_runner.js:145424:16
at tryCatcher ((URL/__cypress/runner/cypress_runner.js:10384:23)
at(URL/__cypress/runner/cypress_runner.js:5506:41
at tryCatcher ((URL/__cypress/runner/cypress_runner.js:10384:23)
at Promise._settlePromiseFromHandler ((URL/__cypress/runner/cypress_runner.js:8319:31)
at Promise._settlePromise ((URL/__cypress/runner/cypress_runner.js:8376:18)
at Promise._settlePromise0 ((URL/__cypress/runner/cypress_runner.js:8421:10)
at Promise._settlePromises ((URL/__cypress/runner/cypress_runner.js:8497:18)
at _drainQueueStep ((URL/__cypress/runner/cypress_runner.js:5091:12)
at _drainQueue ((URL/__cypress/runner/cypress_runner.js:5084:9)
at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues ((URL/__cypress/runner/cypress_runner.js:5100:5)
at Async.drainQueues ((URL/__cypress/runner/cypress_runner.js:4970:14)
From Your Spec Code:
at Context.eval ((URL/__cypress/tests?p=cypress\integration\screen-feature-2.rkumar.spec.js:18:8)
I had this same error, and realized I hadn't updated Cypress for a VERY LONG time. haha. I was at version 3.8.2. I updated to 4.8.0 and it worked perfect.
I am facing this issue because domain changes on my app in between. Any solution?
I'm facing this issue with Cypress 9.5.0.
There are no domain switching in between or anything like that. It is very random.
I was able to see it on the videos from the pipeline: Page just loads almost instantly but cy.visit
is still waiting.
As a temporary workaround - I'm enabling the retries for now.
Would be nice to get it sorted.
Having the same issue in Cypress 9.4.1. The bug has to be reopened @jennifer-shehane
@jennifer-shehane having the same issue in Cypress 9.5.4, even trying to use the "retries" plugin, my problem was not solved. =(
Having the same issue in Cypress 9.4.1. The bug has to be reopened @jennifer-shehane
Did you find any solution for this error?
I have the same problem running my tests. It mostly occurs after a few longer tests have been run (in Gitlab CI). At some point cy.visit() will return a 500 error.
Having the same issue in Cypress 12.9.0.
@zsaidov please open a new issue with a reproducible example and the Cypress team will be happy to investigate.
Current behavior:
Desired behavior:
The test should not fail in cy.visit() command.
Steps to reproduce:
Sorry for not providing the app's url.
I get the same behavior if try to run the tests with
cypress open
orcypress run
.I don't know if it's a OS issue or its an issue with the steps I wrote or caching.
The problem occurs randomly, sometimes disconnected/connected the ethernet cable and the tests worked. Sometimes I retry running the tests and it works.
It's important to state that before running each spec I do
clearCache
andlocalStorage
as it caused problems in the past.Versions
Cypress: 3.1.0 NodeJS: 8.12.0 OS: MacOS Mojave 10.14
Any solution is welcomed. Thanks in advance!