I have a javascript application and somewhere in the application I have to get the current address of the page by:
const currentUrl = window.location.href;
currentUrl should have some value like https//example.com/somepage/.
It works fine in manual testing, however, when I put the system under test with Cypress, the return value of window.location.href is different from what I expected:
https://www.example.com/__/#/specs/runner?file=cypress/e2e/integration/example.cy.js
This's the actual url on the Cypress browser address bar.
What caused this behavior and how can I fix it so that during e2e testing with Cypress, the window.location.href will return what I'm expecting it to return?