Playwright · Junior · Question 66 of 75
What does page.waitForTimeout(2000) do and why avoid it?
- 1Sets the test timeout to 2 s; too short
- 2Waits a fixed 2 s; it's slow and still flaky
- 3Waits for the network; it's fine for CI use
Show the answer
Correct answer: Waits a fixed 2 s; it's slow and still flaky
Explanation
Fixed waits are too long when the app is fast and too short when it's slow. Web-first assertions wait exactly as long as needed.