Playwright · Senior · Question 72 of 77
Why should a large suite avoid beforeAll that creates shared state for a file?
- 1After a failure the worker restarts, and state may be half-built
- 2
beforeAllruns once for the whole project only - 3It prevents tests in that file from using the
pagefixture at all
Show the answer
Correct answer: After a failure the worker restarts, and state may be half-built
Explanation
beforeAll reruns in new workers and couples tests. Per-test fixtures or worker fixtures are more predictable.