Loading
Current section: Authenticated End-to-End 3 exercises
Problem

End-to-End User Flow Testing and Authentication Utility

Loading exercise

Transcript

00:00 So for this test, we're going to be doing a whole user flow. And this is actually a pretty typical end-to-end test. My end-to-end tests are typically pretty long, and it just follows the typical happy path for a user flow. Sometimes it'll do some sad path stuff, but most of the time we're doing happy path stuff in end-to-end tests.

00:19 OK, so here's the manual tester instructions. We're going to say log in with a user. We'll just use Cody. Cody loves you. And then we're going to go to that user, edit their profile, and enable two-factor authentication. So we'll go through this process right here.

00:34 I've got the two-factor OTP stuff right here to be able to generate a code. So now if I run node OTP, then that gives me a code that I can use. So we'll paste that in here. And so you're going to have to do all that. And then we get our two-factor authentication enabled.

00:52 And then we're going to go back here and log out. And then we'll go to log in. We'll log in with that same user. Cody loves you. Cody loves you. And then we'll have to do the two-factor auth code again. Copy this, paste that, submit that, and verify that we are logged in.

01:11 So those are the steps for this user. Now, it's important, a very important thing, as mentioned, to make sure you're not over-testing. And so we're going to need a utility for doing the authenticated state. We want to be able to just, I show up on the page,

01:31 and I'm already authenticated as a new user in the database. That's the objective here as part of this exercise, is to create a nice utility that makes it easy to start in that logged-in state. Right now, of course, we don't have that utility. And so our test is not going to work very well. We're supposed to go straight to the Settings Profile page and be logged in.

01:51 But we're not. And so that's your job, is to make it so that by the time I say Go to Settings Profile, we're already logged in. And with that, I think you have enough to get going. So yeah, get going.