lecture 6 of 160 completed

Building the wait library your suite depends on

Ninety engineers writing waits individually produces ninety subtly different bugs. Encode correctness once.

What you'll learn

  • Which four wait mistakes engineers repeat
  • How to make the correct wait the easiest to write
  • How to enforce it so it does not decay

In a suite with no wait library, every engineer writes waits from memory. Some wait for presence when they meant visibility. Some read the element before waiting. Some hard-code timeouts. Every one of those is a flaky test waiting for a slow day.

The fix is not training. It is making the correct thing the easiest thing to write.

Start from what people actually get wrong.

Presence instead of visibility. elementLocated returns as soon as the element is in the DOM, which can be before it is visible or interactive. Then the click fails.

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →