e2e - Login okta
# i-need-help
c
Hi, I am trying to perform some e2e tests. I have to access a web application, and it redirects me to the okta login, I type user and password and click on the login button. When I do this it should redirect me again to my web application, but it does not. What it does is to return to the okta login. This does not happen manually, and using selenium either. How can I fix it? Thanks
b
Have you seen this document https://docs.cypress.io/guides/end-to-end-testing/okta-authentication ? It gives two different paths to authenticate with Okta. We use the programmatic login which allows us to authenticate and then load the app. That path does not display the login dialog.
c
But to use this option you have to change things in OKTa, don't you?
b
I am not sure what you mean by change things but we just created cypress environment variables (based on our Okta Dev Tenant). Reviewing the code (in the above link) I can't think of anything that required a change to our Okta client. Here is a link to the Okta auth-js package. It does most of the heavy lifting in programmatic login https://www.npmjs.com/package/@okta/okta-auth-js#node-js-and-react-native-usage