Transcript
00:00 When it comes to end to end tests, authentication is both a feature you want to test and a prerequisite to test other features. Let me explain. Think about the sites you use daily. Maybe it's your favorite social media or online banking or shopping or anything else really. I bet they allow you to authenticate in some shape or form.
00:18 So you go to the login page they have, you enter the credentials, and you let them know that you are in fact you. And your app may be no different. By offering your users some functionality to authenticate, you are creating a feature of your app and all the different authentication providers or methods are effectively just different paths how to get to that end state of being authenticated. In this context, you have to treat authentication as the feature it is. You have to arrange a test that would go to your login page and enter the credentials or use the appropriate authentication method, and then eventually arrive to that authenticated state.
00:51 And this is where the test would end. But you might be wondering, well, this is not how my users use my app. Sure, they go through this authentication flow, but only to get to some part, to some functionality that they actually want to use. And you would be right. This is why it's important to distinguish authentication as a feature and as a prerequisite for other features, or in other words, a dependency.
01:13 And how do we manage dependencies and tests? That's right in the test setup. So in this exercise blog you will learn how to test authentication in your app both as its feature and as a dependency for other features where it becomes a part of the test setup or in other words a given.
