Web First Steps

Auto retrying matchers with a within N seconds budget. The shortest path from flaky to green.

Step phrasings in this group

The book sidebar lists each individual step page under this group.

Then "#dashboard" should be visible

Auto-retrying state assertion. Polls the live page until the matcher passes

Then "#loading-spinner" should not be visible

Auto-retrying negated state assertion.

Then "#hero" should be in the viewport

Assert an element's bounding box overlaps the visible viewport rectangle.

Then "#footer" should not be in the viewport

Assert an element is OUTSIDE the visible viewport rectangle.

Then ".product-card" should have a count of 12

Assert exactly N elements match a selector (auto-retry).

Then "h1" should have text "Welcome"

Assert an element's textContent equals an expected string (trimmed).

Then "h1" should contain text "Welcome"

Assert an element's textContent contains an expected substring.

Then "#email" should have value "alice@example.com"

Assert an input's value property equals an expected string.

Then "#tab-1" should have attribute "aria-selected" with value "true"

Assert an element's attribute equals an expected value.

Then "#tab-1" should have class "is-active"

Assert an element's class attribute contains a class token.

When I click the "Sign in" button

Click an element by its accessible role + name (Playwright getByRole).

Then the "Save changes" button should be visible

Assert a role-addressed element is visible (auto-retry).

Back to all step groups