https://cypress.io logo
Hello. I have an issue regarding page navigation: ...
# e2e-testing
p
Hello. I have an issue regarding page navigation: In my web application, the page load can be a bit inconsistent. In my
beforeEach
, I navigate to my designated page by using
cy.visit
and then asserting the url contains the page name I wanted to navigate to. Sometimes it doesn't work, even after navigation the url does not contain it. I figured perhaps I use
cy.visit
too early in my test, so I tried to intercept all requests prior to navigation and wait for them to be finished. However, these requests aren't consistent and sometimes they won't happen. There is also no "page loaded" event firing when the load has been completed, so I can't rely on that. What can I do to ensure my navigation actually worked?