We used cy.session for a while, so each test started cleared of outdated cache. However, we have a limitation that forced us to not use it. Now, the testing proccess is the following:
1. We log into the system which takes us to a landing page, without cy.session (However each test the login begins again)
2. We prepare the environment via API requests
3. We use cy.visit to start the test at a speicifc page in our app
The issue is that after step 3, the app displays the OLD data, prior to sending the data in our API. If we use cy.reload however, the page refreshes and we see the new data.
I tried to reproduce it manually and I did not encounter it, so it looks like a cypress-only issue. Obviously, the issue is that we never refresh the cache. How can we do it without cy.reload? Because reload takes a lot of time in each test.
Note: each test begins on a new, clean environment, so it's not an issue of not cleaning the environment from the previous test.