You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a web application that uses Oauth 2.0. Authentication happens via Oauth Implicit Flow. That means. The user is redirected to a login page. There he enteres username and password. And then he is redirected back to our application.
I am trying to write a Cypress test case for this. I did already read a lot about cypress.origin() command and more. But I still cannot get it to work.
cy.visit("/frontend-web-app")
// browser is now automatically forwarded to our-company.com/auth (HTTP 301)
// in the cypress test the URL at the very top (not in my app, but the cypress browser window changes!!!)
cy.get('#username').type(username)
cy.get('#password').type(pass)
cy.get('#loginButton').click()
// now the browser is redirected back to to our app. Cypress also shows our app. Successfully logged in.
// BUT THIS FAILS ????
cy.url().should('equal', "/frontend-web-app")
// the URL at the very top of the cypress browser still shows our-company.com/auth and not /frontend-web-app ????
The version at the top does not use cy.origin() at all. Login does work. But somehow the redirect back does not fully work. Any ideas?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have a web application that uses Oauth 2.0. Authentication happens via Oauth Implicit Flow. That means. The user is redirected to a login page. There he enteres username and password. And then he is redirected back to our application.
I am trying to write a Cypress test case for this. I did already read a lot about cypress.origin() command and more. But I still cannot get it to work.
The version at the top does not use cy.origin() at all. Login does work. But somehow the redirect back does not fully work. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions