Application navigated using cy.origin is not able to open the page that appends dynamic key params to it #33178
Replies: 1 comment
-
|
Core problem Observed behavior Why this appears Cypress-related SPA vs full page reload Static SPA routes (e.g. /payments) work because they rely on client-side routing, which Cypress can track reliably. Workarounds Extract the target URL before navigation and visit it explicitly: Wait for a post-navigation element instead of asserting on the URL (only works if Cypress stays attached): Best-effort approach: read the URL after click (not guaranteed if a full reload occurs): Clarification:- The click itself works correctly. The issue is that Cypress does not detect or reattach to the navigation when it involves dynamic redirects or full page reloads. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am automating a flow that involves 2 applications (both on different origins). I generated some data on application 1 and now want to validate the same in application 2, thus navigated to new using cy.origin
function login(username: string, password: string) {
cy.visit('/')
cy.origin('https://***//', {args: {username, password }}, ({username, password}) => {
}
In the same application2, I am able to perform various actions by calling the POM methods where the URL is static pages e.g. /payments or /search etc except at one click where the URL adds dynamic hostKey and other details to its URL. Observed that the URL is not changing on the click and the page remains in loading state forever.
Has anyone faced and solved this issue, please confirm.
Beta Was this translation helpful? Give feedback.
All reactions