Playwright · Senior · Question 73 of 77
How do you handle third-party scripts like chat widgets that slow tests?
- 1Wait for them to load fully before every action
- 2Remove them from production so tests run faster
- 3Block them with
page.routeunless the test is about them
Show the answer
Correct answer: Block them with page.route unless the test is about them
Explanation
Blocking analytics and widgets removes noise and network flakiness. A separate test can check the integration itself.