Best practice Login with a dispence/callback #14257
Unanswered
ricardovanlaarhoven
asked this question in
Questions and Help
Replies: 1 comment
-
I'm interested in this as well. |
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
-
We are developing against a development api which is live. So we don't have to setup the api per developer.
Everyone talks to the same API. For this reason i would choose to login with a static user.
I've learned that a best practice is to login before each test, and create this login programatically, and not part of every test.
For login calls which result in a token in the response body this would be really easy. Except the login method we are using results in a simple ok/not ok. When the login is ok we have to redirect to the API and this one redirects back to the application.
In this redirect is a token in the fragment (127.0.0.1:8080/auth/callback#token=1234). This is the token we would need to use in every test.
Doing this programaticaly like in the video here https://docs.cypress.io/guides/getting-started/testing-your-app.html#Step-1-Start-your-server is possible. But it would take very long before each request.
There are a lot of possibilities. At first the login should be a seperated spec for testing everything about the login. But my question is how to login before every spec
Beta Was this translation helpful? Give feedback.
All reactions