Is there a way to verify the URL without actually opening the page? The application is built on AngularJS and uses the ng-click method ($state.go) for navigation. I've researched Cypress stub and intercept options, but haven't found any solutions that address this specific issue.
I attempted the following:
cy.window().then((win) => {
cy.stub(win, 'open').as('redirect');
});
cy.get('@redirect').should(
'be.calledWith',
'myUrl'
);
However, this approach is intended for opening links in new tabs. I need a solution for navigating within the same tab. Any assistance would be greatly appreciated.
Thank you.