How to handle the automatically re-directing url #28356
Unanswered
sreenarayan
asked this question in
Questions and Help
Replies: 1 comment
-
you can use the ones event handle on cypress like this :
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, In my project they changed login page. Now baseUrl is automatically re-directing to other url. But, if I directly accessing the re-directing url this takes to different page not the original page. How to access this in cypress. In cypress, it is not automatically re-directing. I have written the following code, but it is working for me.

Cypress.Commands.add('loginSession', (username, password) => {
cy.session(
[username, password],
() => {
// cy.visit('/app/zone');
cy.origin("https:/abccd.com",{args : [username, password]},
([username],[password]) => {
cy.visit("/idp/login_external/");
cy.get(SIGNINPAGE.email).should("be.visible").type(username);
cy.get(SIGNINPAGE.password).should("be.visible").type(password);
SIGNINPAGE.signInButton();
SELECTORS.searchAddress().should("be.visible",{timeout :60000});
})
},
)
});
Beta Was this translation helpful? Give feedback.
All reactions