Avoid flaky end-to-end tests due to poorly hydrated Frontends with Playwright's toPass()

Avoid flaky end-to-end tests due to poorly hydrated Frontends with Playwright's toPass()

Mar 27, 2024

In this video we'll dive into the world of flaky tests in Playwright and synthetic monitoring with Checkly. We examine a site with poor Frontend hydration patterns, their effect on test stability, and how to work around them.

Learn how to avoid using artificial delays and implementing a retry mechanism with Playwright's 'toPass()' method to achieve stable testing instead.

0:00 Intro

0:38 Example of a poorly hydrated page

2:17 Recommended fix for poor hydration

3:32 Custom action retries with 'toPass()'

5:18 'toPass()' options

6:12 Running Playwright using the `--repeat-each` option

6:43 Outro

Checkly Synthetic Monitoring: https://www.checklyhq.com/product/synthetic-monitoring/
Playwright 'toPass()' docs: https://playwright.dev/docs/test-assertions#expecttopass

#playwright #testing #monitoring #syntheticmonitoring