Transcript
00:00 One thing you will do in every end to end test that you write, and do quite often, is navigating between the pages in your app. And you already know that to do so you call the go to method on the page object. And you provide it the URL where you want to go, where relative paths will be resolved against the URL of your app. And because you're gonna be doing this pretty often, it would be nice to know when you're making a mistake in this path and going to a route that doesn't exist. And most importantly, know that before you waste your time running the test, waiting for it to complete, and then tell you that you made a mistake.
00:31 No, there is a much better way to do so and that is introduce this safety on the type level. In much simpler terms, I'm talking about type safe routing in your end to end tests. But rightfully so, the default go to function doesn't know about what kind of routes your application has. Playwright cannot assume the routing library you are using and what kind of types it generates, if any. This is where you have to teach it.
00:55 And that is precisely your task for this exercise. Follow the instructions to implement your own custom fixture called Navigate to support type safe routing in playwright tests. Once you do so, refactor the existing tests where you use this new fixture and enjoy the type safety end to end.
