A good practice in automation testing is that every test is completely independent of other tests.
- do not rely on their order
- have no dependencies between them, no shared variables
- do not require any additional manual preparation
- they are small, they should verify just one feature
Benefits of independent end-to-end test cases:
You might be tempted to create one test for user registration and one for checking if the user is created. But all of these steps should be in one test only. You can't split it because one of the tests would need to wait until the first is finished. You won't be able to run the second test without running the first one, it will just lead to problems and so-called spaghetti between the tests.
Solution: simply create a single test with all of these steps, no dependencies, no problems
Here's an e