Testing · Senior · Question 43 of 75
How do Playwright fixtures differ from beforeEach hooks?
- ✓Correct answer: They're on-demand and composable: a test gets only fixtures it asks for, each has setup and teardown in one place, and they can be worker-scoped
- 2They run only once per file
- 3They are the same thing with a different name
Explanation
Example: a { scope: "worker" } fixture creates one account per worker, shared by its tests.