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.

How to wait for page finish reloading after click?

See original GitHub issue

I got form and when I trigger click on submit button this cause to refresh current page. After that I would like to do some assertions. How I know that page finished refreshing and I can start to searching an element to do assertions?

Looking for something like page.waitForNavigation in Puppeteer.

cy.get('#formButton').click() // adds new item and refresh page
// do assertions on page

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:44
  • Comments:47 (12 by maintainers)

github_iconTop GitHub Comments

520reactions
tivnetcommented, Jun 7, 2018

A workaround I found was

    // click (page starts reloading)
    cy.wait(3000);
    // check the changed content
219reactions
brian-manncommented, Jun 7, 2018

Cypress automatically detects and waits for the page to finish loading. You don’t need to be concerned with it. It will pause command execution, prevent them from timing out, and then begin re-running them once the page transition is complete.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How wait for page finish reloading in cypress after click?
1) Make SPA without refresh and use callback/promise after change DOM; · 2) Set cookie, refresh page, each time when page loaded use...
Read more >
Detect page reload from Cypress test - Gleb Bahmutov
The test finishes suspiciously quickly - in just 1 second, while the asynchronous code executes in 2 seconds. So we know something is...
Read more >
reload - Cypress Documentation
reload () yields the window object after the page finishes loading. It is unsafe to chain further commands that rely on the yielded...
Read more >
How to get Selenium to wait for a page to load - BrowserStack
Wondering how to wait for a web page to load in Selenium testing? Read tutorial to understand 3 methods to execute the same....
Read more >
How to Get Selenium to Wait for Page Load After a Click
Really, I just want a reliable way of waiting until the page has finished loading after I click on a thing. I totally...
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