You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use cy.visit('/'), the page is re-visited and states are reset. (see code A, C)
However, when I use cy.visit('/#blank') (URL with hash), the page is not re-visited and states are retained. (see code B)
I believe this is expected behavior with hashes - to not revisit the page since it's just traversing to a hash. Go to https://docs.cypress.io/guides/overview/why-cypress then click on a menu on the righthand side, the page does not reload to go to https://docs.cypress.io/guides/overview/why-cypress#Setting-up-tests
Are there any way to force browser reload? I am developing single page application whose all URLs have a hash. I need methods to isolate each test cases.
If you need to force route reloading, you can make a new test (this will destroy the entire iframe) or you can use cy.reload which is defined here after setting the hash with cy.visit(...).
cy.reload basically calls document.location.reload under the hood.
Current behavior
When I use
cy.visit('/')
, the page is re-visited and states are reset. (see code A, C)However, when I use
cy.visit('/#blank')
(URL with hash), the page is not re-visited and states are retained. (see code B)It cause unexpected influence between tastcases.
Desired behavior
cy.visit
should always visit the specified page.Test code to reproduce
Cypress Version
8.0.0
Other
It may related to #225
The text was updated successfully, but these errors were encountered: