---
source: https://iinventedlight.com/library/notes/playwright-async-assertions.md
title: "Playwright assertions retry until they pass or time out"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Playwright docs); Apache-2.0 (microsoft/playwright (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Playwright docs, Assertions, Apache-2.0 (https://raw.githubusercontent.com/microsoft/playwright/main/LICENSE). Copyright (c) Microsoft Corporation; microsoft/playwright (GitHub), expect matchers (Playwright source), Apache-2.0 (https://raw.githubusercontent.com/microsoft/playwright/main/LICENSE). Copyright (c) Microsoft Corporation."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: Playwright assertions"
tags: [playwright, assertions, expect, testing]
client: Librarian
sources:
  - id: S1
    title: "Assertions"
    publisher: Playwright docs
    url: https://playwright.dev/docs/test-assertions
    accessed: 2026-11-16
    license: "Apache-2.0"
  - id: S2
    title: "expect matchers (Playwright source)"
    publisher: microsoft/playwright (GitHub)
    url: https://github.com/microsoft/playwright/blob/main/packages/playwright/src/matchers/expect.ts
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# Playwright assertions retry until they pass or time out
**Answer:** Playwright assertions use the `expect` function. Generic matchers such as `toEqual` assert a value immediately. Playwright also ships web-specific async matchers that wait until the expected condition is met. The auto-retrying assertions retry until the assertion passes or the assertion timeout is reached. Those retrying assertions are async.

## call shape

Auto-retrying assertions are async, so you must `await expect(locator).toBeVisible()`.

## See also

- [playwright-locators](https://iinventedlight.com/library/notes/playwright-locators/)
- [playwright-headless-tests](https://iinventedlight.com/library/notes/playwright-headless-tests/)
- [playwright-fixtures](https://iinventedlight.com/library/notes/playwright-fixtures/)
- [playwright-route-mocking](https://iinventedlight.com/library/notes/playwright-route-mocking/)

## Claims

- id: C1
  claim: Playwright assertions are made with the expect function.
  source: S1
  evidence: "Playwright includes test assertions in the form of"

- id: C2
  claim: Auto-retrying assertions retry until they pass or time out.
  source: S1
  evidence: "The following assertions will retry until the assertion passes"

- id: C3
  claim: Retrying assertions are async.
  source: S1
  evidence: "retrying assertions are async, so you must"

- id: C4
  claim: The source module exports the toBeVisible matcher.
  source: S2
  evidence: "toBeVisible,"

## Sources

- [S1] Assertions. Playwright docs. https://playwright.dev/docs/test-assertions . License: Apache-2.0. Accessed 2026-11-16.

- [S2] expect matchers (Playwright source). microsoft/playwright (GitHub). https://github.com/microsoft/playwright/blob/main/packages/playwright/src/matchers/expect.ts . License: Apache-2.0. Accessed 2026-11-16.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Playwright docs, Assertions, Apache-2.0 (https://raw.githubusercontent.com/microsoft/playwright/main/LICENSE). Copyright (c) Microsoft Corporation; microsoft/playwright (GitHub), expect matchers (Playwright source), Apache-2.0 (https://raw.githubusercontent.com/microsoft/playwright/main/LICENSE). Copyright (c) Microsoft Corporation. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
