Writing tests sometimes gets tricky when you have to reuse the setup multiple times (such as database or DOM). Your computer or CI pipeline will run all tests in parallel and it will try to use the same database. If you will want to write to the same table multiple times, or grab the DOM element multiple times at the same time, it may overwrite what you wanted to do in one test (race condition?).
To avoid this, you should always remember about isolating tests from each other, so you can have 100% assurance that your applications works as it should and your tests will suddenly not break.
Examples of test isolation
- Database Test Isolation
- DOM Isolation