Use when no built-in matcher fits — still gets retries.
Synchronous expect for Plain Values
Use Playwright's expect() for locators and API responses. For plain JavaScript values inside page.evaluate, standard expect from the same import works synchronously.
Common Mistakes
Mixing sync expect on values that change asynchronously without poll.
Using Jest-only matchers not available in Playwright.
Setting timeout to 60s everywhere masking real performance issues.
Soft assertions without reviewing all collected failures.
Key Takeaways
Web matchers are async — always await them.
Use timeout option and expect.poll for special retry needs.
.not and soft assertions extend flexibility.
Keep generic expect for computed values inside steps.
Pro Tip
When migrating from Jest unit tests, rename imports carefully — Playwright's expect is not drop-in for all Jest DOM matchers without @playwright/test.
Continue with Web Assertions to build on what you learned here.