'Is it a good practice to create a different database with seeded data for cypress to test?

Suppose I have to test the feedback feature where User A can provide feedback to User B. In that case, I need to log in to the app, make sure User A is a friend of User B, and other additional setup needed to make sure the feedback feature is available in UI. Then only I can write a cypress test to verify that feedback can be edited/added/deleted and stuff.

So, my question is what is a good idea for cases like this? Should I have a different server with a database where User A is already friends with User B and every other precondition related to the feature flag available? This way I can only focus on the actual flow.

Or should I add these conditions in the before hook and clean up after my test succeed?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source