Loading
Current section: Guides 6 exercises
Problem

Mock database

Loading exercise

Transcript

00:00 Up to this point whenever we created resources in the database we were actually writing in the same DB used during development. While it may sound practical, I highly encourage you to separate your test database and any other database instances you might have. The reason for that is simple, isolation. You are well familiar with the isolation on the test case level, but it doesn't stop there. Isolating your test database is equally as important.

00:26 By doing so, you will limit the number of things that are allowed to influence your test run, and also improve other aspects of testing such as the ability to debug failed tests. So if those happen, you'll be able to open the test db and observe its state. In this exercise, your task is to improve the test setup to use the designated test database. To do that, you will create a setup file where you will prepare the test database, then connect it to Playwrights and run the existing end to end test, making sure that all the resources they create are created in the designated test database.