Playwright · Senior · Question 41 of 77
How do you clean up data created by E2E tests?
- 1Teardown in fixtures, plus a periodic job for leftovers
- 2Leave it, since staging databases never get full
- 3Delete the whole database after every single test
Show the answer
Correct answer: Teardown in fixtures, plus a periodic job for leftovers
Explanation
Fixtures delete what they created even on failure. Crashed runs still leave data, so a scheduled cleanup by prefix helps.