web-first assertion
A Playwright assertion that keeps rechecking the page until the condition is true or a timeout expires.
In more detail
Because pages update asynchronously, checking once is flaky and sleeping a fixed time is slow. Web-first assertions pass the moment the page is right.
Related terms
- Playwright — Microsoft's open-source tool for automating Chromium, Firefox and WebKit browsers, widely used for end-to-end and visual tests.
- assertion — A check that a condition is true, which stops a test or program with a failure if it is false.
- flaky test — A test that sometimes passes and sometimes fails on the same code, because it depends on something it does not control.
- polling — Having the client ask repeatedly, on its own schedule, whether something has changed or finished.
Taught in
- End-to-End Testing with Playwright: Multi-Tier Suites — Production Full-Stack Engineering